[Gambas-devel] Parallel port

Rob sourceforge-raindog2 at ...19...
Mon Jun 2 17:45:57 CEST 2003


On Monday 02 June 2003 11:17, DA Corp. wrote:
>Thank you, but i don=B4t understand:=0D
>How i do add a C/C++ component in a file made in Gambas and how i do acce
>=de to those components?=0D

In the source tree for gambas itself, in the /src/lib directory, you will find 
a directory called "example".  That contains an example component in C with a 
LOT of comments in the source files.  If you know C, you should be able to 
write a component based on that code.

To access it within Gambas, after it's built and its .la and .so files are 
copied to /usr/lib (or wherever your Gambas libs live) you should just be 
able to go into project properties, select the Components tab, and add your 
component to the project.  Then you can use the component explorer to see how 
to access the methods and properties for your object, though since you will 
have written it you should have some idea how already ;)

Once you've done that, you can do things like

dim par as new ParallelComponent
par.Open("/dev/lp0")
par.WhateverItWasYouWantedToDo

and assign it event handlers and all that stuff.  I haven't actually done this 
myself but that's how I'm led to believe it works.

No, it's not as easy as being able to just access whatever API you want 
directly from Gambas, but I think it'll make for a lot more components being 
created (eventually, when Gambas gets more popular) and a lot fewer 
unsupportable Gambas projects with uncommented API calls everywhere like you 
see with VB.

Rob





More information about the Devel mailing list