LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Example for CVI created dll for VC calling

I need to create a dll from Labwindows/CVI , and this CVI dll should be called
from a VC2005 application. There will be big block of dynamic image data stream
sharing between the CVI-dll and the VC app.
 
Who can I work it out? I go through some material, while I have little idea. I need
an example.
 
 
 
0 Kudos
Message 1 of 12
(5,464 Views)
Help?
 
I need examples.
0 Kudos
Message 2 of 12
(5,433 Views)
Hi,

first, create your DLL in CVI.

You'll have two files which are necessary for your VC Project
the .dll and the .lib.

Then, create your VC project, and in Properties , add your .lib to use it.
You'll have to configure a path to your dll so that your  application can use it.

Maybe you'll also have to use cvirt.lib and cvisupp.lib in your project if your dll uses CVI specific functions.




Message Edité par NI_Device_user_sb le 07-07-2008 08:15 AM
0 Kudos
Message 3 of 12
(5,424 Views)

Thank you, but too simple.

I need an example.

 

0 Kudos
Message 4 of 12
(5,405 Views)
Hi,


did you build your DLL in CVI or do you need help for this?
0 Kudos
Message 5 of 12
(5,398 Views)
Acutually, in one case, I need to build the dll in CVI and I would call the dll from VC2005. I hope that CVI uir and fps could be added to this dll.
 While in another case, I need to build the dll in VC2005 and I would call the dll from CVI. I would like to add MFC class and self defined class
in In this dll. Also, I would like to introduce an interface in this dll which is capable of calling external Matlab dlls.
 
I need examples for both and I could not find good ones under "dll" example folders of CVI 8.5.
 
BTW:  I am using an original CVI software and we have 1 year privilege of upgrading. 


帖子被Jademobile在07-21-2008 08:34 PM时编辑过了
0 Kudos
Message 6 of 12
(5,322 Views)
Hi,

I know the first case From CVI to VC2005.
In a VC2005, I needed INI Files functions. So, I created a project with inifile.h and inifile.c.

Then I built a inifile.dll with CVI (just configure target settings) and Build a Release version. Then I used this library in a VC2005 project with C++.

I'm also using a User Interface file .uir, but it is not included in the .dll. I don't think it can be included( in my opinion).
I used the uir file with my VC application and you just need to link to the interface by using a .c file containing callbacks.

I encourage you to try building the dll by yourself and inform us about problems you encounter. (I think it is the best way to learn )

0 Kudos
Message 7 of 12
(5,315 Views)
I would like to create a dll by CVI8.5 and this dll should by called from VC2005.
 
I managed to create this dll from \CVI85\samples\dll\simple dll example. In this example, both dll and caller are write by CVI8.5.
Now I would like to change the caller from CVI8.5 to VC2005. I copy the .h .lib and .dll files from dll project to VC2005 project.
I add cvirt.lib and cvisupp.lib. But it still occur link error LNK2019. plz see the attachment.
 
Plz see the attachment
 
 
Download All
0 Kudos
Message 8 of 12
(5,308 Views)
Hi,

I obtained the same error and I'm not friend with .dll files.

The only way I program is, writing my code in a .c file. Declarations are in a header file (.h)
The include file is called in the source file.

Then I build my dll and use it.

All notions about DLLEXPORT IMPORT etc...  I don't know how to use this.

Hope someone will help you. If not, I think you should rewrite your code so that it is easier to link in your VC project.
0 Kudos
Message 9 of 12
(5,289 Views)
I modified the CVI project and build a dll.

I call the header in the source file.


I used it on VC2005 and it was succesful. Try it and say to me if it works.


0 Kudos
Message 10 of 12
(5,282 Views)