Page 23 of 23

Re: COMatePLUS version 1.2

Posted: Wed May 20, 2020 1:50 pm
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

Re: COMatePLUS version 1.2

Posted: Wed May 20, 2020 1:56 pm
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.

Re: COMatePLUS version 1.2

Posted: Wed May 20, 2020 2:51 pm
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

Re: COMatePLUS version 1.2

Posted: Wed May 20, 2020 3:07 pm
by Derren
:shock: I missed the link in leonhardt's post...
thought the posted code was all that's necessary. :oops:

Re: COMatePLUS version 1.2

Posted: Wed May 20, 2020 3:45 pm
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/

Re: COMatePLUS version 1.2

Posted: Wed May 20, 2020 3:51 pm
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

Re: COMatePLUS version 1.2

Posted: Fri Nov 27, 2020 10:12 am
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.

Re: COMatePLUS version 1.2

Posted: Tue Dec 08, 2020 1:00 pm
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)

Re: COMatePLUS version 1.2

Posted: Sun Oct 17, 2021 4:17 pm
by nicolaus
Can some one please uploiad the latest version for download? On RSBasic's side it is not downloadable at all.

Thank you!

Re: COMatePLUS version 1.2

Posted: Sun Oct 17, 2021 10:37 pm
by RSBasic
I fixed this. All backup download links are now possible. Thank you