srod wrote:Now to correct this damn BYREF business!


Thanks for the new version!

Greetings ... Kiffi
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
Nope, no GUID's required, just provide an interface pointer. The idea is that you may have obtained an interface pointer from some operation; e.g. CoCreateInstance_() and wish to quickly call some method without going through the vTable etc. In this case you can attempt to wrap it up in a COMateObject and call the method using COMate automation etc.SFSxOI wrote:For COMate_WrapCOMObject(); do you still need to supply the CLSID and IID also, like in a data section, in the code?
Code: Select all
TLITypeLibInfo.COMateObject
TLITypeLibInfo = COMate_CreateObject( "TLI.TypeLibInfo" )
If TLITypeLibInfo = 0
If COMate_RegisterCOMServer("C:\WINDOWS\system32\TlbInf32.dll") = #S_OK
blnRegister = #True
TLITypeLibInfo = COMate_CreateObject( "TLI.TypeLibInfo" )
EndIf
EndIf
Debug COMate_GetLastErrorDescription() ; -> Okay
Debug TLITypeLibInfo ; -> 0
Code: Select all
Dim tliTypeLibInfo As TypeLibInfo
Set tliTypeLibInfo = New TypeLibInfo ' works