Solved

DialogBox and resources

Posted on 2003-11-09
7
631 Views
Last Modified: 2013-12-03
hello,

I am having a hard time designing a simple dialog box as a resource and then displaying it modally with the DialogBox() call. Do I have to use LoadResource, FindResource and LockResource to display this? Or should I just be able to design it in the resource editor and simply call DialogBox() to see it; I currently use the latter but I get error code 1812 when I make the call. If it is more complicated than this i would appreciate the steps involved in creating this dialog.

Thank you.
0
Comment
Question by:caesarhernandez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 9711854
The error code is

//
// MessageId: ERROR_RESOURCE_DATA_NOT_FOUND
//
// MessageText:
//
//  The specified image file did not contain a resource section.
//
#define ERROR_RESOURCE_DATA_NOT_FOUND    1812L

It seems that you forgot to add the .rc file to your project. Apart from that, 'DialogBox()' will do fine. Don't forget to specify the resource ID in the 'MAKEINTRESOURCE()' macor as the 2nd parameter.
0
 

Author Comment

by:caesarhernandez
ID: 9711882
oK..that rocks. Thanks!
0
 
LVL 86

Expert Comment

by:jkr
ID: 9768430
So, you think we could close this Q?
0
 
LVL 86

Expert Comment

by:jkr
ID: 10801348
Question answered :o)
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question