Support for COM/ActiveX under Windows

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Yogi Yang
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 2:19 pm

Support for COM/ActiveX under Windows

Post by Yogi Yang »

This request may have been made before. but along with this I also have to a link that everyone interested even remotely in COM/ActiveX should read.

http://www.desaware.com/tech/ipersiststream.aspx

Mind you this is not marketing. it is just an interesting story which throws light on the internals of how COM/ActiveX objects work and should be managed.

probably by reading this article Fred or some other good developer see some light of the day as to how to integrate support for COM/ActiveX in PB.

Thank you.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Have a look at the PureDispHelper userlibrary http://www.purebasic.fr/english/viewtopic.php?t=26744

DispHelper is a COM helper library that allows you to call COM objects with an easy printf style syntax : http://disphelper.sourceforge.net/

Example :

Code: Select all

dhToggleExceptions(#True) 

Define.l oAgent, oGenie 

oAgent = dhCreateObject("Agent.Control.1") 

If oAgent 
  dhPutValue(oAgent, "Connected = %b", #True) 
  dhCallMethod(oAgent, "Characters.Load(%s)", @"Genie") 
  dhGetValue("%o", @oGenie, oAgent, "Characters(%s)", @"Genie") 
  If oGenie 
    dhCallMethod(oGenie, "Show") 
    dhCallMethod(oGenie, "MoveTo(%d,%d)", 300, 200) 
    dhCallMethod(oGenie, "Play(%s)", @"Greet") 
    dhCallMethod(oGenie, "Speak(%s)", @"Hello, feel the ..Pure.. Power of PureBasic") 
    dhCallMethod(oGenie, "Play(%s)", @"Reading") 
    Delay(20000) 
    dhCallMethod(oGenie, "Stop") 
    dhCallMethod(oGenie, "Speak(%s)", @"PureBasic is a nice computer language") 
    MessageRequester("Agent", "click ok to end") 
    dhCallMethod(oGenie, "Play(%s)", @"Hide") 
    Delay(3000) 
    dhReleaseObject(oGenie) 
  EndIf 
  dhReleaseObject(oAgent) 
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Yogi Yang
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 2:19 pm

Post by Yogi Yang »

gnozal wrote:Have a look at the PureDispHelper userlibrary http://www.purebasic.fr/english/viewtopic.php?t=26744
Sorry friend I did not know that this has been already converted to PureLib long back :( .
Post Reply