Home > createdialog error > createdialog error 1813

Createdialog Error 1813

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 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 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up CreateDialog in BHO always fails with error 1813 (resource not found) up vote 0 down vote favorite I'm working on a BHO written a long time ago in C++, without the use of any of the VS wizards. As a result, this project deviates from the COM conventions and the boilerplate for a COM product. I worked with COM long ago, but never really did any Windows GUI/dialog stuff... I'm trying to add a dialog box to allow the user to set the values of some new settings: // serverDialog will be NULL HWND serverDialog = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_PROPPAGE_SETTINGS), NULL, DialogProc); id (!serverDialog) { int error = GetLastError(); //1813 ... } .... 1813 means that the resource cannot be found. The IDD used there is in resource.h, which I manually included where needed. DialogProc is defined as: INT_PTR CALLBACK DialogProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { return FALSE; } Which I know I will have to change later if I want the dialog to actually process messages, but I haven't gotten that far yet. The 1813 error suggests failure before the dialog is even created as does the NULL dialog handle returned. To add the dialog I used the Add Resource wizard and added a small property page. I've tried to follow advice here, but to no avail. Thanks! c++ winapi bho share|improve this question asked Sep 10 '15 at 16:13 MrSilverSnorkel 849 1 Maybe resource is not in GetModuleHandle(NULL). Test it with GetModuleHandle("fullpath") where "fullpath" is the exe/ocx/dll which holds the resource. –Barmak Shemirani Sep 10 '15 at 21:10 1 The error message is unequivocal. The resource is not there. You passed an instance of GetModuleHandle(NULL) which is the process module. But your BHO is surely in a DLL. So why would the resource be in the process module? Don't you need to pass the instance for your module? –David Heffernan Sep 10 '15 at 21:35 Accessing the current module's HINSTANCE from a static library. –IInspectable Sep 11 '15 at 0:37 @DavidHeffernan right you are! I also needed to change the third parameter from NULL to the the browser window handle to avoid a

Forum Visual C++ & C++ Programming C++ and WinAPI error 1813_the resource type cannot be found in the image file If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 5 of 5 Thread: error 1813_the resource type cannot be found in the image file Tweet Thread Tools Show Printable http://stackoverflow.com/questions/32506888/createdialog-in-bho-always-fails-with-error-1813-resource-not-found Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode January 5th, 2012,11:58 PM #1 procky238 View Profile View Forum Posts Junior Member Join Date Jan 2012 Posts 8 error 1813_the resource type cannot be found in the image file I'm trying to create a dialog from within the dll. I have a main window which is created using http://forums.codeguru.com/showthread.php?519892-error-1813_the-resource-type-cannot-be-found-in-the-image-file the CreateWindow() function and it takes the instance (hinstance) of the dll. hinstance variable is global in my case. I am calling createdialog() function using WM_CREATE message of CreateWindow(). CreateDialog() is being called from within a thread. In my case, I am using the same global hinstance for the window and the CreateDialog() function. Can I use the same instance for creating a window and creating a dialog from within the window? Am I seeing error 1813 (the resource type cannot be found in the image file) becuase of this? or is it that dll is not able to find the resource correctly? I also have two .rc files which dll uses (one is version.rc and other one is for the dialog resources). Can I use two resource files for one dll? Can somebody please help me with my questions. Please find the createdialog() function I am using. Thanks in advance. P.S. CreateDialog (g_hinstance, MAKEINTRESOURCE (DLG_MAIN), 0, (DLGPROC)DialogProc); Reply With Quote January 6th, 2012,04:26 AM #2 VictorN View Profile View Forum Posts Super Moderator Power Poster Join Date Jan 2003 Location Wallisellen (ZH), Switzerland Posts 18,671 Re: error 1813_the resource type cannot be found in the image file Does your g_hinstance conta

Password Register Blogs Community FAQ Projects Brighton Lounge General off-topic discussions. Political or religious topics may only be posted in The Basement forum. Site Information Rules & Guidelines Terms http://orbiter-forum.com/showthread.php?t=32458 of Service Privacy Policy Forum How-To F.A.Q. Orbiter F.A.Q. Bulletin Board F.A.Q. Project Tools F.A.Q. Blog F.A.Q. Search Search F.A.Q. Bugs, Features, Feedback View All Projects ORBITER 2010-P1 Site Support Community Links About Us Social Groups Photo Gallery Contacts Orbinauts List Forum Arcade Orbiter Links ORBITER Bug Reports Orbiter F.A.Q. Orbiter Download Orbiter Tutorials Recommended Addons Orbiter Website OrbiterWiki Go to Page... Thread Tools 10-19-2013, createdialog error 04:06 PM #1 BruceJohnJennerLawso Dread Lord of the Idiots Anybody here familiar with Win32? Hello everybody, Ive been working through forgers Win32 tutorial, mostly with lots of success. I recently hit a roadblock in getting the code to work that appears to be some sort of a configuration problem, probably due to the tutorial being written a decade ago. I posted the issue on createdialog error 1813 cplusplus.com, but no help yet, I was wondering if anyone could take a look at it for me? http://www.cplusplus.com/forum/windows/114042/ The code should work fine in theory, as it was included as an example with the tutorial, but I get createdialog() returning null every time. Any help would be greatly appreciated. BruceJohnJennerLawso View Public Profile Find More Posts by BruceJohnJennerLawso View Blog 10-19-2013, 04:57 PM #2 dbeachy1 O-F Administrator The reason the GetLastError() call is returning 0 (ERROR_SUCCESS) is because the original value is being replaced by the MessageBox(...) call: Code: g_hToolbar = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_TOOLBAR), hwnd, ToolDlgProc); if(g_hToolbar != NULL) { ShowWindow(g_hToolbar, SW_SHOW); } else { //int n = GetLastError(); MessageBox(hwnd, "CreateDialog returned NULL", "Warning!", MB_OK | MB_ICONINFORMATION); // <<<<<<<< this sets GetLastError() to zero (ERROR_SUCCESS) string nstring; std::ostringstream stream; stream << GetLastError(); // <<<< This returns zero because the MessageBox call succeeded. nstring = stream.str(); MessageBox(hwnd, nstring.c_str() , "Warning!", MB_OK | MB_ICONINFORMATION); } You need to call GetLastErrror() right away after the failed call before making any more Win32 API calls (including MessageBox), so what you want is something like this: Code: g_hToolbar = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_TOOLBAR), hwnd, ToolDlgProc); if(g_hToolbar != NULL) { Sho

 

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 1814

Createdialog Error p p p 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 relatedl appreciate some help with this Here is the source code -- http www apcx rror 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 STYLE DS MODALFRAME WS POPUP WS CAPTION EXSTYLE WS EX TOOLWINDOW CAPTION My Dialog Toolbar FONT MS Sans Serif