LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pointers in call library function

Hi!

I have a shared object file (dll under Solaris) that I
want to access with Call Library Function. One of the
function in this library returns a pointer to a memory
buffer the following way:


unsigned short *create_memory(int fd, int xsize, int ysize) {

unsigned short *mem_fd;

mem_fd = (unsigned short *)mmap(0, xsize*ysize*2, (PROT_READ | PROT_WRITE), MAP_SHARED, (int)fd, 0);

...

return mem_fd;
}


where fd is a file descriptor obtained from an open
statement,
and mem_fd is the pointer to a buffer of size xsize*ysize*2.

This pointer is then used as input to many other functions in the same library.

My question is how can I use LabView Call Library Function (which can only be set to "void", "nume
ric" or "string") to get the pointer this function returns?

Any help will be appreciated

R.Lamontagne
0 Kudos
Message 1 of 2
(2,538 Views)
....
> This pointer is then used as input to many other functions in the same
> library.
>
> My question is how can I use LabView Call Library Function (which can
> only be set to "void", "numeric" or "string") to get the pointer this
> function returns?
>

An Int32 will work just fine. It will return the value to you, you pass
it into the other DLL calls, and the only important thing is that it be
stored in a four byte field.

Greg McKaskle
0 Kudos
Message 2 of 2
(2,538 Views)