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
Solved

Using resource editor in MS VC++ 4.0

Posted on 1998-05-05
4
249 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 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