[Gambas-user] Issue trying to access external Libraties

Benoit Minisini gambas at ...1...
Wed Jan 16 15:59:21 CET 2008


On mercredi 16 janvier 2008, Gareth Bult wrote:
...
> PUBLIC EXTERN virDomainGetInfo(dom AS Pointer, inf 
> AS String) IN "libvirt"
>

PUBLIC EXTERN virDomainGetInfo(dom AS Pointer, inf AS String) AS Integer 
IN "libvirt"

You must declare the type of the returned value.

Moreover, if virDomainGetInfo() returns something in 'inf', you must not 
use 'AS String', but 'AS Pointer'. You can use 'AS String' only if the 
function does not modify the string (the declaration in C is then 'const char 
*').

I suggest you read carefully the documentation on extern function declaration 
on the wiki.

Regards,

-- 
Benoit Minisini




More information about the User mailing list