S
Scott Masters
Guest
Using Visual Studio 2005, I have a C++ Win32 (dll) project that needs to use message queueing (MSMQ). In trying to import the COM interface to MSMQ, I use the statemement:
#import "mqoa.dll"
This seems to have a positive effect, since the presence of the statement causes the IDE (Intellisense) to automatically complete MSMQ statements and declarations as I type them in. However, when I compile, I get the error:
'c2653: MSMQ is not a class or namespace'
Below is sample code that produces the error. Note that with C++ Win32 projects, the Project menu does not let you add a reference. So how can I get the compiler to recognize what Intellisense does?
Thanks in advance!
Scott
#import
<mqoa.dll>
#include "stdafx.h"
#include "EsignalIF.h"
#ifdef
_MANAGED
#pragma managed(push, off)
#endif
BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
MSMQ::IMSMQQueueInfoPtr myQueueInfo (
"MSMQ.MSMQQueuInfo");
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Continue reading...
#import "mqoa.dll"
This seems to have a positive effect, since the presence of the statement causes the IDE (Intellisense) to automatically complete MSMQ statements and declarations as I type them in. However, when I compile, I get the error:
'c2653: MSMQ is not a class or namespace'
Below is sample code that produces the error. Note that with C++ Win32 projects, the Project menu does not let you add a reference. So how can I get the compiler to recognize what Intellisense does?
Thanks in advance!
Scott
#import
<mqoa.dll>
#include "stdafx.h"
#include "EsignalIF.h"
#ifdef
_MANAGED
#pragma managed(push, off)
#endif
BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
MSMQ::IMSMQQueueInfoPtr myQueueInfo (
"MSMQ.MSMQQueuInfo");
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Continue reading...