Page 1 of 1

Support for COM/ActiveX under Windows

Posted: Thu Aug 02, 2007 2:14 pm
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.

Posted: Thu Aug 02, 2007 2:21 pm
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

Posted: Mon Aug 06, 2007 4:15 am
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 :( .