Theos PowerBasic Museum 2017

Webmaster: José Roca (PBWIN 10+/PBCC 6+) (SDK Forum) => COM Programming => Topic started by: John Spikowski on March 02, 2013, 07:56:16 AM

Title: DLLC
Post by: John Spikowski on March 02, 2013, 07:56:16 AM
Charles (forum member and OxygenBasic author) has been working on a replacement for the ScriptBasic DYC (FFI using DynaCall) that takes dynamic API scripting to new levels. Here is an example of using the Microsoft SAPI speech COM inferface. (iUnknown, vTable direct)


'COM SPEECH

VoiceObjGuid = dllguid("96749377-3391-11D2-9EE3-00C04F797396")
ISpVoiceGuid = dllguid("6C44DF74-72B9-4992-A1EC-EF996E0422D4")
Context      = 7
pUnkOuter    = 0
Voice        = 0
Release      = dllmeth( 2,"Release i=()")
Speak        = dllmeth(20,"Speak i=(t*pwcs,i flags,i pulstreamno)")
WaitUntilDone= dllmeth(32,"WaitUntilDone i=(i)")
print dllreco(speak)
Text         = dllwstr("ScriptBasic")
hr=0
dllcall(CoInitialize,0)
hr=dllcall(CoCreateInstance, VoiceObjGuid, pUnkouter, Context, ISpVoiceGuid, Voice)
if (hr=0) then
  print "connected to voice\n\n"
  print dllastr(Text) & "\n\n"
  dllcobj(Voice,Speak,Text,0,0)
  dllcobj(Voice,WaitUntilDone,0xFFFFFFFF)
  dllcobj(Voice,Release)
else
  print "SAPI Error " & format("%x",hr) & "\n\n"
end if
dllcall(CoUninitialize)


Example of SAPI in PB by José Roca
http://www.jose.it-berater.org/smfforum/index.php?topic=2694.0
Title: Re: DLLC
Post by: John Spikowski on March 03, 2013, 04:49:27 AM
The making of a TypeLib Browser (http://www.powerbasic.com/support/pbforums/showpost.php?p=420668&postcount=1)

I can't seem to find this download here on this forum.

TLB_600_Template.zip
Title: Re: DLLC
Post by: José Roca on March 03, 2013, 06:14:27 AM
I try to not duplicate posts.
Title: Re: DLLC
Post by: John Spikowski on March 03, 2013, 06:53:49 AM
I'm not a member of the PowerBASIC forum. They require a login to download attachments.

If you could make a copy available here or e-mail it to me, it would be much appreciated.
Title: Re: DLLC
Post by: Theo Gottwald on March 03, 2013, 07:21:16 AM
Why not get a memeber of PB Forum then?
I can imagine that some policies have changed, so if you keep your seat clean they may again let you in their living room.
Title: Re: DLLC
Post by: John Spikowski on March 03, 2013, 08:47:57 AM
Thanks Theo for your show of hospitality. I feel the PowerBASIC forum is for their customers which I'm currently not. I'm very happy with Charles efforts with OxygenBasic and what is going on with ScriptBasic. Once I see a release from the PB folks and can determine their direction, I might have another look as the landscape seem a bit brighter.

Quoteanybody interested in this stuff and willing to experiment can use it to implement his own code to generate interface declarations, enums, structures, constants, etc.

The reason I asked if a copy could be posted here is that the TypeLib 6.00 offering didn't seem PB specific.
Title: Re: DLLC
Post by: José Roca on March 03, 2013, 09:11:27 PM
It is not a full browser, but a template. It was yet anoter attempt to show how to use low-level COM with PowerBASIC. A waste of time. I give up.
Title: Re: DLLC
Post by: John Spikowski on March 03, 2013, 10:00:50 PM
José,

The low level COM interface Charles and I are working on for ScriptBasic may be a candidate for this effort and help describe the typelib so I can create wrappers with ScriptBasic functions.

Thanks for the tool and everything else you do that makes using COM understandable.

John

@Charles: Can you take a look at this and see if it can help define DLLC COM definition scripting?
Title: Re: DLLC
Post by: Charles Pegge on March 04, 2013, 12:27:03 AM
I've been studying the TLB 5 outputs for SAPI & see the Iunknown interfaces in there. I previously thought it was iDispatch only.

If you know what you want, it is quite easy to index the methods. On the Isp (Iunknowwn based) voice interface for instance, speak=20 and waituntildone=32. José's browser is certainly more informative than reading the C headers.

Charles
Title: Re: DLLC
Post by: John Spikowski on March 05, 2013, 05:08:45 PM
QuoteWhy not get a memeber of PB Forum then?
I can imagine that some policies have changed, so if you keep your seat clean they may again let you in their living room.

Good news, Jim approved my PB forum membership.

Title: Re: DLLC
Post by: John Spikowski on March 21, 2013, 08:35:33 PM
I had asked Charles if DLLC in its current form was able to do OLE Automation.

Quote... with Guids and callbacks in place we should have all the necessary ingredients for Automation.

I was wondering if the COM pros here could help out the ScriptBasic open source project with forging a minimal automation interface with DLLC? I think it would also serve as a good tutorial in COM programming.

Title: Re: DLLC
Post by: John Spikowski on May 05, 2013, 10:17:29 PM
That didn't last long. It seems I have been ban again on the PowerBASIC forum. I can't think of any rules I broke or posted anything unappropriated that would cause them to take this action. I sent an e-mail to support about it but didn't receive a response.  I guess I'm back to dressing in black and giving up my car for a broom.
Title: Re: DLLC
Post by: José Roca on May 05, 2013, 11:18:04 PM
Your status is not of banned, but of "Awaiting email confirmation". You also did choose to break the rules by using JR instead of you full first name, and probably something else...
Title: Re: DLLC
Post by: John Spikowski on May 06, 2013, 02:03:01 AM
Thanks for your reply.

I have already gone through the registration / conformation process awhile ago and actually made two posts. I was about to make a third when the forum software indicated that my account was under administrative review. If I try to log in as John Spikowski (old account) this is the message I receive.

Quote
You have been banned for the following reason:
No reason was specified.

Date the ban will be lifted: Never
Title: Re: DLLC
Post by: José Roca on May 06, 2013, 02:50:08 AM
IMO you should have sent an email to support asking to remove the ban. Re-registering and using ScriptBasic as the first word of your first post doesn't look to me like a good restart. But it is not my business.
Title: Re: DLLC
Post by: John Spikowski on May 06, 2013, 05:12:14 PM
PB & TB are both down. You shouldn't piss off the witch.   :D

P.S. My dry humor and I have nothing to do with the sites being down.