|
-
February 25th, 2009, 06:19 PM
#1
Error creating an object based on a dialog declared in a .rc resource file
Hi All,
I'm trying to create a new dialog in my .rc resource file and then create a
C++ object using it. As far as I can tell, I'm doing it the same way that other
dialogs have been implemented in this large legacy VC++ version 2.0 project,
but I get
error C2065: 'WMM_DOOR_CONTROLS' : undeclared identifier
upon compiling the file that tries to create the object, from the following line:
WMMAuxIOSelectDial AuxIOCtrl (this, WMM_DOOR_CONTROLS);
As far as I can tell, the only place this identifier is declared is with the
resource in the resource file; that is the only place the other dialogs'
ids are found.
Obviously, there is a lot I don't know. Is there some kind of initial build
step that I need to run to process the .rc file so that the identifier will be
found in a generated file?
This line is in a file that hasn't had any other dialogs yet. Is there something
else that needs to be added?
Do I need a .dlg file, as well, for this resource?
This is non-MFC, using SDK calls only.
I've tried a lot of small stuff with which I don't want to belabor this post,
and I've done a lot of web searching, however I'm hoping there's something easy
that I don't know about that I can try, and I haven't thoroughly searched all
the MSDN and usenet posts, but I have put in about twelve hours of banging my
head against this and I'll continue to search while awaiting any replies.
Much thanks for any help you can give me.
Here is my resource declaration:
---------------------
Code:
WMM_DOOR_CONTROLS DIALOG DISCARDABLE 200, 10, 162, 138
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Door Controls"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",-1,"Static",SS_BLACKFRAME | WS_GROUP,10,9,141,97
PUSHBUTTON "&Cancel",IDCANCEL,66,115,30,14
PUSHBUTTON "Door 1",WMM_IDB_SEL_RELAY1,20,18,122,14
PUSHBUTTON "Door 2",WMM_IDB_SEL_RELAY2,20,40,122,14
PUSHBUTTON "Door 3",WMM_IDB_SEL_RELAY3,20,62,122,14
PUSHBUTTON "Door 4",WMM_IDB_SEL_RELAY4,20,83,122,14
END
---------------------
Should I also post my WMMAuxIOSelectDial class code?
Best regards,
-
February 25th, 2009, 06:22 PM
#2
Re: Error creating an object based on a dialog declared in a .rc resource file
Additional note:
I searched *.* and *.h in my entire project, and the resource identifiers that compile successfully are not found. I have a set of files that builds, and I continually delete all object files and build those others successfully.
Could there be some other intermediary generated files that the build process is using in which the declarations have been satisfied, and the resource.h file that I need not checked out from my version control system and I never needed it because I had those intermediary files? This seems like a bit of a stretch.
I seem to have some resource files that have other names, such as w_resrc.h, but I searched *.* and *.h and didn't find the working identifiers anywhere.
How in the world can those others be getting built successfully?
I'm using a really old, legacy compiler, and it can be regarded as me just writing the .rc file in a text editor. I use the VC++6.0 IDE to help me with this, but, as I say the other resource IDs all compile, and *they* are not declared anywhere else that I can reasonably see.
Best regards,
-
February 25th, 2009, 06:41 PM
#3
Re: Error creating an object based on a dialog declared in a .rc resource file
In my initialization,
WMMAuxIOSelectDial AuxIOCtrl (this, WMM_DOOR_CONTROLS);
WMM_DOOR_CONTROLS just had to be in quotes:
WMMAuxIOSelectDial AuxIOCtrl (this, "WMM_DOOR_CONTROLS");
Good one, eh? That was two days I didn't need to spend...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|