News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

COM Marshaling

Started by Zen, October 23, 2015, 05:41:50 AM

Previous topic - Next topic

Zen

...I'll probably get numerous (well-deserved) death threats for posting this, but,...
Raymond Chen is doing a series about COM Marshaling,...and, I know this is a HOT TOPIC with MASM Programmers,...so, I feel that it is my civic duty to alert you guys,...:icon_eek:

What Is COM Marshaling and How Do I Use It?, Oct 20, 2015
What Are the Rules for CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream?, Oct 21, 2015
What Are the Rules for CoMarshalInterface and CoUnmarshalInterface?, Oct 22, 2015
CoGetInterfaceAndReleaseStream Does Not Mix With Smart Pointers, Oct 23, 2015

...This is also useful information:
What's the Difference Between UuidFromString, IIDFromString, CLSIDFromString, GUIDFromString..., Oct 15, 2015
Zen

dedndave

cool - i'll have a look when i have more time to play   :t

Zen

:bgrin:...I'm fairly sure that I'm allergic to COM Marshaling,...:bgrin:
Zen

Farabi

Quote from: Zen on October 24, 2015, 06:47:27 AM
:bgrin:...I'm fairly sure that I'm allergic to COM Marshaling,...:bgrin:

I kinda itchy reading it  :greensml: . Seriously, I dont really get what the article said. Maybe something like this:



Apartment struct

fa dword 0
fb dword 0
mc dword 0

Apartment ends

.data
MyApart Apartment <offset func1, offset funct2, 0>

.code

func1 proc

ret
func1 endp

func2 proc

ret
func2 endp

Accessor proc lpApart:dword

mov edx,lpApart
call [edx].Apartment.fa    ; access the apartment method
mov ecx,[edx].Apartment.mc  ; access the apartment member

ret
Accessor endp

Start:
Invoke Accessor, addr MyApart

http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

Zen

Quote from: ONAN...Seriously, I don't really get what the article said,...

...Ha,...Ha,...Seriously, ONAN,...I'm fairly sure that NOBODY gets COM Marshaling,...
...It's one of those things that you'd NEVER do in assembly code,...
...The Apartment (in COM) is a threading model,...

Here's a pretty clear description: What Are These "Threading Models" and Why Do I Care?, Larry Osterman's WebLog
Here's the official MSDN version: Understanding and Using COM Threading Models, MSDN
Zen