galtech wrote:
> I use a DLL where one fonction return a pointer to a int value.
> At the moment of the execution a this fonction, the value in the
> adresse of the pointer is null. After a time (about 500ms) the
> value is ok. How can I "read" the value at this time. Can I save
> the pointer of this int value to use it after?
Let me say this: This way of working is ABSOLUTELY nasty for a DLL!
It counters any proper programming style and makes multithreading with
this DLL virtually impossible. In DOS times this might have been a valid
way of operation but under a multithreading OS this is really not the
way to go.
Who can guarantee you that the DLL is still loaded when you try to
reference the pointer? There are other possible problems with this some
real and others might be not a problem yet but might get one in future
versions of OSses.
That said there is of course always a way to make this work although not
with a full guarantee that it will never crash under special
circumstances such as low memory situations or similar, which are beyond
your application control.
Configure the parameter of your Call Library Node as an uInt32 passed by
Value.
Then create a new Call Library Node and fill in folowing:
Library Name: LabVIEW
Function Name: MoveBlock
Calling Convention: cdecl
Execute in UI Thread
Return Value: void
1. Parameter: Name: source; Type: uInt32 passed by Value
2. Parameter: Name: dest; Type: int32 passed as Pointer
3. Parameter: Name: len; Type: int32 passed by Value
Wire your returned pointer to "source", a 0 constant to "dest", and a 4
constant to "len". The right terminal of "dest" will contain the value
of the supposed pointer if the DLL hasn't been swapped, trashed,
unloaded or whatever in the meantime.
Rolf Kalbermatter
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390