• Welcome to Theos PowerBasic Museum 2017.

DLLC

Started by John Spikowski, March 02, 2013, 07:56:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

John Spikowski

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

John Spikowski

The making of a TypeLib Browser

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

TLB_600_Template.zip

José Roca

I try to not duplicate posts.

John Spikowski

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.

Theo Gottwald

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.

John Spikowski

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.

José Roca

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.

John Spikowski

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?

Charles Pegge

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

John Spikowski

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.


John Spikowski

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.


John Spikowski

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.

José Roca

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...

John Spikowski

#13
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

José Roca

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.