Showing results for 
Search instead for 
Did you mean: 

why receive error C2365: 'Occur' : redefinition; previous definition was 'function' while trying to programm like the ni example



I try to detect WM like I saw it in a ni example ( When I compile my code I always receive error C2365. I declare Occure as FARPROC like the examplecode too. In the extcode.h is Occur already defined as a function TH_PROTECTED MgErr _FUNCC Occur(Occurrence o); .


This part is from the example:

FARPROC Occur; //A function pointer to the Occur function inside LabVIEW.exe


Has anyone an idea to fix that problem?


Best regards, AndreasE

0 Kudos
Message 1 of 3

I made a new test. I tried to build solution with the original code I found here: Same error will be issued.

0 Kudos
Message 2 of 3
Hello Andreas,

attached you’ll find the modified “Windows Messages for LabVIEW MT.cpp” file.
I was able to compile the file, after I modified it.
You can use your “Diff tool” in your IDE  to see the differences.

Kind regards

Message 3 of 3