COMate - control COM objects via automation - OBSOLETE!

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

What does

Code: Select all

debug func\GetIntegerProperty("NUMBER_OF_ENTRIES") 
report?
I may look like a mule, but I'm not a complete ass.
glops
User
User
Posts: 38
Joined: Wed Jan 16, 2008 12:53 pm
Location: France

Post by glops »

It reports

0
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Ack, without the dll's installed on my system I'm just bumbling around in the dark here. Sorry, but it looks like I'll be of little help here!
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Could the Func.Call (Func\Invoke("Call")) not be setting the number of entries because you have commented out the tENTRIES lines?

I am wondering if Func\Invoke("Call") could return success when it is actually not working as expected because this table object has not been referenced? It's probably a long shot, but then long shots tends to be the best bet when hunting bugs!

What I suggest is that you run the Visual Basic code and comment out the equivalent lines to see if you get a similar result? (And I still think that "Value" needs to be included! :wink: )
I may look like a mule, but I'm not a complete ass.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Marco2007 wrote:A small example for those, who uses Outlook:

Code: Select all

IncludePath ".."
XIncludeFile "COMate.pbi"

Define.COMateObject OutlookObject, olMsg

OutlookObject = COMate_CreateObject("Outlook.Application")

If OutlookObject

  olMsg = OutlookObject\GetObjectProperty("CreateItem(0)")
   If olMsg
    olMsg\SetProperty("to='JR_Ewing@COMate.com'")
    olMsg\SetProperty("Subject='Marco'")
    olMsg\SetProperty("Body='Write whatever you want'")
    olMsg\Invoke("Display")
;    olMsg\Invoke("send") ; if you wanna send
;    olMsg\Invoke("Quit") ; if you wanna quit

    olMsg\Release()
    Else
      MessageRequester("Sorry", COMate_GetLastErrorDescription()) 
  EndIf
OutlookObject\Release()  
Else
  MessageRequester("Sorry - CreateObject", COMate_GetLastErrorDescription())
EndIf
lg
Marco
Possible to make it work with OutLook Express?
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Post by Kiffi »

ricardo wrote:Possible to make it work with OutLook Express?
if i remember correctly, the automation of Outlook Express is not possible.
There is no official way to do it by COM

Greetings ... Kiffi
Hygge
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

As much as I love using COmate for the WMI stuff, I found I had to be careful using some items in WMI. The reason is some of the WMI items are for Vista only and don't work in WinXP, so a careful reading of the msdn will prevent some head aches. I use Windows Vista, but when the request came for something that worked on both winXP and Vista I, confidently armed with Comate, jumped into action and started putting something together. For example, the below rough code i'm putting together for a project, I spent six hours tearing my hair out trying to figure out why it didn't work on winXP. Then I read the msdn again and noticed the note; "Windows XP, Windows 2000, and Windows NT 4.0: This property is not available.", you can see the comments in the code. Luckly there was a work around I could use in WMI instead of resorting to some converted C++ code and the rest of the API which would have inflated the size of the project and added complexity I didn't want, and besides I wanted to use WMI anyway for which COmate is perfect. When this gets done its going to be part of an automatic configuration check scheme for configuring network parameters for computers remotely, this is only one part, theres some stuff in here that will not be in the final product.

Code: Select all

XIncludeFile "COMate.pbi"
XIncludeFile "VariantHelper_Include.pb"

Structure My_ADAPTER_INFO 
  Index.l
  Device_Index.l 
  Adapter_GUID_Name.s 
  Description.s 
  MACAddress.s 
  IPAdress_ipv4.s
  IPAdress_ipv6.s
  Net_ConnectionID.s
  LeaseObt.s
  LeaseExp.s
  DhcpServer.s
  HaveWins.s
  Wins_Pri_Server.s
  Wins_Sec_Server.s
  DNS_Server_1.s
  DNS_Server_2.s
  DNS_Server_3.s
  DNS_Domain_Name.s
  DNS_Host_Name.s
  DNSDomainSuffix_1.s
  DNSDomainSuffix_2.s
  DNSDomainSuffix_3.s
  Network_Status.s
  FullDNS_Reg.s
  GW_Server_1.s
  GW_Server_2.s
  GW_Server_3.s
  DHCP_Static.s
  Type.s
EndStructure

Global NewList My_Adapter_Info_List.My_ADAPTER_INFO()

Procedure.s Dt_Time(date_time.s)

  Lease_yr$ = Left(date_time, 4)
    
    Select Mid(date_time, 5, 2)
        Case "01"
          Lease_mo$ = "January"
        Case "02" 
          Lease_mo$ = "February"
        Case "03" 
          Lease_mo$ = "March"
        Case "04"
          Lease_mo$ = "April"
        Case "05" 
          Lease_mo$ = "May"
        Case "06" 
          Lease_mo$ = "June"
        Case "07"
          Lease_mo$ = "July"
        Case "08"
          Lease_mo$ = "August"
        Case "09"
          Lease_mo$ = "September"
        Case "10"
          Lease_mo$ = "October"
        Case "11"
          Lease_mo$ = "November"
        Case "12"
          Lease_mo$ = "December"
        Default
    EndSelect
  
  Lease_dy$ = Mid(date_time, 7, 2)
  Lease_hr$ = Mid(date_time, 9, 2)
  Lease_mn$ = Mid(date_time, 11, 2)
  Lease_sc$ = Mid(date_time, 13, 2)
  UTC_Offsetx.l = Val(Mid(date_time, 23))
  UTC_Offsety.l = UTC_Offsetx / 60
  
  If Mid(date_time, 22,1) = "-"
  UTC_Offset$ = "- " + Str(UTC_Offsety) + " Hrs"
  EndIf
  
  If Mid(date_time, 22,1) = "+"
  UTC_Offset$ = "+ " + Str(UTC_Offsety) + " Hrs"
  EndIf
  
  colon$ = ":"
  Lease$ = Lease_mo$ + " " + Lease_dy$ + " , " + Lease_yr$ + "    " + Lease_hr$ + colon$ + Lease_mn$ + colon$ + Lease_sc$ + "  Hrs" + "  UTC Offset  : " + UTC_Offset$

ProcedureReturn Lease$
EndProcedure

Procedure.l GetNetWorkStatus(Net_IP_X$) ; temp for testing only

For xk=1 To 4

x_unk_net$ = StringField(Net_IP_X$, xk, ".")

If xk = 1 And Len(x_unk_net$) > 0
  ip_part_1$ = x_unk_net$
  Else
    If xk = 2 And Len(x_unk_net$) > 0
    ip_part_2$ = x_unk_net$
  Else
      If xk = 3 And Len(x_unk_net$) > 0
      ip_part_3$ = x_unk_net$
  Else
  If xk = 4 And Len(x_unk_net$) > 0
  ip_part_4$ = x_unk_net$
      EndIf
    EndIf
  EndIf
EndIf
  
Next xk

If ip_part_1$ = "10"
  Net_x1.l = #True
Else
    If ip_part_1$ = "169" And ip_part_2$ = "254"
    Net_x1.l = #True
  Else
      If ip_part_1$ = "172" And Val(ip_part_2$) >= 16 And Val(ip_part_2$) <= 31
      Net_x1.l = #True
  Else
    If ip_part_1$ = "192" And ip_part_2$ = "168"
    Net_x1.l = #True
      EndIf
    EndIf 
  EndIf
EndIf

If Net_x1.l = #True
My_Adapter_Info_List()\Network_Status = "On network or behind router"
Else
My_Adapter_Info_List()\Network_Status = "Probably not on network or behind router"
EndIf

EndProcedure

Procedure.s Adapter_Type_Interface(Adapt_Index.l)

Define.COMateObject objWMIService, Adapter
colAdapters.COMateEnumObject

strComputer.s = "." 
Net_I_Index$ = Str(Adapt_Index)

objWMIService = COMate_GetObject("winmgmts:\\" + strComputer + "\root\cimv2", "") 
If objWMIService 
  ;colAdapters = objWMIService\CreateEnumeration("ExecQuery('Select * from Win32_NetworkAdapter Where InterfaceIndex= $0027" + Net_I_Index$ +"$0027')") ; win Vista only
  colAdapters = objWMIService\CreateEnumeration("ExecQuery('Select * from Win32_NetworkAdapter Where Index= $0027" + Net_I_Index$ +"$0027')") ; winXP and Win Vista
  If colAdapters 
    Adapter= colAdapters\GetNextObject() 
    While Adapter
      My_Adapter_Info_List()\Adapter_GUID_Name = Adapter\GetStringProperty("GUID")
      My_Adapter_Info_List()\Net_ConnectionID = Adapter\GetStringProperty("NetConnectionID")
      
      Select Adapter\GetIntegerProperty("AdapterTypeID")
        Case 0
          Adapter_Type$ = "Ethernet 802.3"
        Case 1 
          Adapter_Type$ = "Token Ring 802.5"
        Case 2 
          Adapter_Type$ = "FDDI"
        Case 3
          Adapter_Type$ = "WAN"
        Case 4 
          Adapter_Type$ = "LocalTalk"
        Case 5 
          Adapter_Type$ = "Ethernet DIX header format"
        Case 6
          Adapter_Type$ = "ARCNET"
        Case 7 
          Adapter_Type$ = "ARCNET (878.2)"
        Case 8 
          Adapter_Type$ = "ATM"
        Case 9
          Adapter_Type$ = "Wireless"
        Case 10 
          Adapter_Type$ = "Infrared Wireless"
        Case 11
          Adapter_Type$ = "Bpc"
        Case 12
          Adapter_Type$ = "CoWan"
        Case 13
          Adapter_Type$ = "1394"
        Default
          Adapter_Type$ = "Unknown"
    EndSelect
    
    My_Adapter_Info_List()\Type = Adapter_Type$
      
      Adapter\Release() 
      Adapter = colAdapters\GetNextObject()
    Wend
    colAdapters\Release() 
  EndIf
  objWMIService\Release()  
EndIf

EndProcedure

Procedure.s IP_DNS_GW_Addresses(Adapt_Index.l, get_what.s)
Define.COMateObject objWMIService, IPConfig
IPConfigSet.COMateEnumObject
Define *var.VARIANT, *varIP.VARIANT
*sa.SafeArray

strComputer.s = "."
Net_I_Index$ = Str(Adapt_Index)

objWMIService = COMate_GetObject("winmgmts:\\" + strComputer + "\root\cimv2", "")
If objWMIService
  ;IPConfigSet = objWMIService\CreateEnumeration("ExecQuery('Select * from Win32_NetworkAdapterConfiguration Where InterfaceIndex= $0027" + Net_I_Index$ +"$0027')") ; win Vista only
  IPConfigSet = objWMIService\CreateEnumeration("ExecQuery('Select * from Win32_NetworkAdapterConfiguration Where Index= $0027" + Net_I_Index$ +"$0027')") ; winXP and win Vista
  If IPConfigSet
    IPConfig = IPConfigSet\GetNextObject()
    While IPConfig
      If IPConfig
        If get_what = "IP"
        *var = IPConfig\GetVariantProperty("IPAddress")
        EndIf
        If get_what = "DNS"
        *var = IPConfig\GetVariantProperty("DNSServerSearchOrder")
        EndIf
        If get_what = "GW"
        *var = IPConfig\GetVariantProperty("DefaultIPGateway")
        EndIf
        If get_what = "SUFFIX"
        *var = IPConfig\GetVariantProperty("DNSDomainSuffixSearchOrder")
        EndIf 
        If *var\vt <> #VT_NULL
          *sa = *var\parray
          For i = saLBound(*sa) To saUBound(*sa)
            *varIP = SA_VARIANT(*sa, i)
            If *varIP\vt <> #VT_BSTR
              VariantChangeType_(*varIP, *varIP, 0, #VT_BSTR)
            EndIf
            
            x = x + 1
            IP_Address_DNS_GW$ = PeekS(*varIP\bstrVal, -1, #PB_Unicode)
            ;//////////////adapter IP///////////////////////////////
            If x = 1 And get_what = "IP" ; IP v 4
            My_Adapter_Info_List()\IPAdress_ipv4 = IP_Address_DNS_GW$
            EndIf
            
            If x = 2 And get_what = "IP"; IP v 6
            My_Adapter_Info_List()\IPAdress_ipv6 = IP_Address_DNS_GW$
            EndIf
            ;////////////////////DNS server/////////////////////////
            If x = 1 And get_what = "DNS"
            My_Adapter_Info_List()\DNS_Server_1 = IP_Address_DNS_GW$
            EndIf
            
            If x = 2 And get_what = "DNS"
            My_Adapter_Info_List()\DNS_Server_2 = IP_Address_DNS_GW$
            EndIf
            
            If x = 3 And get_what = "DNS"
            My_Adapter_Info_List()\DNS_Server_3 = IP_Address_DNS_GW$
            EndIf
            ;//////////////default GateWay server/////////////////
            If x = 1 And get_what = "GW"
            My_Adapter_Info_List()\GW_Server_1 = IP_Address_DNS_GW$
            EndIf
            
            If x = 2 And get_what = "GW"
            My_Adapter_Info_List()\GW_Server_2 = IP_Address_DNS_GW$
            EndIf
            
            If x = 3 And get_what = "GW"
            My_Adapter_Info_List()\GW_Server_3 = IP_Address_DNS_GW$
            EndIf
            ;/////////////domain suffix search order if any////////
            If x = 1 And get_what = "SUFFIX"
            My_Adapter_Info_List()\DNSDomainSuffix_1 = IP_Address_DNS_GW$
            EndIf
            
            If x = 2 And get_what = "SUFFIX"
            My_Adapter_Info_List()\DNSDomainSuffix_2 = IP_Address_DNS_GW$
            EndIf
            
            If x = 3 And get_what = "SUFFIX"
            My_Adapter_Info_List()\DNSDomainSuffix_3 = IP_Address_DNS_GW$
            EndIf
            
            If My_Adapter_Info_List()\DNSDomainSuffix_1 = "" And My_Adapter_Info_List()\DNSDomainSuffix_2 = "" And My_Adapter_Info_List()\DNSDomainSuffix_3 = ""
            My_Adapter_Info_List()\DNSDomainSuffix_1 = "None Detected"
            My_Adapter_Info_List()\DNSDomainSuffix_2 = ""
            My_Adapter_Info_List()\DNSDomainSuffix_3 = ""
            EndIf
            
            If My_Adapter_Info_List()\IPAdress_ipv4 = ""
              My_Adapter_Info_List()\IPAdress_ipv4 = "No assigned IPv4 address"
            EndIf
            
            If My_Adapter_Info_List()\IPAdress_ipv6 = ""
              My_Adapter_Info_List()\IPAdress_ipv6 = "No assigned IPv6 address"
            EndIf 

            VariantClear_(*varIP)
          Next
          saFreeSafeArray(*sa)
        EndIf
        VariantClear_(*var) : FreeMemory(*var)
        IPConfig\Release()
      EndIf
      
      IPConfig = IPConfigSet\GetNextObject()
    Wend
  EndIf  
Else
  MessageRequester("Error", "Couldn't create DNS_GW object!")
EndIf

EndProcedure

Procedure.s Adapter_Info() 

Define.COMateObject objWMIService, Adapter
colAdapters.COMateEnumObject

strComputer.s = "." 

  objWMIService = COMate_GetObject("winmgmts:\\" + strComputer + "\root\cimv2", "") 
  If objWMIService 
    colAdapters = objWMIService\CreateEnumeration("ExecQuery('Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE')")
    If colAdapters 
      Adapter= colAdapters\GetNextObject() 
      While Adapter
        
          AddElement(My_Adapter_Info_List())
          My_Adapter_Info_List()\Description = Adapter\GetStringProperty("Description")
          My_Adapter_Info_List()\Index = Adapter\GetIntegerProperty("InterfaceIndex") ; this is not available on winXP, only on Vista
          My_Adapter_Info_List()\Device_Index = Adapter\GetIntegerProperty("Index") ; this is supported on winXP and Win Vista - beware of multiple configurations
          My_Adapter_Info_List()\MACAddress = Adapter\GetStringProperty("MACAddress")
          My_Adapter_Info_List()\DhcpServer = Adapter\GetStringProperty("DHCPServer")
          My_Adapter_Info_List()\DNS_Domain_Name = Adapter\GetStringProperty("DNSDomain")
          My_Adapter_Info_List()\DNS_Host_Name = Adapter\GetStringProperty("DNSHostName")
          My_Adapter_Info_List()\LeaseObt = Dt_Time(Adapter\GetStringProperty("DHCPLeaseObtained"))
          My_Adapter_Info_List()\LeaseExp = Dt_Time(Adapter\GetStringProperty("DHCPLeaseExpires"))
          
          If Adapter\GetIntegerProperty("DNSEnabledForWINSResolution") = -1
            My_Adapter_Info_List()\HaveWins = "True"
            My_Adapter_Info_List()\Wins_Pri_Server = Adapter\GetStringProperty("WINSPrimaryServer")
            My_Adapter_Info_List()\Wins_Sec_Server = Adapter\GetStringProperty("WINSSecondaryServer")
          Else
            My_Adapter_Info_List()\HaveWins = "False"
            My_Adapter_Info_List()\Wins_Pri_Server = "None"
            My_Adapter_Info_List()\Wins_Sec_Server = "None"
          EndIf
          
          ;IP_DNS_GW_Addresses(My_Adapter_Info_List()\Index, "IP") ; win Vista only
          ;IP_DNS_GW_Addresses(My_Adapter_Info_List()\Index, "GW") ; win Vista only
          ;IP_DNS_GW_Addresses(My_Adapter_Info_List()\Index, "DNS") ; win Vista only
          ;IP_DNS_GW_Addresses(My_Adapter_Info_List()\Index, "SUFFIX") ; win Vista only
          IP_DNS_GW_Addresses(My_Adapter_Info_List()\Device_Index, "IP") ; win XP and Win Vista
          IP_DNS_GW_Addresses(My_Adapter_Info_List()\Device_Index, "GW") ; win XP and Win Vista
          IP_DNS_GW_Addresses(My_Adapter_Info_List()\Device_Index, "DNS") ; win XP and Win Vista
          IP_DNS_GW_Addresses(My_Adapter_Info_List()\Device_Index, "SUFFIX") ; win XP and Win Vista
          GetNetWorkStatus(My_Adapter_Info_List()\IPAdress_ipv4)
              
          If Adapter\GetIntegerProperty("DHCPEnabled") = -1
            My_Adapter_Info_List()\DHCP_Static = "IP is DHCP"
          Else
            My_Adapter_Info_List()\DHCP_Static = "IP is Static"
          EndIf
              
          If Adapter\GetIntegerProperty("FullDNSRegistrationEnabled") = -1
            My_Adapter_Info_List()\FullDNS_Reg = "True"
          Else
            My_Adapter_Info_List()\FullDNS_Reg = "False"
          EndIf
          
            ;Adapter_Type_Interface(My_Adapter_Info_List()\Index) ; win Vista only
            Adapter_Type_Interface(My_Adapter_Info_List()\Device_Index) ; win XP and Win Vista  
        
        Adapter\Release() 
        Adapter = colAdapters\GetNextObject()
      Wend
      colAdapters\Release() 
    EndIf
    objWMIService\Release()
  EndIf
EndProcedure


Adapter_Info()

ForEach My_Adapter_Info_List() 
  Debug "Description  :  " + My_Adapter_Info_List()\Description
  Debug "Type   :  " + My_Adapter_Info_List()\Type
  Debug "GUID Name  :  " + My_Adapter_Info_List()\Adapter_GUID_Name 
  Debug "Adapter Route Table Index  :   " + Str(My_Adapter_Info_List()\Index)
  Debug "Adapter System Index (LUID)  :  " + Str(My_Adapter_Info_List()\Device_Index)
  Debug "MAC Address  :  " + My_Adapter_Info_List()\MACAddress 
  Debug "IPv4 Address :  " + My_Adapter_Info_List()\IPAdress_ipv4
  Debug "IPv6 Address :  " + My_Adapter_Info_List()\IPAdress_ipv6
  Debug "DHCP or Static  :  " + My_Adapter_Info_List()\DHCP_Static
  Debug "DHCP Server  :  " + My_Adapter_Info_List()\DhcpServer
  Debug "Network Status  :  " + My_Adapter_Info_List()\Network_Status
  Debug "DNS Servers  :  "  + My_Adapter_Info_List()\DNS_Server_1 + "    " + My_Adapter_Info_List()\DNS_Server_2  + "    " + My_Adapter_Info_List()\DNS_Server_3
  Debug "Gateway Server  :  " + My_Adapter_Info_List()\GW_Server_1 + "    " + My_Adapter_Info_List()\GW_Server_2 + "    " + My_Adapter_Info_List()\GW_Server_3
  Debug "DNS Domain Suffix Search Order  :  " + My_Adapter_Info_List()\DNSDomainSuffix_1 + "   " + My_Adapter_Info_List()\DNSDomainSuffix_2 + "   " + My_Adapter_Info_List()\DNSDomainSuffix_3
  Debug "DNS Domain Name:   " + My_Adapter_Info_List()\DNS_Domain_Name
  Debug "DNS Host Name  :  " + My_Adapter_Info_List()\DNS_Host_Name
  Debug "Full DNS Registration  : " + My_Adapter_Info_List()\FullDNS_Reg
  Debug "WINS Enabled  :  " + My_Adapter_Info_List()\HaveWins
  Debug "WINS Primary Server  :  " + My_Adapter_Info_List()\Wins_Pri_Server
  Debug "WINS Secondary Server  :  " + My_Adapter_Info_List()\Wins_Sec_Server
  Debug "Connection ID  :  " + My_Adapter_Info_List()\Net_ConnectionID
  Debug "Lease Obtained  :  " + My_Adapter_Info_List()\LeaseObt
  Debug "Lease Expires :  " + My_Adapter_Info_List()\LeaseExp
Next
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

16th Sept. 2008.
Added a version of COMate suitable for PB 4.3 (32-bit only).

See the nxSoftware site for the download.

**EDIT : anyone have any ideas why the Agent demo speech bubbles now remain empty on my system? The agent speaks okay, but the words simply do not appear in the bubble!!! The bubble remains empty! It used to work okay here on Vista!!!
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 »

/edit
i miss a posting :roll:
so my answer is useless
Last edited by ts-soft on Tue Sep 16, 2008 9:26 pm, 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
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

srod wrote:anyone have any ideas why the Agent demo speech bubbles now remain empty on my system? The agent speaks okay, but the words simply do not appear in the bubble!!! The bubble remains empty! It used to work okay here on Vista!!!
I works here on PBV4.3 and Windows XP - maybe the timing have to be changed on your PC? Thats why it would be fine to be able to check if the status of the agent (something like "idle" or "busy")...

Michael
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Post by kinglestat »

hey...I was the one who suggested COMmotion
At least I get a tiny wee bit of notoriety!
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Update - version 1.1.6. 19th Sept. 2008.
Version 1.1.6 adds a new parameter type-modifier; "as COMateObject" for those COM methods / properties requiring you to pass an existing object as a parameter. Of course COMate does not pass the object as it is but instead 'reaches inside the COMate object' and retrieves the underlying COM interface which it sends off to the method instead.

To summarise the type-mofidiers dealing with passing objects (advanced users only) :
  1. "AS Object" or "AS iDispatch"
    Use when passing an iDispatch interface pointer obtained from some means or other - perhaps using CoCreateInstance_() etc.
  2. "AS iUnknown"
    Use when passing an iUnknown interface pointer obtained from some means or other - perhaps using CoCreateInstance_() etc.
  3. "AS COMateObject"
    Use when wishing to pass the iDispatch interface pointer at the heart of the COMateObject in question. COMate itself will retrieve the interface pointer. It is not possible to pass COMateObjects by reference (using BYREF) as a COM method will not understand the nature of such an object. Instead ask myself or Kiffi for a workaround if you need this.
My thanks to Kiffi.

See the nxSoftware site for the download.
I may look like a mule, but I'm not a complete ass.
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Post by Little John »

Hello,

I can't run the demo programs
Demo_AnimatedGif.pb
STclock.pb
STrainbow.pb
on my system (PB 4.20, Windows XP SP3, using the current COMate version 1.1.6).

With all three programs, I get the error message:
Couldn't create the ActiveX control!
Any ideas?

Regards, Little John
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Run fine here on Vista. Did they run okay in a previous version of COMate?

Let me try xp sp 3... works fine here.
Last edited by srod on Sun Sep 21, 2008 12:05 pm, edited 1 time in total.
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 »

Little John wrote: With all three programs, I get the error message:
Couldn't create the ActiveX control!
Any ideas?
Register a ActiveX requires Admin privilege!
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
Post Reply