Click here to Skip to main content
15,886,199 members
Home / Discussions / COM
   

COM

 
GeneralIHTMLElement and IHTMLElement2 and IHTMLWindow2 Pin
Oguzhan ERKAN11-Jul-01 4:54
Oguzhan ERKAN11-Jul-01 4:54 
GeneralCom interface with SQL to MSDE database Pin
Bigge10-Jul-01 23:27
Bigge10-Jul-01 23:27 
GeneralRe: Com interface with SQL to MSDE database Pin
11-Jul-01 8:35
suss11-Jul-01 8:35 
GeneralRe: Com interface with SQL to MSDE database Pin
Bigge12-Jul-01 1:22
Bigge12-Jul-01 1:22 
GeneralRe: Com interface with SQL to MSDE database Pin
12-Jul-01 2:04
suss12-Jul-01 2:04 
GeneralUsing A Collection - Newbie Pin
AJ1239-Jul-01 11:48
AJ1239-Jul-01 11:48 
GeneralRe: Using A Collection - Newbie Pin
9-Jul-01 14:42
suss9-Jul-01 14:42 
GeneralLots o' quick ATL COM/DCOM questions Pin
Pavlos Touboulidis9-Jul-01 10:08
Pavlos Touboulidis9-Jul-01 10:08 
I'm starting with ATL, I've written several 'test' COMs but now I face the following problems. I want to create a COM object (class) that will be used from remote machines (DCOM). The COM will be an out of process server. Let's say my object is named MyObj and the C++ class CMyObj.

1. How do I get the count of open objects?
Should I use a static member variable and increase/descrease it everytime an object is constructed/destructed? If yes (or even if no), where should I put the code for this? In the constructor/destructor of CMyObj or in the FinalConstruct-FinalRelease?
2. How to I prevent a client to create an object of that class based on runtime conditions? For example, in order to disallow more than 10 objects at the same time. Should I throw in the constructor? throw what?
3. What's the best way to destroy my object, even if the client hasn't done so yet? 'delete this;'? For example, if the client passes an invalid parameter on one method, I would like to be able to destroy the object (at least on the srv-side).
4. What happens when (in DCOM) the network layer fails? Is the object on the server and/or client side automatically destroyed? If not, can I catch an event or something (I'm more concerned on the server side) when that happens and ... do what?
5. How can I pass my object (and all the data it holds) through the network? Are there any functions I would have to override (something like ReadFromStream or WriteToStream, I don't know)?
6. What's the best way to inform the client of critical failures of a method he just called? Should all these methods have an [out,retval] long *result? Should I use the IErrorSomething that the ATL object wizard allows you to support? Can I return anything else than S_OK, or is HRESULT used internally from the COM/DCOM layer?

Any help would be greatly appreciated.
Moreover, the one who answers all of my questions, will win a free copy of my free Tetris game;)
GeneralRe: Lots o' quick ATL COM/DCOM questions Pin
9-Jul-01 14:54
suss9-Jul-01 14:54 
GeneralRe: Lots o' quick ATL COM/DCOM questions Pin
Pavlos Touboulidis9-Jul-01 22:02
Pavlos Touboulidis9-Jul-01 22:02 
GeneralWin2000 COM issue (maybe) Pin
Chris Klecker6-Jul-01 5:55
Chris Klecker6-Jul-01 5:55 
Generalcatching COM event in console app Pin
4-Jul-01 13:53
suss4-Jul-01 13:53 
Questionhow do I implement IStorage methods Pin
pathi3-Jul-01 22:39
pathi3-Jul-01 22:39 
AnswerRe: how do I implement IStorage methods Pin
4-Jul-01 12:17
suss4-Jul-01 12:17 
GeneralWTL/ATL & CDateTimePickerCtrl Pin
3-Jul-01 9:34
suss3-Jul-01 9:34 
GeneralRe: WTL/ATL & CDateTimePickerCtrl Pin
Michael Dunn3-Jul-01 10:25
sitebuilderMichael Dunn3-Jul-01 10:25 
GeneralRe: WTL/ATL & CDateTimePickerCtrl Pin
3-Jul-01 17:06
suss3-Jul-01 17:06 
GeneralInterface with CString as parameter Pin
Aky3-Jul-01 5:27
Aky3-Jul-01 5:27 
GeneralRe: Interface with CString as parameter Pin
J Patel3-Jul-01 5:36
J Patel3-Jul-01 5:36 
GeneralRe: Interface with CString as parameter Pin
Jim Howard3-Jul-01 6:54
Jim Howard3-Jul-01 6:54 
GeneralRe: Interface with CString as parameter Pin
3-Jul-01 9:45
suss3-Jul-01 9:45 
GeneralCOM crashing Pin
Chris Klecker2-Jul-01 8:36
Chris Klecker2-Jul-01 8:36 
Questionpassing map ? Pin
parag29-Jun-01 3:09
parag29-Jun-01 3:09 
AnswerRe: passing map ? Pin
1-Jul-01 19:51
suss1-Jul-01 19:51 
GeneralCOM+ Programmers/Trainers Pin
28-Jun-01 6:55
suss28-Jun-01 6:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.