PureDispHelper UserLib - Update with Includefile for Unicode

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

Very nice, thank you!
-Beach
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Hell! Thx TS !

Yet another brilliant Lib!

Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Most excellent contribution, should be taken native! Thanks so much for this.
Last edited by netmaestro on Fri Apr 20, 2007 3:53 pm, edited 1 time in total.
BERESHEIT
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post by Pantcho!! »

netmaestro wrote:Most excellent contribution, should be taken native! Thanks so much for this.
can we vote?

ahh I vote YES.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Good news: a unicode Version is in progress :wink: ,
but i think not 100% Syntaxcompatible.

The PB-TEAM has in the moment, no time for this, but we can hope a bit.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Q*bert
User
User
Posts: 27
Joined: Sat Dec 30, 2006 12:17 am
Location: Milwaukee, WI USA

Post by Q*bert »

WOW!!! :shock: This is fantastic!!!

This lib opens up (or at least makes easily accessible) a whole new world for PB developers.

Thanks so much!
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

New example by Kiffi

Code: Select all

; example by Kiffi

EnableExplicit

Define.l ExcelApp, Workbook

dhToggleExceptions(#True)

ExcelApp = dhCreateObject("Excel.Application")

If ExcelApp
  
  dhPutValue(ExcelApp, ".Visible = %b", #True)
  
  dhGetValue("%o", @Workbook, ExcelApp, ".Workbooks.Add")
  
  dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 1, 1, @"Feel")
  dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 2, 1, @"the")
  dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 3, 1, @"pure")
  dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 4, 1, @"Power")
  
  dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 1, 2, @"the")
  dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 1, 3, @"pure")
  dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 1, 4, @"Power")

  MessageRequester("PureDispHelper-ExcelDemo", "Click OK to close Excel")
  
  dhCallMethod(ExcelApp, ".Quit")
  
  dhReleaseObject(Workbook) : Workbook = 0
  dhReleaseObject(ExcelApp) : ExcelApp = 0
  
Else
  
  MessageRequester("PureDispHelper-ExcelDemo", "Couldn't create Excel-Object")
  
EndIf
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

This is great, please keep those examples coming! :)

For COM duffers like myself, I need all the examples I can get hold of!

Thanks.
I may look like a mule, but I'm not a complete ass.
akj
Enthusiast
Enthusiast
Posts: 668
Joined: Mon Jun 09, 2003 10:08 pm
Location: Nottingham

Post by akj »

This COM library is so important to the future of PureBasic and is likely to generate so many examples that I think a new Forum section called 'COM Objects' should be created.
Anthony Jordan
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

This community ROCKS!!!

Purebasic is the language!
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

srod wrote:This is great, please keep those examples coming! :)
Okay, for srod another agent example with Merlin :wink:

Code: Select all

; example by ts-soft

EnableExplicit

dhToggleExceptions(#True)

Define.l oAgent, oMerlin
Define.s item

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

If oAgent = 0
[img]http://ts-soft.eu/dl/puredisphelper.png[/img]  Debug "error: can't create object"
  End
EndIf

dhPutValue(oAgent, "Connected = %b", #True)
dhCallMethod(oAgent, "Characters.Load(%s,%s)", @"Merlin", @"Merlin.acs")
dhGetValue("%o", @oMerlin, oAgent, "Characters(%s)", @"Merlin")

If oMerlin = 0
  Debug "error: can't create object"
  End
EndIf

dhCallMethod(oMerlin, "Show")

If OpenWindow(0, 0, 0, 200, 200, "Merlin - Demo", #PB_Window_ScreenCentered|#PB_Window_SystemMenu) And CreateGadgetList(WindowID(0))
  
  ListViewGadget(0, 5, 5, 190, 165)
  ButtonGadget(1, 70, 177, 60, 20, "Play")
  
  Restore Merlin
  
  Repeat
    Read item
    If item <> ""
      AddGadgetItem(0, #PB_Any, item)
    EndIf
  Until item = ""
  
  dhCallMethod(oMerlin, "MoveTo(%d,%d)", WindowX(0) + 40, WindowY(0) - 120)
  dhCallMethod(oMerlin, "Play(%s)", @"GetAttention")
  dhCallMethod(oMerlin, "Play(%s)", @"GetAttentionContinued")
  dhCallMethod(oMerlin, "Speak(%s)", @"Can I do something for you?")
  dhCallMethod(oMerlin, "Play(%s)", @"GetAttentionReturn")
  SetGadgetState(0, 0)
   
  Repeat
  
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        CloseWindow(0)
        dhCallMethod(oMerlin, "Stop")
        dhCallMethod(oMerlin, "Play(%s)", @"Hide")
        Delay(3000)
        Break
    
      Case #PB_Event_MoveWindow
        dhCallMethod(oMerlin, "MoveTo(%d,%d)", WindowX(0) + 40, WindowY(0) - 120)
          
      Case #PB_Event_Gadget
      
        Select EventGadget()
          Case 1
            item = GetGadgetText(0)
            If Item = "Speak"
              Item = InputRequester("Merlin", "What should i say?", "")
              If Item <> ""
                dhCallMethod(oMerlin, "Speak(%s)", @Item)
              EndIf
            Else
              dhCallMethod(oMerlin, "Stop")
              dhCallMethod(oMerlin, "Play(%s)", @item)
            EndIf
        EndSelect
    EndSelect
    
  ForEver
EndIf

dhReleaseObject(oMerlin) 
dhReleaseObject(oAgent)

DataSection
  Merlin:
  Data.s "Acknowledge", "Alert", "Announce", "Blink", "Confused", "Congratulate"
  Data.s "Congratulate_2", "Decline", "DoMagic1", "DoMagic2", "DontRecognize"
  Data.s "Explain", "GestureDown", "GestureLeft", "GestureRight", "GestureUp"
  Data.s "GetAttention", "GetAttentionContinued", "GetAttentionReturn", "Greet"
  Data.s "Hearing_1", "Hearing_2", "Hearing_3", "Hearing_4", "Hide", "Idle1_1"
  Data.s "Idle1_2", "Idle1_3", "Idle1_4", "Idle2_1", "Idle2_2", "Idle3_1", "Idle3_2"
  Data.s "LookDown", "LookDownBlink", "LookDownReturn", "LookLeft", "LookLeftBlink"
  Data.s "LookLeftReturn", "LookRight", "LookRightBlink", "LookRightReturn"
  Data.s "LookUp", "LookUpBlink", "LookUpReturn", "MoveDown", "MoveLeft", "MoveRight"
  Data.s "MoveUp", "Pleased", "Process", "Processing", "Read", "ReadContinued"
  Data.s "Reading", "ReadReturn", "Sad", "Search", "Searching", "Show", "Speak"
  Data.s "StartListening", "StopListening", "Suggest", "Surprised", "Think", "Thinking"
  Data.s "Uncertain", "Wave", "Write", "WriteContinued", "WriteReturn", "Writing"
  Data.s ""
EndDataSection
Image

Have fun
Last edited by ts-soft on Sat Apr 21, 2007 11:42 am, edited 1 time in total.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

srod wrote:This is great, please keep those examples coming! :)

For COM duffers like myself, I need all the examples I can get hold of!

Thanks.
* Takes a seat in the duffers section *

Hear Hear!


This is really good. The problem now is the candy (flash, movies, etc) are distracting me from the meat (ADO, etc).
Dare2 cut down to size
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

:D

(Pokes head out from around duffers corner to ask ts-soft a ridiculously dumb question!)

ts-soft: when creating an object; e.g. in your example above, how do know the name of the object? E.g. you used 'Agent.Control.2' in the above example. Where do you find details on these names?

Thanks.
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

>> Where do you find details on these names?
PSDK, Ole-COM ObjectViewer, Help for VBScript/VB, Google, VB-Foren and Biily :wink:

Many c-examples in the source-package of disphelper!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Right, I think a crash course in VBScript is called for. :)

Thanks.

Reiterating someone else's suggestion; a COM section to these forums would be great, especially now that you've opened up the world of COM to duffers like myself and dare with this brilliant piece of work.

Right, who runs these forums? Fred lad where are you? :)
I may look like a mule, but I'm not a complete ass.
Post Reply