CreateDialogParamA API Problem

Started by halsten, May 01, 2008, 12:15:59 PM

Previous topic - Next topic

halsten


hDlgLog = CreateDialogParam(ghInstance, (LPCSTR) DLG_LOG, hTab, DlgLog, 0);


When compiling the previous line it generates the following error:


'CreateDialogParamA' : cannot convert parameter 1 from 'void *' to 'struct HINSTANCE__ *'


Any idea on why is it doing that? Thanks in advance.

DMac

WinMain will provide this for you:


int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
            ghInstance = hInstance;

hDlgLog = CreateDialogParam(ghInstance, (LPCSTR) DLG_LOG, hTab, DlgLog, 0);


In the event that this is not an option you can do the following:


int main(int argc, char *argv[])
{
HINSTANCE ghInstance;

ghInstance = GetModuleHandle(NULL);

hDlgLog = CreateDialogParam(ghInstance, (LPCSTR) DLG_LOG, hTab, DlgLog, 0);


regards,
DMac
No one cares how much you know,
until they know how much you care.

halsten

I already had this written in my code. The problem is with the compilation and not what's written.