COMatePLUS version 1.2

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Kiffi
Addict
Addict
Posts: 1353
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: COMatePLUS version 1.2

Post by Kiffi »

Derren wrote:just looking for an easy way to replace my "write VB code to a *.vbs file and run in" code-parts.
worth a look: Module ActiveScript for VB-Script with PB-Runtime Variables from mk-soft

Greetings ... Peter
Hygge
User avatar
Derren
Enthusiast
Enthusiast
Posts: 313
Joined: Sat Jul 23, 2011 1:13 am
Location: Germany

Re: COMatePLUS version 1.2

Post by Derren »

Kiffi wrote:
Derren wrote:just looking for an easy way to replace my "write VB code to a *.vbs file and run in" code-parts.
worth a look: Module ActiveScript for VB-Script with PB-Runtime Variables from mk-soft

Greetings ... Peter
Definitely, but I ran into some issue (which is why I resorted to writing VBS files). Hadn't had the time to dive into the problems here, yet. But it's on my "watchlist".

But actually, I loathe VBS. Using VBS parts in my code just adds another dimension for errors and debugging is twice the pain.
User avatar
Demivec
Addict
Addict
Posts: 4086
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: COMatePLUS version 1.2

Post by Demivec »

Derren wrote:Thanks, but I'm missing something.

I'm trying this code snippet here and get this error.
---------------------------
PureBasic
---------------------------
The procedure 'COMate_CreateObject()' has been declared but not defined.
---------------------------
OK
---------------------------
You need to include the COMatePlus.pbi
User avatar
Derren
Enthusiast
Enthusiast
Posts: 313
Joined: Sat Jul 23, 2011 1:13 am
Location: Germany

Re: COMatePLUS version 1.2

Post by Derren »

:shock: I missed the link in leonhardt's post...
thought the posted code was all that's necessary. :oops:
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: COMatePLUS version 1.2

Post by mk-soft »

Using VB scripts with ActiveScript in PB is sometimes easier than using COMatePlus.

But here is the link to backups from RS-Basic

Link: https://www.rsbasic.de/backups/
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: COMatePLUS version 1.2

Post by mk-soft »

Derren wrote:
Kiffi wrote:
Derren wrote:just looking for an easy way to replace my "write VB code to a *.vbs file and run in" code-parts.
worth a look: Module ActiveScript for VB-Script with PB-Runtime Variables from mk-soft

Greetings ... Peter
Definitely, but I ran into some issue (which is why I resorted to writing VBS files). Hadn't had the time to dive into the problems here, yet. But it's on my "watchlist".

But actually, I loathe VBS. Using VBS parts in my code just adds another dimension for errors and debugging is twice the pain.
With ActiveScript you already get the script errors displayed.
And with "On Error Resume Next" you can also catch the script errors yourself.

P.S.
There are also a lot of VB-Script examples for all kinds of things, which can be used directly from PB
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
tatanas
Enthusiast
Enthusiast
Posts: 199
Joined: Wed Nov 06, 2019 10:28 am
Location: France

Re: COMatePLUS version 1.2

Post by tatanas »

Hi everybody

Maybe I should have posted my problem here instead of creating my own Topic : viewtopic.php?f=13&t=76324&p=562341#p562341
I've got some problem to request on remote host with WMI object.
Could someone takes a look ? Thank you.
Windows 10 Pro x64
PureBasic 6.04 x64
tatanas
Enthusiast
Enthusiast
Posts: 199
Joined: Wed Nov 06, 2019 10:28 am
Location: France

Re: COMatePLUS version 1.2

Post by tatanas »

Ok, let's try something else.
Here is an AutoIt code that works like a charm :

Code: Select all

$strComputer = "RemoteHostName"
$user = "administrator"
$pass = "password"
$objSWbemLocator = ObjCreate("WbemScripting.SWbemLocator")
$objWMIService = $objSWbemLocator.ConnectServer($strComputer, "root\cimv2", $user, $pass)

$colItems = $objWMIService.ExecQuery("Select * From Win32_LocalTime")

For $objItem in $colItems
    $strTime = $objItem.Hour & ":" & $objItem.Minute & ":" & $objItem.Second
   MsgBox(0,"date",$strTime)
Next
Can I do the same with COMatePlus ? It seems I have to use Invoke method to call ConnectServer but it is not returning an object so I can't ExecQuery this object...


EDIT :

Second problem : I can't read a value in the registry (Purebasic 5.72 64 bits). It's working in 32 bits.

Code: Select all

XIncludeFile "COMatePLUS.pbi"

Define.COMateObject oReg

strKeyPath.s = "SYSTEM\CurrentControlSet\services\NetBT\Parameters"
strValueName.s = "NbProvider"

oReg = COMate_GetObject("winmgmts:\\.\root\default:StdRegProv", "")
If oReg
	If oReg\Invoke("GetStringValue(" + Str(hkey) + ", '" + strKeyPath + "', '" + strValueName + "', " + Str(@dwValue) + " BYREF)") = #S_OK
		sValue$ = PeekS(dwValue, -1, #PB_Unicode)
		SysFreeString_(dwValue)
; 	If oReg\Invoke("GetDWORDValue(" + Str(#HKEY_LOCAL_MACHINE) + ",'" + strKeyPath + "','" + strValueName + "'," + Str(@dwValue) + " BYREF)") = #S_OK
; 		sValue$ = Str(dwValue)
		Debug "registry value = " + sValue$
	Else
		Debug "GetStringValue error : " + COMate_GetLastErrorDescription()
	EndIf
	oReg\Release()
Else
	Debug "objet error"
EndIf
EDIT2 : thanks to Justin, everything works fine now (viewtopic.php?f=13&t=76324&p=563085#p563085)
Windows 10 Pro x64
PureBasic 6.04 x64
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Re: COMatePLUS version 1.2

Post by nicolaus »

Can some one please uploiad the latest version for download? On RSBasic's side it is not downloadable at all.

Thank you!
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: COMatePLUS version 1.2

Post by RSBasic »

I fixed this. All backup download links are now possible. Thank you
Image
Image
Post Reply