Thanks....looking in to the AFX_MANAGE_STATE macro now.
That's something I've seen littered here and there in these DLLs before, but never really knew what it did.
Printable View
Thanks....looking in to the AFX_MANAGE_STATE macro now.
That's something I've seen littered here and there in these DLLs before, but never really knew what it did.
I'm still a little confused on exactly how the AFX_MANAGE_STATE works.
The previous architecture was an APP that called a (MFC) DLL that called this DLL (COM component) to display the resources within a function call.
Now its similar, but without COM. APP->(MFC)DLL->MFC DLL.
I tried the AFX_MANAGE_STATE(AfxGetStaticModuleState( )); macro, but to no avail. From another page I looked up and from your comments and what I read on the MS page linked by Vladimir, I'm thinking I need to run in the context of the main app when I open the dialog. Is that right?
I'm seeing an example on an MSDN forum post that shows passing in the Window Handle (from the APP in my case I'm guessing) and using that in the constructor of the Dialog. Does it sound like I'm on the right track at all?
My personal experience is that I don't use MFC to handle resources that are found in other modules. I create DLL's (non-MFC DLL's) that need resources loaded from other DLL's, and I have never used anything but the low-level API's to handle the resources.
It's one of the few cases where IMO it's easier doing this the low-level API way -- just storing HINSTANCE handles of your modules, and then calling LoadResource(), FindResource(), LoadString() etc. with the appropriate instance handle. You have control over which module's resources gets loaded, displayed, etc. instead of relying on what amounts to a "global" setting.
In my situation, it isn't easy (next to impossible really) to control resources using the AFX_MANAGED_STATE macro (but in most situations other than what I use resources for, it works).
Regards,
Paul McKenzie
Why did you copy resoure file textually?
I would start an empty project and copy over the files. I haven't used VC2005 but shouldn't it convert V6S project files?
Editing resource files is nothing but trouble.
Start and empty project and copy the files over. I have several large V6S, if I have to copy over the resource file manually for about 60 dialog boxes I'm in trouble.
Try creating some small projects in V6S and covert them to get idea how to convert them. ... I still think that VS2005 should automattically convert V6 projects, maybe only V2003 does it.
...either way, just copying the project files should work though, stay in the C++ world.