Solved

Using resource editor in MS VC++ 4.0

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

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

Suggested Solutions

Title # Comments Views Activity
Microsoft Query from QuickBooks 9 76
Windows Process running 3 61
windbg taking it's time 32 100
Starting to use Git with Visual  Studio Online 1 24
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

733 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