News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

COM Question

Started by averpix, April 11, 2007, 04:46:31 PM

Previous topic - Next topic

averpix

Hi Experts,
I'm a beginner in Assembly (I used to code in Delphi). I need to code a program to access COM/DCOM objects specifically to access OPC server - OLE for Process Control - (http://www.opcconnect.com) but I coudn't find a way to start. Can somebody help me?

regards,

AverPix

ToutEnMasm

Hello,
Com are easy to use when you have a header file and the name of the API to connect it.
A sample in C can be useful also , C is very closer with asm.
                                                 ToutEnMasm


averpix

@ToutEnMasm, thanks for you quick reply.
I see. I have to declare the interface along with all methods contained, is that right?
My next question are:
how to declare interface (and the methods)?
and
how to instantiate the interface?
In Delphi we might write: obj:= CreateComObject(some GUID);
Is There any docs/tutorial to use COM with MASM?
Thanks a lot,

regards,

AverPix

Biterider

Hi
Use ObjAsm32, it has full support for COM clients and servers.
To experiment with the interfaces you want use, I recommend Japheth's COMView.

Regards,

Biterider


averpix

Hi BiteRider, thank you,
I'll check this ObjAsm. I really need this stuff because of heavily use of COM in OPC.

regards,

AverPix

ToutEnMasm

Hello,
First you have to know the name of the interface you want to use.
This name give you the API you have to call (search winhelp , the SDK or MSDN).
Translate the header with the translator in the windows.inc subforum.
The translation give you all the usable methods.
The translator give you a macro with the name of the interface.
Used this macro instead of invoke and you can use the methods of the interface exactly as it was an API.
                            ToutEnMasm

                                             

averpix

@ToutEnMasm: Thank You,
I've downloaded the translator, I'll give a try...

ragards,

AverPix

Biterider

Hi
The first thing you need to do is to get the definitions of at least the following interfaces:

  • IOPCServer
  • IOPCBrowseServerAddressSpace
  • IOPCCommon (2.0)
  • IOPCItemProperties (2.0)
  • IOPCGroupStateMgt
  • IOPCAsyncIO2  (2.0 - replaces IOPCAsyncIO)
  • IOPCItemMgt
  • IOPCSyncIO
Some other interfaces are also needed, but you can find their definitions in the OA32 COM folder.
Once you got this information, follow the examples to create the IOPCServer COM-Object.

Regards,

Biterider

averpix

WOW! what a response, thank you Biterider,
I'm currently studying the OA32 docs and looking the Iczelion examples.
It's very interesting, just like coding in HLL.

Regards,

AverPix

averpix

Okay,
I have now two different approach to code COM app, thanks to both of You, Biteride + ToutEnMasm. However I should read and try what you guys told me.
Please don't get bored if I ask more question about this.
Thank you,

regards,

AverPix

ToutEnMasm

Hello,
a link where to start
http://www.win-tech.com/html/opcstk.htm
                                         ToutEnMasm


averpix

Thank You TooutEnMasm,
It's a new OPC link to me. But however, I've been quite success implementing both OPC Server/Client in Delphi/VB, I released some data acquisition application for some plants in my area. Actually the problem is, I just wanna make Asm as my primary ProgLang besides Delphi, so I try to create same type of application I've created in Delphi. I'm currently working on what You (@ToutEnMasm) and BiteRide told me.

Regards,

AverPix