LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Weird problem with Call Library Function

Folks,
I'm writing my own DLL and calling functions in it with Call
Library Function. When I add a few new lines to the code (
some calls to EnterCriticalSection, LeaveCriticalSection) all
of a sudden Labview says it can't find the functions. Other
utilities, such as quick view, show that the functions are
still there and being exported with the correct names. Is there
some size limit I'm crossing over? Some other reason the
DLL can't load?
I'm using VC++ version 5, running under NT.
Thanks in advance...
_______________________________
Paul Probert
Associate Scientist
The University of Wisconsin-Madison
608 263 3752
fax 608 262 1267
pprobert@facstaff.wisc.edu
0 Kudos
Message 1 of 4
(3,183 Views)
> I'm writing my own DLL and calling functions in it with Call
> Library Function. When I add a few new lines to the code (
> some calls to EnterCriticalSection, LeaveCriticalSection) all
> of a sudden Labview says it can't find the functions. Other
> utilities, such as quick view, show that the functions are
> still there and being exported with the correct names. Is there
> some size limit I'm crossing over? Some other reason the
> DLL can't load?
> I'm using VC++ version 5, running under NT.

There aren't any size limits, at least not any that are specific to
LV. One thing to watch for is that you unload and reload the new
DLL. Try closing the VI that calls the DLL, update the DLL, and
then reload the VI.

The other problem could be that the project settin
gs have changed
so that the function declaration has changed. This doesn't sound
that likely.

Greg McKaskle
0 Kudos
Message 2 of 4
(3,183 Views)
Greg McKaskle wrote:
>
> There aren't any size limits, at least not any that are specific to
> LV. One thing to watch for is that you unload and reload the new
> DLL. Try closing the VI that calls the DLL, update the DLL, and
> then reload the VI.
>
> The other problem could be that the project settings have changed
> so that the function declaration has changed. This doesn't sound
> that likely.
>
> Greg McKaskle

Last night I figured it out. Its interesting- it turns out that
Labview was loading the dll, and its dllmain was being called
with PROCESS_ATTACH as the reason, and due to a programming error
of mine in the dllmain function, the function would bomb and exit.
Labview then tells you that it can't find the
exported function, but that's not t
he real problem. The way I found out
was to have the dllmain function open and write a log file before
it got around to crashing.
_______________________________
Paul Probert
Associate Scientist
The University of Wisconsin-Madison
608 263 3752
fax 608 262 1267
pprobert@facstaff.wisc.edu
0 Kudos
Message 3 of 4
(3,183 Views)
Paul Probert wrote:

> Last night I figured it out. Its interesting- it turns out that
> Labview was loading the dll, and its dllmain was being called
> with PROCESS_ATTACH as the reason, and due to a programming error
> of mine in the dllmain function, the function would bomb and exit.
> Labview then tells you that it can't find the
> exported function, but that's not the real problem. The way I found out
> was to have the dllmain function open and write a log file before
> it got around to crashing.

Paul:

For the benefit of all of us, could you perhaps look back at your case as
an example and suggest a better way of debugging a DLL intended for use
ultimately with LabVIEW? Say calling it first with a C program to make sure
all the functions a
re working correctly, before trying it with LabVIEW and
adding to the confusion? I'm no DLL-meister myself, just wondering.

Thanks,

Rod
--
Roderic Don
Research Associate II
University of Delaware
Center for Composite Materials
302-831-8701
302-831-8525 (FAX)
0 Kudos
Message 4 of 4
(3,183 Views)