Good morning to all,
I would like to start to use the Ebasic COM capabilities but I need, if possible, of a help.
If I don't have misunderstood the help file, Ebasic allows two different approaches of COM programming, one with interface declaration and one without (script syntax).
Now my questions:
What is the more efficient method (interface/script syntax) in term of speed and resources ?
What is the syntax for the objects definition by using the script syntax approach? By studying the examples as that for Sapi.Voice, it seems to me that I need to use a COM browser (as that for Aurora written by Jose Roca), but I don't know if the browser listing needs a conversion for Ebasic and above all, I've not fully understood how as I can get the correct objects definition.
I've also googled the web, with muddling results.
Can someone help me?
thanks! :)
Sergio
Hi !
I like the new way to use COM via DispHelper interface. I just received an ADC board from Emant, and I had everything working in half an hour!
Yours Carlo
------------------------------------------------------------------------------------------------------------------------------------------------
Connection = CreateComObject("EMANT300COM.Wrapper", "")
GetComProperty(Connection,"%d",&_a,".ConfigDIO(%d)",8)
GetComProperty(Connection,"%d",&_a,".ConfigAnalog(%e,%d,%d)",1.25,0,25)
ii=0
volt=0
while ii<500
ii=ii+1
GetComProperty(Connection,"%d",&_a,".WriteDigitalPort(%d)",255)
GetComProperty(Connection,"%d",&_a,".WriteDigitalPort(%d)",0)
_volt2=0
for i=1 to 4
GetComProperty(Connection,"%e",&_volt,".ReadAnalog(%d,%d)",2,3)
_volt2=_volt2+_volt
next i
_volt2=_volt2/4*1000
print (millisecs()-timeiniz), " ",_volt2, " ", (_volt2-viniz)/_volt2*10^6, " ppm"
viniz=_volt2
WEND
getcomproperty(Connection,"%d",&_a,".Close")
Connection->Release()