Solved

Using resource editor in MS VC++ 4.0

Posted on 1998-05-05
4
246 Views
Last Modified: 2013-12-03
I have a very simple program (from Schildt's "Windows 95 Programming") which has a single menu with just a couple options.  It works fine from VC++ V4.0 IFF I hand edit the resource script from scratch.  I want to use the provided resource editor.  When I try it, it creates the menu in a .rc file, it provides a resource.h file (which I include) and when I BUILD ALL, it appears to be compiling the resource script.  But, when I run the program, there simply is no menu at all.  I have not made any changes to the .c file which worked just fine with the hand-editted resource script, and have made sure that all of my identifiers are the same.  But It just does not link in the resource file.  What am I doing wrong?
0
Comment
Question by:kmullin
  • 3
4 Comments
 

Accepted Solution

by:
waimun earned 50 total points
ID: 1399325
Have you include the resource.h file in your .c file?
#include "resource.h"
...
try the above
0
 

Author Comment

by:kmullin
ID: 1399326
I found my answer through other means.  The answer was this:
Schildt's book had me code:
     wcl.szlpMenuName = "MyMenu";
which worked fine.  But, when the resource editor creates it, it modifies (something?) that doesn't want a character string as the menu name value (as above.)  It wants an integer value that specifically identifes the menu.  The resource editor provides this in the resource.h file in the form of a #define, as in
     #define MYMENU 101
So, I had to change the code (remove the quotations) with
     wc.szlpMenuName = MYMENU;
and it works fine.  THAT's the piece I was missing.

To be fair to waimum, he didn't have enough to work with.
0
 

Author Comment

by:kmullin
ID: 1399327
I have a follow up question.

Using the solution found above, I get numerous warnings from the compile.  This is really hokey!  Does anyone know if there is another way?
0
 

Author Comment

by:kmullin
ID: 5718367
I found the answer to this question as well.  In my solution, I said I coded
     wc.szlpMenuName = MYMENU;
But what I had to do, to prevent the warnings, was code it using a Windows provided macro, as in:
    wc.szlpMenuName = MAKEINTRESOURCE(MYMENU);
and THAT suppressed the warnings.

I'm going to delete the question, because I found the answer.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now