Callback of Effect Plugin User Interface Crashes

Discussions for GoldWave plug-in development
Post Reply
suchit
Posts: 4
Joined: Sun Oct 28, 2007 3:15 am
Contact:

Callback of Effect Plugin User Interface Crashes

Post by suchit »

I just created an effect plugin. It works perfectly alright as long as I don't provide any CALLBACK procedure for GUI for its configuration.

When I provide CALLBACK proc of its GUI configuration, I see a crash.

All I am doing is as follows in the Page-derived UI class of mine:

Code: Select all

	void * gdecl Handle( void *parent )
	{
		if ( ! hwnd )
		{
			LPCTSTR	res = MAKEINTRESOURCE (IDD_MY_SETTINGS);
			hwnd = CreateDialog ( gInstance, res, (HWND)parent, DlgProc );

			...
			...
		}

		return hwnd;
	}
Now for the

Code: Select all

DlgProc
is as follows:

Code: Select all

BOOL CALLBACK DlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
	case WM_HSCROLL:

		MessageBox (hwnd, "scroll message", "event", MB_OK);

		break;

	}

	return DefDlgProc (hwnd, message, wParam, lParam);
}
When I start GoldWave and execute this effect plugin, GoldWave crashes.

Am I missing something?

Regards,
Suchit
GoldWave Inc.
Site Admin
Posts: 4375
Joined: Wed Mar 10, 2004 6:43 pm
Location: St. John's, NL
Contact:

Re: Callback of Effect Plugin User Interface Crashes

Post by GoldWave Inc. »

It is difficult to know without seeing more of your code. I'm guessing that 'hwnd' and 'gInstance' are initialized correctly and that Show(), Hide(), Width(), and Height() functions have been created. Is the resource file containing the dialog linked to the DLL? Does the problem still occur if you replace "DlgProc" with NULL in the CreateDialog() function?

Chris
suchit
Posts: 4
Joined: Sun Oct 28, 2007 3:15 am
Contact:

Post by suchit »

Got this thing working. I changed the callback procedure as follows:

Code: Select all

BOOL CALLBACK DlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
	case WM_XXXX:
		{

		}

		return TRUE;
	}
	
	return FALSE;
}
And made a friend function nof the effect plugin class. I initially added it as a static method.

Thanks for looking to it. We can close this issue.

Suchit
Post Reply