Article View: comp.os.ms-windows.programmer.win32
Article #2224Re: where to get understandable COM - Examples & Tutorials
From: tunstals
Date: Mon, 28 Sep 1998 00:00
Date: Mon, 28 Sep 1998 00:00
59 lines
2982 bytes
2982 bytes
>>is there a web-site out there, where one can get a good and understandable >>tutorial in german or english, how to build In-Process-Servers for >>COM/ActiveX with MFC/MSVC++5 ? >> Well all you have to do is select an ATL COM appwizard then when you get the choice of Server Type click "Dynamic Link Library". If you want to make your Server support MFC (not recommended for lightweight ATL objects) then click - you guessed. Your new Appwizard generated project will not have any COM (or should we say ATL ;) ) objects in it. To rectify the situation right click on the classview window to the left where name "<xxx> classes" is. "Insert ATL object " will be in the popup menu. Select that option. Now you must choose the type of object to insert. If you want an object that has no GUI then select "Simple object" in the "objects" menu. If you want a non-GUI object that is designed to work with Microsoft Transaction Server (and hence take advantage of NT 4's security features - you can add user priviledges to state who can instantiate objects) then click on the MTS Server component. Now select the MTX tab. You should check "supports IObjectControl" for faster object instantiation. And don't forget to insert WIN32_DCOM into your extra defines (don't worry, the system creates your proxy and stub code for inter process data marshalling) If you want an object with a GUI then select "Full Control" from the "Controls" menu. Make sure to access the miscellaneous tab to specify the requirements for your control. The Stock properties tab also specifies which common properties are in your control. When done, override OnDraw method to draw your object. (There's no docs for ATL_DRAWINFO struct in VC++5 - well not on mine - but luckily example code is already there to guide you). You can now add properties and methods to your objects by right clicking on the "spoon" (interface). From then on it's akin to working with an ActiveX object (but not quite the same) It's not that difficult now, is it :) Scott Tunstall Software Engineer Eastern Solutions Ltd (#18477) FirstTel comm Systems (CA) http://www.kwikrite.clara.net/boulderdash/ Mail to: tunstals@email.msn.com
Technical Details
Message-ID:
<#kwgKey69GA.315@upnetnews05>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6tob7i$p34$1@inf2.informatik.uni-stuttgart.de> <6toi1f$31u$1@news01.li.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1124cf,fb5aaef196d24425 X-Google-Attributes: gid1124cf,public X-Google-Thread: 113dfb,fb5aaef196d24425 X-Google-Attributes: gid113dfb,public X-Google-Thread: f6ef4,fb5aaef196d24425 X-Google-Attributes: gidf6ef4,public From: "tunstals" <tunstals@email.msn.com> Subject: Re: where to get understandable COM - Examples & Tutorials Date: 1998/09/28 Message-ID: <#kwgKey69GA.315@upnetnews05> X-Deja-AN: 395763664 References: <6tob7i$p34$1@inf2.informatik.uni-stuttgart.de> <6toi1f$31u$1@news01.li.net> Newsgroups: comp.os.ms-windows.programmer.win32,de.comp.os.ms-windows.programmer,fido.ger.windows.prog X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3