LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone provide me the source code of a wrapper dll?

I want to pass a structure to a defined dll-function. This structure contains various sorts of data-types. I know I have to write a wrapper dll for that (what I did), but it doesn't seem to work. When creating my application, I get an "Unhandled exception" in my LabVIEW-file. It gives an error, which says: "The referenced memory at the instruction could not be written".

Can someone please provide me with an example of the source code for this wrapper dll I'm trying to create?
0 Kudos
Message 1 of 2
(2,780 Views)
You should be able to pass the structure directly to the DLL without a wrapper. Structures (struct) in those nasty text-based languages behave like clusters in LabVIEW. Make a cluster that matches the structure. Be sure to respect word boundaries. If the structure has a 16-bit element in it and there is a 32-bit element right after it, insert a 16-bit (U16) PAD in your cluster. Flatten the cluster to string to pass it to the DLL. Make sure to byte-swap and word-swap first because LabVIEW uses big endian while Windows uses little endian.

Daniel L. Press
PrimeTest Corp.
www.primetest.com
0 Kudos
Message 2 of 2
(2,779 Views)