http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag01/html/c0101.asp Q I've got a library that has some dialogs (and thus some re-source IDs). Now, using this library within a main app, the resource IDs collide with resource IDs in the app. The result is that instead of showing the library's dialog, the app dialog pops up. How can I avoid this? Do I have to set the resource IDs from the library manually? Hans ZwahlenA Alas, this is one of those problems that doesn't have any really satisfying solution, only a few intelligent workarounds. The fundamental problem is that every resource in Windows must belong to some module (EXE or DLL), and resources of a given type within a module can't have the same name or ID. With DLLs, this isn't a problem because your DLL has its very own HINSTANCE handle that distinguishes it from the app; but in a statically linked library, all resources must cohabit the same EXE file like a big extended family. And, as with families, there's always a potential for conflict. ………………
CMyDialog:Public CDialog
{...};
此语句应该放在什么地方??构造函数里面?另外,要使用以上类,必然要包含CMyDialog 的头文件(已经添加
"#include 动态链接库目录\Mydialog.h"),
此时又可能会出现编译错误--可能使用了重复定义常量。
Q
I've got a library that has some dialogs (and thus some re-source IDs). Now, using this library within a main app, the resource IDs collide with resource IDs in the app. The result is that instead of showing the library's dialog, the app dialog pops up. How can I avoid this? Do I have to set the resource IDs from the library manually? Hans ZwahlenA
Alas, this is one of those problems that doesn't have any really satisfying solution, only a few intelligent workarounds. The fundamental problem is that every resource in Windows must belong to some module (EXE or DLL), and resources of a given type within a module can't have the same name or ID. With DLLs, this isn't a problem because your DLL has its very own HINSTANCE handle that distinguishes it from the app; but in a statically linked library, all resources must cohabit the same EXE file like a big extended family. And, as with families, there's always a potential for conflict.
………………
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 137
#define _APS_NEXT_COMMAND_VALUE 32776
#define _APS_NEXT_CONTROL_VALUE 1009
#define _APS_NEXT_SYMED_VALUE 103使Wizzard 自动的避免冲突问题??或者使用资源链接库?该怎样使用?