NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with "msg->GetEvent();"

Hello,

I wrote a C++ program with the following code:

void __cdecl UIMessageCallback(struct IDispatch *UIMessageDisp)
{
TS::UIMessagePtr callbkmsg = UIMessageDisp;
long event = 0;
event = callbkmsg->GetEvent();

return;
}


But when I compile it, I get this error message:

--------------------Configuration: RunAgent - Win32 Debug--------------------
Compiling...
RunAgentComp.cpp
h:\runagent\debug\teapi.tli(8066) : error C2556: 'enum UIMessageCodes __thiscall TS::UIMessage::GetEvent(void)' : overloaded function differs only by return type from 'enum TS::UIMessageCodes __thiscall TS::UIMessage::GetEvent(void)'
h:\runagent\debug\teapi.tlh(6986) : see declaration of 'GetEvent'
h:\remote agent qc\remoteagent 2.0\runagent\debug\teapi.tli(8066) : error C2371: 'GetEvent' : redefinition; different basic types
h:\runagent\debug\teapi.tlh(6986) : see declaration of 'GetEvent'
Error executing cl.exe.

RunAgent.exe - 2 error(s), 0 warning(s)






Who can help me? Thanks in advance!!!
0 Kudos
Message 1 of 4
(3,381 Views)
Hi
It looks like teapi.dll is being #imported multiple times.

Can you post a simple project which gives you this error.

Regards
Anand Jain
National Instruments.
0 Kudos
Message 2 of 4
(3,360 Views)
From the third line after the header in the compiler report, it seems like you have declared "event" as a long, but the compiler found that "GetEvent()" returns an enum. Look at the declaration for GetEvent to see what data type it returns.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 4
(3,356 Views)
Thank you! That was it.
0 Kudos
Message 4 of 4
(3,333 Views)