Home > createdialog error > createdialog error 1814

Createdialog Error 1814

applications. I'm having a problem getting a dialog box to pop up on top of my main window ...the CreateDialog() method returns a NULL for some reason. Would really appreciate some help with this. Here is the source code -- http://www.apcx.3rror.com/main.cpp (the program runs, but the test condition for CreateDialog()'s return value shows a NULL value is returned) The resource file: Quote: #include "windows.h" IDD_TOOLBAR DIALOGEX 0, 0, 98, 52 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_TOOLWINDOW CAPTION "My Dialog Toolbar" FONT 8, "MS Sans Serif" BEGIN PUSHBUTTON "&Press This Button",IDC_PRESS,7,7,84,14 PUSHBUTTON "&Or This One",IDC_OTHER,7,31,84,14 END Window Procedure of the main window... Quote: Code: LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch http://archicad-talk.graphisoft.com/viewtopic.php?p=98494 (message)
{

case WM_CREATE:
{
hDialog = CreateDialog(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_TOOLBAR),hwnd, ToolDlgProc);
if(hDialog != NULL)
{
ShowWindow(hDialog, SW_SHOW);
http://forums.codeguru.com/printthread.php?t=377230 }
else
{
MessageBox(hwnd, "CreateDialog returned NULL", "Warning!", MB_OK | MB_ICONINFORMATION);
}
}
break;
//handle other messages...
} ...where the (HWND) hDialog is declared as global variable. Message Handling function of the dialog box... Quote: Code: BOOL CALLBACK ToolDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_PRESS:
MessageBox(hwnd, "Hi!", "This is a message", MB_OK | MB_ICONEXCLAMATION);
break;
case IDC_OTHER:
MessageBox(hwnd, "Bye!", "This is also a message", MB_OK | MB_ICONEXCLAMATION);
break;
}
break;
default:
return FALSE;
}

() mail ! gmail ! com [Download message RAW] On Fri, Nov 12, 2010 at 14:20, John Brown wrote: > > Fri, 12 Nov 2010 13:16:07 -0800, Mark Wagner wrote: > > > On Fri, Nov 12, 2010 at 13:01, Mark Wagner  wrote: > > > On Thu, Nov 11, 2010 at 17:49, John Brown  wrote: > > > > > > > > > > > > On Thu, 11 Nov 2010 12:24:58 -0800, Mark http://marc.info/?l=mingw-users&m=128960106412926&w=2 Wagner wrote: > > > > > > > > > > On Wed, Nov 10, 2010 at 22:18, John Brown  wrote: > > > > > > > > > > > > On Wed, 10 Nov 2010 15:33:59 -0800, Mark Wagner wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > I have the following resource file which defines a dialog template. I > > > > > > > convert it into a .o file using "windres" and link it into my project. > > > > > > > > > createdialog error > > > > > #include > > > > > > > > > > > > > > dlgStatus DIALOGEX 22, 17, 350, 150 > > > > > > > STYLE WS_POPUP | WS_BORDER | WS_CAPTION | WS_VISIBLE | DS_CENTER > > > > > > >            | DS_SHELLFONT > > > > > > > CAPTION "Diagnostic Tool" > > > > > > > FONT 8, "MS Shell Dlg" > > > > > > > BEGIN > > > > > > > CTEXT "Text", 6002, 10, 10, 330, 100 > > > > > > > PUSHBUTTON "Cancel", IDCANCEL, 150, 110, createdialog error 1814 50, 15 > > > > > > > END > > > > > > > > > > > > > > I create and show the dialog using the following code: > > > > > > > > > > > > > > CreateDialog(hInst, L"dlgStatus", NULL, BusyDialogProc); > > > > > > > > > > > > > > However, this fails with an error code of 1814 > > > > > > > (ERROR_RESOURCE_NAME_NOT_FOUND). Any ideas about what I'm doing > > > > > > > wrong? > > > > > > > > > > > > > > -- > > > > > > > Mark > > > > > > > > > > > > > > > > > > > I would remove the L prefix from your string. If you have not #defined \ > > > > > >  UNICODE, then by default you are really calling CreateDialogA, which \ > > > > > > will convert ANSI strings to Unicode, but you are already passing a \ > > > > > > Unicode string, so when it tries to convert it ... > > > > > > > > > > > > I suppose that you could also call CreateDialogW explicitly. > > > > > > > > > > I've tried it with and without the L, and neither makes any difference. > > > > > > > > > > -- > > > > > Mark > > > > > > > > > > > > > > > > > > My observations: > > > > > > > > 1) The dialog box appears if I create a modal dialog box with > > > > DialogBox(). > > > > > > > > 2) L"dlgStatus" is definitely wrong - (1) does not work with > > > > L"dlgStatus"

 

Related content

createdialog error 1812

Createdialog Error p Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us Are you relatedl aComputer IT professional Join Tek-Tips Forums Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All It's Free Join Us Tek-Tips's functionality depends on members receiving e-mail By joining you are opting in to receive e-mail Posting Guidelines Promoting selling recruiting coursework and thesis posting is forbidden Tek-Tips Posting Policies Jobs Jobs from Indeed What Where jobs by Link To This Forum Add Stickiness To Your Site By Linking

createdialog error 1813

Createdialog Error p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about relatedl Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up CreateDialog in BHO always fails with error resource not