?
Solved

Using resource editor in MS VC++ 4.0

Posted on 1998-05-05
4
Medium Priority
?
252 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
[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
4 Comments
 

Accepted Solution

by:
waimun earned 100 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

765 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