Revisited COM examples

Started by Vortex, April 26, 2025, 09:35:57 PM

Previous topic - Next topic

Vortex

With thanks to Pelle, here are some COM examples rebuilt with Poasm Version 13.

SetWallPaper.zip : Example changing the wallpaper
SaveClipbToBitmap.zip : Command-line application saving the clipboard to a bitmap file
Code it... That's all...

TimoVJL

#1
An example to create interface STRUCTS for INC-file

EDIT: An example was broken
EDIT: New example using msvcrt.dll  remove define USE_MSVCRT for normal use
EDIT: print GUIDs
EDIT: print STRUCTs and UNIONs
EDIT: commandline support
May the source be with you

Vortex

Hi Timo,

Thanks. How to use your tool to create the include file defining the interface IPicture necessary to build the example saving the clipboard?
Code it... That's all...

TimoVJL

#3
IPicture is at least in StdOle2.tlb

IPicture STRUCT
        ; IUnknown Functions:
        QueryInterface
        AddRef
        Release
        ; IPicture Functions:
        get_Handle
        get_hPal
        get_Type
        get_Width
        get_Height
        Render
        put_hPal
        get_CurDC
        SelectPicture
        get_KeepOriginalFormat
        put_KeepOriginalFormat
        PictureChanged
        SaveAsFile
        get_Attributes
        SetHdc
IPicture ENDS
May the source be with you

Vortex

#4
Hi Timo,

Thanks, the stuctures should define the methods with DWORDs for 32-bit and QWORDs for 64-bit coding.

IPicture STRUCT
        ; IUnknown Functions:
        QueryInterface dd ?
        AddRef        dd ?
        Release        dd ?
        ; IPicture Functions:
        get_Handle    dd ?
        get_hPal      dd ?
.
.
        SaveAsFile    dd ?
        get_Attributes dd ?
        SetHdc        dd ?
IPicture ENDS
Code it... That's all...

TimoVJL

#5
Just a command line option for ml for static text ?

A poasm accept ptr ?
IPicture STRUCT
        ; IUnknown Functions:
        QueryInterface  ptr ?
        AddRef  ptr ?
        Release ptr ?
        ; IPicture Functions:
        get_Handle      ptr ?
        get_hPal        ptr ?
        get_Type        ptr ?
        get_Width       ptr ?
        get_Height      ptr ?
        Render  ptr ?
        put_hPal        ptr ?
        get_CurDC       ptr ?
        SelectPicture   ptr ?
        get_KeepOriginalFormat  ptr ?
        put_KeepOriginalFormat  ptr ?
        PictureChanged  ptr ?
        SaveAsFile      ptr ?
        get_Attributes  ptr ?
        SetHdc  ptr ?
IPicture ENDS
May the source be with you

Vortex

Hi Timo,

Exactly, the PTR notations works too.
Code it... That's all...

Vortex

#7
Hi Timo,

Thanks, I had a quick look on your latest tools. Nice job. Back home, I will have more time to focus on the output of the tools.
Code it... That's all...

TimoVJL

Name for that project could be TLB2poasmInc, as it harly never support masm.
Others can make support for masm too or just similar for masm.
I am not an assembler programmer, so projects goes just in baby steps.
May the source be with you

Vortex

Hi Timo,

TLB2poasmInc looks like a good name, take your time to develop the tool. A modest suggestion, you can instruct the tool to take one command-line paramater, the name of the .tlb file

Your syntax with angle bracket works, I test it :

;CLSID_SpVoice GUID {096749377h,03391h,011D2h,<09Eh,0E3h,000h,0C0h,04Fh,079h,073h,096h>}
sCLSID_SpVoice TEXTEQU <<096749377h,03391h,011D2h,<09Eh,0E3h,000h,0C0h,04Fh,079h,073h,096h>>>
CLSID_SpVoice GUID sCLSID_SpVoice
Code it... That's all...