cwierzynski wrote:
> Dear Community,
>
> I am trying to read a variable that is exported by a third-party DLL
> inside a LabView VI. If it were a function, then I would just use a
> "Call Library Function" subvi. But it's not a function; it's a
> variable, something like
>
> __declspec( dllexport ) int foo;
>
> as opposed to
>
> __declspec( dllexport ) int foo();
>
> Is there something like a "Read Library Variable" vi?
Nope! Although possible in Win32 DLLs (Win 3.1 had no standard form for
exported variables at all) it is very seldom used and in fact a bad idea
to do so. Notice that even some normal compilers are not able to
generate the correct export or import mechanisme for them. You could
write a wrapper DLL which exports a read and write function
to those
variables.
I guess with some magic voodoo it would be even possible to generate
some VI code to load the symbol with LoadLibrary and GetProcAddress and
reference the returned pointer as pointer to the variable. Still writing
a wrapper DLL is more secure and IMO the proper way to go.
Rolf Kalbermatter
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390