what exactly is com about. i know vb uses COM, so i want to make my dabase app that im coding in c++/asm to be useable in vb along with other major languages. i need to know if i really need to use COM to make my database app compatable and easyly used in vb, as its a growing language and i want the greatest audence possible. basicly all languages will use a dll for the functions, what do i need to make it COM for vb to use?? i have no idea about COM. is it the functions or data someting? nobody knows what it is,thats why i(and many other people) are not attracted to it.
Posted on 2003-08-05 15:06:57 by Qages
Com is alot of things.. Its not a programming language, but rather a programming standard.

The sole function of COM is to provide a set of rules for programs to adhere to, such that it can be easily ported to other operating systems without any problem.

As such, the interface between the a given operating system, and a COM program's internals are the focus of COM. The rules spell out a system of requirments that are needed to be met.

Following the rules, alows programs like VB (which is not intelligent) to seemingly know exactly what all the functions are and exactly what type of arguments it needs (right down to argument descriptions). The reality of all this is that the COM interface has been programmed to provided all these answers, if asked. And thats exactly what VB does. It pokes and probes for all the info it can about a com object, and sets up its interal "autocomplete" based on its answers.

COM objects all have a unique 128 bit "key" that is the only way to talk about an interface (a group of functions), or a Class Object (a group of interfaces).

Like OOP, COM has inheritance, and all COM objects inherit from a base point. IUnknown. (Interface - Unknown). IUnknown has a couple basic functrions that ALL com object should have. One of which is "Release". Since all COM objects will eventually need to shut down when the program ends. Haveing the function here ensures *every* com object will have the same "front end" for cleaning up. There is not guess work involved. Internally a com object can do what ever it wants for this function, but externally, it must use this funtion as the "trigger" to set things off.

This is why its a standard for how YOUR program interfaces with other systems and programs.

I hope this is a good head start... Perhaps others can add more thoughts..
:alright:
NaN
Posted on 2003-08-05 17:28:36 by NaN
Oh ya, i forgot to add, check out Ernie's site for good tutorial to get you going...

http://ourworld.compuserve.com/homepages/ernies_world/a.htm
Posted on 2003-08-06 00:38:35 by NaN
What is COM? I think of it mostly as a communications protocal, so that different blobs of code can talk to each other, no matter if the blobs are in the same process (ie, dll), running in another .exe, or on another computer.

Using a COM base for any VB "Widget" is pretty much standard and expected these days, and has been since the .VBX died. True, most VB users could handle a dll, but you'll be better received (and reviewed too) if you go full COM.

Pay good attention to the type lib too, as that is the documentation your users will read the most.
Posted on 2003-08-06 22:23:56 by Ernie
What is COM?
an evil plot by m$ to remove the hair from my head and to turn my beard grey.
A plot to give me insomnia, and increase my beer comsumption.

LOL At least it feels that way.
Posted on 2003-08-06 23:07:16 by RobotBob

What is COM?

Wasn't it in the beginning some article in a magazine? Nice idea any way, but it's only given me head aces when I've tried to use it in MASM. (Haven't tried ever since, since I havee had no such need)
Posted on 2003-08-07 06:03:31 by scientica
Increasing beer comsumption isn't necessarily
a bad side effect, it depends on the brand.
Posted on 2003-08-07 20:04:50 by Poimander
Well, with my dead pan attempt at slapstick aside, I'd have to say that COM is an improved and much stronger version of IPC with it's roots in the UNIX world.

Perhaps one of the best ways for an ASM programmer to reach light-speed in terms of programming power is to do so via COM. NaN, Ernie and Japheth and others have demonstrated this, so their code is well worth close study.

Here's a list of unsorted COM links:
Posted on 2003-08-08 21:18:12 by Poimander
thx
Posted on 2003-08-09 15:19:57 by Qages
COM uses the COMMON interfaces, each object may bind its own functions according to the interfaces.
I think dynamic-binding is the matter of COM.
Posted on 2003-08-26 05:15:41 by hanzac
It started as COM = Complex Obfuscated Model.
Because they thought that would scare away too many programmers, they changed it to COM = Component Object Model. Where your fustration is just a component of the object, where you model your style of problem solving.

Regards, P1 :cool:
Posted on 2003-08-26 10:04:51 by Pone
Its amazing how many times we do this in this section...

Explaining what COM is, and (most of us) striving to explain it in a simple maner to be understood as a starting point. You could almost scratch ticks into the wall, each time.

The funny thing is I have yet to see someone continue and TRY COM after this initial question. Either they "Get it" the first time, and never have to post a question (highly unlikely), or they dont bother trying and give up before they start.

To me this is a shame, cause there has been some very good tools developed (mainly by Japheth and Ernie) that will take the scare out of using COM.



:NaN:
Posted on 2003-08-26 18:16:43 by NaN
Actrually I'm not very suprised at the nonsense replies such as Pone posted (no offence meant to Pone either).

It's more a general symptom of Microsoft bashing then any real laisyness. People here are pretty sharp and willing to dig pretty deep for an answer (least they all be Java bean makers). COM comes under so many names and flavors (OLE 2.0, ActiveX, COM, COM+, DCOM, etc etc) that MS just about asked for confusion (and resentment) up front.

No one ever accused MS of being overly elegant with their software. Typically their code is well bloated in an attempt to add feature upon feature upon feature. COM began as a way out of the 'DLL HELL' software issues of the mid 80's, and is actually a very clever and simple solution. In fact, it was such a good solution that it soon got reused most everywhere in MS, so a gently evolved solution seemed to be imposed overnight on most everything, not to mention seemingly like a hack made for VB was hacked onto everything else.

My personal feeling is COM in ASM is best used to provide some high speed drop-in ASM support to an otherwise slow app.

I've been in this game long enough to remember programming a Commodore 64 which ran an 8K Basic interpeter. If you wanted any speed at all you would drop in some ASM code to pick it up.

I just wanted a way to do in VB under Windows something I could easily do 20 years ago.
Posted on 2003-08-27 11:35:05 by Ernie
None taken.

It was given as humor, nothing more than that.

Regards, P1 :cool:
Posted on 2003-08-28 13:35:16 by Pone

None taken.

It was given as humor, nothing more than that.

Regards, P1 :cool:



It was cool dont listen to him :alright:
Posted on 2003-08-28 14:26:21 by AceEmbler
It ok to make light of something that is generally considered difficult. It not that bad once you bite into it, but when you first examine the material, it can cause a serious case of 'wth?'.

There isn't a need to 'ponder' the state of responses to this subject. Maybe a good tutorial on the subject, written in general english, is needed. (that isnt assembler specific)

The fact a person would pursue COM in ASM most likely means they are an adventurous type anyway :)
Posted on 2003-08-28 20:05:24 by RobotBob

what exactly is com about. i know vb uses COM, so i want to make my dabase app that im coding in c++/asm to be useable in vb along with other major languages. i need to know if i really need to use COM to make my database app compatable and easyly used in vb, as its a growing language and i want the greatest audence possible. basicly all languages will use a dll for the functions, what do i need to make it COM for vb to use?? i have no idea about COM. is it the functions or data someting? nobody knows what it is,thats why i(and many other people) are not attracted to it.



Sure are a lot of questions. A person could almost write a book. Wait.... Aren't there several already? :rolleyes:

Truely.. COM is a wonder. Done in assembly?... :alright: And so simple.

Com is a standard for developing components that provide services to other components. Components expose interfaces to the outside world. By identifying these components and their interfaces with Universally Unique IDentifiers (UUIDs), and registering them in the system registry, they are easily accessed by any software, using the systems COM Library Services.

vb uses COM through OLE, which is built on top of COM and adds support for things like type libraries, Automation, ActiveX, drag and drop, and the clipboard.

For your code to be used as you describe requires a study of OLE and it's supporting interfaces.

Depending on your design, a COM component will usually provide many interfaces, though it could have just one. An interface is a structure based on the C++ virtual base class, and all interfaces inherit the pre-defined IUnknown interface.

To make your dll(s) COM compliant, you need to implement a few exported dll functions required by the COM Library, all the IUnknown interface methods, define your interfaces and implement your interface methods, and create a type library. And of course, you would want to structure your dll(s) so that it contains no more than what is needed to provide the services your component is designed for. Also, you should keep each dll confined to services that would be frequently as a whole. In other words, don't put interfaces that provide special graphics capabilities in the same dll as the interfaces that provide database functionality.

Well, this post is probably as long as it really needs to be seeing as all the above information and more is documented much better than I could in easy to find locations throughout the internet. All one has to do is look.

If this helps anyone in any way then it was worth it.

Good luck and happy programming.
Posted on 2003-08-29 23:11:18 by djinn