LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using windows dll

Through labview application, i want to set the properties window parameters when right clicking the application icon, and view Summary tab on windowsXP. Can any one suggest whether is it possible.
0 Kudos
Message 1 of 6
(3,278 Views)
Hi,

This is definately possible, however it may taka some work. It may also require a C or C++ compiler to create a dll that LabVIEW can call to get the results.

Some of the Windows SDK functions that you would need to call are GetFileSize(), GetFileTime(), GetFileTitle(), GetFileVersionInfo(). You can get more information on this functions at MSDN under File Management Functions.

It will probably be best if you compile this into a C/C++ DLL and have LabVIEW call it.

I hope this helps.

Regards,
Juan Carlos
N.I.
0 Kudos
Message 2 of 6
(3,278 Views)
hi Juan,
Thanks for your interest.
My requirement is to set (or) write values to the 'summary attributes' property window under windows 2000/XP.
I have directly called Version.dll from labVIEW "Call Library function" and set type as 'Adopt to Type' and pass the values particular function variable (string datatype). I have tried this, but when i am running, program quits from labview environment. Can you get back to me regarding this.Thanks in advance.
0 Kudos
Message 3 of 6
(3,278 Views)
vijayasiva wrote:
> hi Juan,
> Thanks for your interest.
> My requirement is to set (or) write values to the 'summary attributes'
> property window under windows 2000/XP.
> I have directly called Version.dll from labVIEW "Call Library
> function" and set type as 'Adopt to Type' and pass the values
> particular function variable (string datatype).

And this is highly wrong. A LabVIEW string is in its native incarnation
quite different from a C string which is what most WinAPI functions
expect. So make sure to configure those parameters as String, pointer to
string instead, but not Adapt to Type.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 6
(3,278 Views)
vijayasiva wrote:
> hi Juan,
> Thanks for your interest.
> My requirement is to set (or) write values to the 'summary attributes'
> property window under windows 2000/XP.
> I have directly called Version.dll from labVIEW "Call Library
> function" and set type as 'Adopt to Type' and pass the values
> particular function variable (string datatype). I have tried this, but
> when i am running, program quits from labview environment. Can you get
> back to me regarding this.Thanks in advance.

The documented functions in version.dll are to retrieve information, not
to change it. In fact I doubt there is a documented API to modify that
information.

Also if you pass string parameters to a DLL you have to make sure that
buffer is allocated in the callin
g application (e.g. here LabVIEW). You
do that by Initializing an array of unsigned 8bit integers of the
necessary size, passing it to the ByteArray to String node and then to
the Call Library Node.
Also WinAPI functions are almost always using stdcall calling
convention, so you need to configure the Call Library Node accordingly.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 6
(3,278 Views)
Crashing LabVIEW when calling external code is usually the way you know that some parameters are wrong. What function are you calling? may be I can give it a try here.

All of the suggestions here are very valuable when calling external code. Make sure you have the right calling convetion, use C string and reserve the memory in LabVIEW beofre calling the dll.

I hope this helps.

Juan Carlos
0 Kudos
Message 6 of 6
(3,278 Views)