> const char *gpgme_check_version (const char *req_version);
> 
> This function returns a string and takes either a string or null, depending
> on how you want it to work. For simplicity I'm passing nothing to it. In a C
> compiler I can get this to return the version number of the library so I
> know it's working.
> 
> In Labview (7.0) the closest I can get to this prototype using the "Call
> Library" node is
> 
> unsigned char gpgme_check_version(CStr req_version);
> CStr gpgme_check_version(CStr req_version);
> 


This signature either means that the caller is "giving" you a string 
that you are responsible for and you are supposed to delete later in the 
appropriate way, or they are giving you a pointer to a static storage 
that doesn't need to be deleted.  I think you have the second of these 
in this function.

If you need the return value to work, you will want to get it as a four 
by integer.  You won't be able to get it into a string without making 
another call to dereference the pointer, interpret it as a string, and 
copy the contents into a LV string.

I believe that I've seen Rolf detail this in other emails, but it can be 
done by calling into system libraries or into your own DLL where you can 
debug it more carefully.  Anyway, this is a rather ambiguous signature 
and thankfully not that common.  But you can't do it in the CLF dialog 
alone.

As Jason pointed out, LV doesn't pass empty strings as NULL.  If you 
want to pass NULL, build another signature passing the pointer as an 
integer and pass a zero.

Greg McKaskle


Reply via email to