COMatePLUS version 1.2
Re: COMatePLUS version 1.2
Yes should be possible.
You can use COMatePLUS to create an instance of the relevant ActiveX control and for that you will need to know either the ProgID of the control or it's CLSID. Once you have this then it should be relatively easy.
Afraid I cannot really help because I do not own a copy of Crystal Reports.
You can use COMatePLUS to create an instance of the relevant ActiveX control and for that you will need to know either the ProgID of the control or it's CLSID. Once you have this then it should be relatively easy.
Afraid I cannot really help because I do not own a copy of Crystal Reports.
I may look like a mule, but I'm not a complete ass.
- captain_skank
- Enthusiast
- Posts: 639
- Joined: Fri Oct 06, 2006 3:57 pm
- Location: England
Re: COMatePLUS version 1.2
Thanks for the reply srod.
is there an easy way to find the progid or clsid ?? I tried using regedit searching for crystalactivexreportviewer and got nothing although i can find an entry for CRAXDRT which is the designer runtime library. (crystalruntime.application.11)
What i don't really understand is that to make this simple example work in vb I had to include the reference to the designer runtime library as well as the viewer control and I don't see how that translates with comateplus.
Cheers
is there an easy way to find the progid or clsid ?? I tried using regedit searching for crystalactivexreportviewer and got nothing although i can find an entry for CRAXDRT which is the designer runtime library. (crystalruntime.application.11)
What i don't really understand is that to make this simple example work in vb I had to include the reference to the designer runtime library as well as the viewer control and I don't see how that translates with comateplus.
Cheers
Re: COMatePLUS version 1.2
I wouldn't worry about adding references; that is for VB's benefit in that it requires such references to type libraries so that it can look up all of the relevant interfaces and property/method listings and CLSIDs etc. ALL COMatePLUS requires are the progID's.
Use a type-library viewer tool to look within the relevant type-library for the ProgIDs. Though I would have thought you could use the tools which come with VB to do this.
Use a type-library viewer tool to look within the relevant type-library for the ProgIDs. Though I would have thought you could use the tools which come with VB to do this.
I may look like a mule, but I'm not a complete ass.
Re: COMatePLUS version 1.2
Hi! I tried accessing the serial number using GetIntegerProperty() but got additional information... 

Code: Select all
XIncludeFile "COMatePLUS.pbi"
Define.COMateObject objFSO, objDrive
Define.COMateEnumObject colDrives
#DRIVE_TYPE_UNKNOWN = 0
#DRIVE_TYPE_REMOVABLE = 1
#DRIVE_TYPE_FIXED = 2
#DRIVE_TYPE_NETWORK = 3
#DRIVE_TYPE_CDROM = 4
#DRIVE_TYPE_RAMDISK = 5
objFSO = COMate_CreateObject("Scripting.FileSystemObject")
If objFSO
colDrives = objFSO\CreateEnumeration("Drives")
If colDrives
objDrive = colDrives\GetNextObject()
While objDrive
Debug "Drive letter: " + objDrive\GetStringProperty("DriveLetter")
Debug "Drive type : " + Str(objDrive\GetIntegerProperty("DriveType"))
If objDrive\GetIntegerProperty("DriveType") = #DRIVE_TYPE_REMOVABLE
Debug "Volume Label : " + objDrive\GetStringProperty("VolumeName")
Debug "Serial No : " + Hex(objDrive\GetIntegerProperty("SerialNumber"))
; My Serial # is D28D-F008
; but appears as FFFFFFFFD28DF008
EndIf
Debug ""
objDrive\Release()
objDrive = colDrives\GetNextObject()
Wend
colDrives\Release()
EndIf
objFSO\Release()
EndIf
Re: COMatePLUS version 1.2
The GetIntegerProperty() will return a quad and Hex() works with quads.
Use the following :
Use the following :
Code: Select all
Debug "Serial No : " + Hex(objDrive\GetIntegerProperty("SerialNumber"), #PB_Long)
I may look like a mule, but I'm not a complete ass.
Re: COMatePLUS version 1.2
Thanks srod... 

- flaith
- Enthusiast
- Posts: 704
- Joined: Mon Apr 25, 2005 9:28 pm
- Location: $300:20 58 FC 60 - Rennes
- Contact:
Re: COMatePLUS version 1.2
Hi all 
i have a Excel Workbook with 2 sheets, each have a password to protect cells, the second sheet is invisible :
i need to unprotect my second sheet (with COMatePlus) and tried without success, here is a part of the code :
Thanks for you help 

i have a Excel Workbook with 2 sheets, each have a password to protect cells, the second sheet is invisible :
i also tried with visible sheetPrivate Sub Worksheet_Activate()
Sheets(2).Visible = xlVeryHidden
'Sheets(2).Visible = True
End Sub
i need to unprotect my second sheet (with COMatePlus) and tried without success, here is a part of the code :
Code: Select all
;Check if the sheet is protected
;False = 0
;True = -1
debug ExcelObject\GetIntegerProperty("Sheets(2)\ProtectContents")
ExcelObject\SetProperty("Worksheets(2)\Unprotect Password = 'MyPassword'")
;or tried with
;ExcelObject\SetProperty("Sheets(2)\Unprotect Password = 'MyPassword'")
;or with
;ExcelObject\SetProperty("Sheets('Data')\Unprotect Password = 'MyPassword', UserInterfaceOnly = Vrai") ; tried with True : same
ExcelObject\SetProperty("Sheets(2)\Cells(1,7) = 'New Client'")
ExcelObject\Invoke("ActiveWorkBook\Save()")

“Fear is a reaction. Courage is a decision.” - WC
Re: COMatePLUS version 1.2
The following worked fine here :
Code: Select all
Define.COMateObject ExcelObject, WorkBook, ExcelSheet
ExcelObject = COMate_CreateObject("Excel.Application")
If ExcelObject
If ExcelObject\SetProperty("Visible = #True") = #S_OK
WorkBook = ExcelObject\GetObjectProperty("Workbooks\Open('c:\Pure basic - 4.3\COMatePLUS-PB4.50\Basic demos\test.xls')")
If WorkBook
WorkBook\Invoke("Sheets(1)\Unprotect('" + password$ + "')")
WorkBook\Release()
EndIf
EndIf
ExcelObject\Invoke("Quit()")
ExcelObject\Release()
Else
MessageRequester("COMate -Excel demo", "Couldn't create the application object!")
EndIf
I may look like a mule, but I'm not a complete ass.
- flaith
- Enthusiast
- Posts: 704
- Joined: Mon Apr 25, 2005 9:28 pm
- Location: $300:20 58 FC 60 - Rennes
- Contact:
Re: COMatePLUS version 1.2
Just a little behavior with the Demo Excel :
add this line and run :
The Cell(1,7) will display $A$2:$A (loosing $4) 
add this line and run :
Code: Select all
ExcelObject\SetProperty("Cells(1,7) = '$A$2:$A$4'")

“Fear is a reaction. Courage is a decision.” - WC
Re: COMatePLUS version 1.2
The $ is an escape code for COMate and COMatePLUS.
Whenever COMate encounters a $ within a string argument it then regards the next 4 characters as a Hex character code (Ascii or Unicode). For example, $0024 would equate to character code 36 which is a '$' character.
Replace your statement above by :
Whenever COMate encounters a $ within a string argument it then regards the next 4 characters as a Hex character code (Ascii or Unicode). For example, $0024 would equate to character code 36 which is a '$' character.
Replace your statement above by :
Code: Select all
ExcelObject\SetProperty("Cells(1,7) = '$0024A$00242:$0024A$00244'")
I may look like a mule, but I'm not a complete ass.
Re: COMatePLUS version 1.2
I try to record a voice to a file, the file is created but empty
Can you help me?
Can you help me?
Code: Select all
XIncludeFile "COMatePLUS.pbi"
#SSFMCreateForWrite=3
spVoice.COMateObject = COMate_CreateObject("SAPI.SpVoice")
SpFileStream.COMateObject = COMate_CreateObject("SAPI.SpFileStream")
If SpFileStream<>0 And spVoice<>0
SpFileStream\invoke("open('c:\essai.wav' ,3, #False)")
spVoice\SetPropertyref("AudioOutputStream=SpFileStream as COMateObject")
spVoice\Invoke("speak('Purebasic is very nice')")
SpFileStream\invoke("close()")
SpFileStream\Release()
spVoice\Release()
EndIf
Re: COMatePLUS version 1.2
Code: Select all
spVoice\SetPropertyRef("AudioOutputStream=" + Str(SpFileStream) + " As COMateObject")
I may look like a mule, but I'm not a complete ass.