LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ridiculous errors in "extcode.h"

Hi everyone,
I have a problem in Labwindows/Cvi. I created a dll in Labview 7.1, and I have to use this dll in my another project in Labwindows/Cvi. But after adding the .lib, .dll and .h files belonging to the dll to my project, I am getting far out errors in "extcode.h" which is included in the .h of the dll. Really unbelievable errors, because it is written that;

"extcode.h"(431,45)   syntax error; found '<' expecting ')'.
"extcode.h"(431,45)   Missing identifier.
..
...

For these lines in "extcode.h"

...
#if !Palm
TH_REENTRANT int32            Abs(int32);
TH_REENTRANT int32            Min(int32, int32);
TH_REENTRANT int32            Max(int32, int32);
TH_REENTRANT int32            Pin(int32, int32, int32);
TH_REENTRANT Bool32            IsDigit(uChar);
...
...

Like these, there are 20 errors and most of them are about the lines above there which are completely right. Actually, this header file belongs also to Labwindows.

Should I change the build options, or something like this, or am I doing something wrong during the linking process of the dll to the project? Does anyone have an idea? If yes, I would be really appreciated.
Thanks,
Burcu


--
Burcu
0 Kudos
Message 1 of 22
(6,663 Views)

It looks to me that 'Min' and/or 'Max' are being defined as macros before extcode.h is parsed.

So in the main file or in the header files above extcode.h, is there a line that starts

#define Max(...

and/or

#define Min(...

?

--
Martin
Certified CVI Developer
Message 2 of 22
(6,657 Views)
There aren't any macro definitions for the Min(),Max() functions above the code.
Actually, I got over the problems, I don't know how, but the compiler now doesnt prompt any error messages about it. Instead of it, this time I am getting the error below, during the execution of the program, when a function in the dll is called:

 <mda:msg xmlns:mda="http://schemas.microsoft.com/CLR/2004/10/mda">
   <!--
        DLL 'C:\Program Files\National Instruments\Shared\LabVIEW
        Run-Time\7.0\DNCompInfo.dll' is attempting managed execution inside OS Loader
        lock. Do not attempt to run

--
Burcu
Message 3 of 22
(6,653 Views)
Hey Burcu,

This error that you're seeing can be seen in several different environments - not just CVI.  Are you using Managed Code (that is, calling any .NET assemblies from the LabVIEW DLL)?

Here are several documents and forums that address this exact error message:
http://forums.ni.com/ni/board/message?board.id=170&message.id=164820&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=197717&requireLogin=False
http://digital.ni.com/public.nsf/websearch/68C08222FE20F0AE862571B1005102CC?OpenDocument
http://digital.ni.com/public.nsf/websearch/BFD127B62F848492862571E80062F919?OpenDocument
http://msdn2.microsoft.com/en-us/library/d21c150d.aspx

Hope this helps!
Thanks,

Andy McRorie
NI R&D
Message 4 of 22
(6,621 Views)
I examined the links that you sent, carefully. Thanks for that. It was written that the managed code problem is solved in LabView 8, so i installed it, but the problem still remains:( Actually I  am not sure, that I use a managed code in my vi in LabView. Because it is a vi for just playing a part of a wav file, and I used Snd Read Wave File, Array Subset and Snd Write Wave File. That's all.  And I am building a dll of this, and trying to use it in LabWindows/CVI, but it doesn't work..:( An error window is opened and immediately closed, because of the Managed Debugging Assistant's Loader Lock error.
What can be the reason of the problem? Does anybody have an idea ? If so, I will be really glad.

Thanks,
--
Burcu
0 Kudos
Message 5 of 22
(6,579 Views)
Hey Burcu,

I'm not sure since this is more of a LabVIEW issue.

However, I believe that the LabVIEW Sound VIs changed in LabVIEW 8.0.  I created your application (or similar) in LabVIEW 8.0 and it works fine.  I have attached it to this thread.  Note that I am using the Sound VIs for LabVIEW 8.0.  Perhaps the old sound VIs used some different elements.

If either these new VIs are not suitable or you still get the error message, you might try posting on the LabVIEW forums.
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 6 of 22
(6,542 Views)
Dear McRorie,
I tried to run your project. But it failed, because of the version of my CVI (7.1). And I got the;
"The format of the file is newer than this version of CVI"   error for the .uir user interface file.
After installing the new version of CVI, I will try it again.

Thanks for your help & attention,
--
Burcu
0 Kudos
Message 7 of 22
(6,524 Views)

I am attaching a modified version of Andy CVI project that may help solving your problems. On one hand I have saved UIR file under CVI 7 so you should be able to open it with your ide. On the other hand I have reworked a little the source code to eliminate some errors similar to those you are finding while compiling your code. I had some compiling errors on Min and Max functions previously defined and found that those functions are defined twice, once in toolbox.h and the second in extcode.h, but in the last file  they are defined as _FUNCC which on windows systems defaults to _cdecl while in toolbox.h they are defined as CVIFUNC which defaults to _stdcall. May toolbox.h be included in your project either directly or referenced by some of your code? If so, you may see if it is really necessary and if so you could move that part of your code that uses the LV dll into another source file in which you #undef those macro before #including extcode.h.

I hope this may help you to solve your problems.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 8 of 22
(6,490 Views)
I got over the syntax errors thanks to your solution. Actually I was using the 'toolbox.h' header file besides  the 'extcode.h'. I also tried the  project that you sent, it works fine, but it doesnt play a part of a wav file.
Now there are no syntax errors within my own project, but it goes on prompting this error message which is about the 'Managed Debugging Assistant':

<mda:msg xmlns:mda="http://schemas.microsoft.com/CLR/2004/10/mda">
   <!--
        DLL 'C:\Program Files\National Instruments\Shared\LabVIEW
        Run-Time\7.0\DNCompInfo.dll' is attempting managed execution inside OS Loader
        lock. Do not attempt to run

I don't know the reason, but as I searched in web, it is written that it may be using managed code. But how can I determine if it uses a managed code or not?
--
Burcu
Message 9 of 22
(6,454 Views)

Unfortunately I'm not so fond on interfacing LV DLLs into CVI so I'm not able to help you anymore. Smiley Sad

Just as a side note, Andy's code does not plays anything: it's LV code simply extract part of the wav file and creates a new file on disk with a subset of the original wav file. And it does not fire any 'Managed Debugging Assistant' error message on my machine! Smiley Surprised It is possible that you have installe some additional software I don't have on my pc.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 10 of 22
(6,450 Views)