Solved

DialogBox and resources

Posted on 2003-11-09
7
628 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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run Program using VBScript 3 73
Access Query (QBE) Using VBA Function for Criteria 13 63
SignTool Error with Windows 10 5 184
Licensing Sharepoint 2016 for developers 11 62
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 …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…

820 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