User forums > Using Code::Blocks

DialogBox problems

(1/1)

riderrocker:
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

Jenna:

--- Quote from: riderrocker on January 12, 2010, 07:22:37 am ---I'm kinda frustrated, because it worked with Dev and not here, and Code::Blocks is  better at everything else

--- End quote ---

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"

Navigation

[0] Message Index

Go to full version