Author Topic: DialogBox problems  (Read 4070 times)

riderrocker

  • Guest
DialogBox problems
« on: January 12, 2010, 07:22:37 am »
Hi, I was trying to create a modal dialog box with DialogBox(), and the function keeps failing.
my code:
   DialogBox(GetModuleHandle(0), MAKEINTRESOURCE(DL_CREATE), hwnd, (DLGPROC)DialogProcCreate);

DL_CREATE is the id of a dialog resource, and DialogProcCreate is my dialog proc.
I know they work because the dialog ran with my Dev C++ IDE

with Code::Blocks, the DialogBox returns -1, and calling GetLastError() returns 87, which is the error
code for "invalid parameter"

I'm kinda frustrated, because it worked with Dev and not here, and Code::Blocks is  better at everything else

thanks

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: DialogBox problems
« Reply #1 on: January 12, 2010, 07:35:31 am »
I'm kinda frustrated, because it worked with Dev and not here, and Code::Blocks is  better at everything else

You should look for the differences in your configuration.
It's definitely not a C::B problem , because Code::Blocks is "just" an IDE, not a compiler.

That's whay your topic violates our forum rules and will be locked !

Nevertheless one tip to find your problem:

Double check your compiler and project settings and turn on full commandline logging to see what is sent to the compiler:
change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline"