LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error and DLL

Hi Andrey,

Thank you for your help,


According to a Visual C++ forum http://forums.msdn.microsoft.com/en-US/vcgeneral/thread/deeb70e6-5000-416b-8eda-509703bc056c/

It seems that I have to install the Visual C++ 2008 Redistributable on the target computer.

An other problem is occuring, indeed I know how to make an installer of my VI with application builder. But I don't know how to include the Visual C++2008Redistributable installation in this installer...

Maybe someone knows some tips to do it ....

Thank you,

Best Regards,
Jérôme.
0 Kudos
Message 11 of 17
(1,099 Views)

Hi, Jérôme

You can include Visual C++ 2008 Redistributable into installer as normal executable.
Read here:
How Do I Make My LabVIEW-built Installer Run an Executable After Installation?

best regards,
Andrey.

Message 12 of 17
(1,090 Views)
Hi Andrey,

If I understand well (according to msdn http://msdn.microsoft.com/en-gb/library/wx3b589t.aspx ),  I just have to make a Setup Project which create me an installation executable. Then, i'll have to include it in the labview installer ?

Well...

I have to learn how to make a setup project !! 😉

Thank you again,

BR

Jérôme.
0 Kudos
Message 13 of 17
(1,078 Views)

Hi, I think you don't need to build additional setup project in MSVC. Just download this executable: Microsoft Visual C++ 2008 Redistributable Package , add it to LabVIEW project, as described above, and run it at the end of installation. That's all.

Andrey.

 

0 Kudos
Message 14 of 17
(1,074 Views)
Hi Andrey,

I solved this problem by rewriting the DLL in order to be free of /clr. Moreover I use /MT option in Librairie Runtime in the project option.

I tested the created DLL in LabVIEW on my computer (with VISTA), it works well.

I use this DLL on the other computer (with XP). When I configure the "Appeler une fonction DLL" (in english "call a DLL function" maybe), everything works well. I don't have any of the previous error messages.

I checked that the "call DLL function" configuration was the same for the both computer.

But it doesn't work !!!!!

I post my code along with my DLL

The goal of this DLL is to take the WriteHandle et the ReadHandle of the HID device I want.

why do you think my dll still doesn't work

Thank you for your help !

Best Regards,

Jérôme.
Download All
0 Kudos
Message 15 of 17
(1,055 Views)

Hi, Jérôme,

When you wrote "...it doesn't work" then it assumed at least two important parts: what you expected to see and  what you saw instead?

From my point of view your DLL is OK. I will recommend to make following:
- change return type of your "connectHID" function from void to int
- put return 1 immediately at the beginning.
- check that 1 returned to LabVIEW on your XP machine.
- 1 is returned? If so, then your DLL fully OK.

In additional you should think a little bit about error handling. Functions SetupDiGetClassDevs(...), SetupDiEnumDeviceInterfaces(...), etc may return error codes, you should check it, and then return error codes to LabVIEW for further check and handling... So you can immediately get point where execution on the XP machine differ from execution under Vista...

best regards,
Andrey.

0 Kudos
Message 16 of 17
(1,051 Views)
Hi Andrey,

Thank you for your advice, indeed i didn't know how to prove if my probleme came from my programs or my DLL !

Actually, my ongoing problem came from i used two different OS.

Indeed, in VISTA, device ID string is in the uppercase (ex : HID/VID_04D8&PID_0040) . In XP, device ID is a mix of uppercase and lowercase (ex : HID/Vid_04d8&Pid_0040)

i have solve the problem by putting everything in (lower case).

Many thanks four your help !!

Best regards,

Jérôme.
0 Kudos
Message 17 of 17
(1,006 Views)