[Gambas-user] Issue trying to access external Libraties

Gareth Bult gareth at ...1689...
Wed Jan 16 00:43:13 CET 2008


Hi, 

I'm trying to call functions from an external "C" library and I'm getting so far, then running into a problem. 

I have; 

P UBLIC EXTERN virConnectOpenReadOnly(host AS String) AS Pointer IN "libvirt" 
PUBLIC EXTERN virDomainLookupByID(con AS Pointer, id AS Integer) AS Pointer IN "libvirt" 
PUBLIC EXTERN virDomainGetInfo(dom AS Pointer, inf AS String) IN "libvirt" 

So far so good ... 

PUBLIC SUB Form_Open() 

DIM con AS Pointer 
DIM dom AS Pointer 
DIM inf AS Pointer = Alloc(32) 

con = virConnectOpenReadOnly("xen+tls://nodeb/default") 
dom = virDomainLookupByID(con, 0) 
PRINT virDomainGetInfo(dom, inf) 

END 

Which looks good, and traced through with "F8" until I get to the print line which gives me; 

"Type Mismatch: wanted Void, got Null instead" 

The "C" header definition is; 
int virDomainGetInfo( virDomainPtr domain, virDomainInfoPtr info) Can anyone tell me what I'm doing wrong? 

This is a standard library and the equivalent "C" code works fine .. 

??? 

tia 
Gareth. 




More information about the User mailing list