Click here to Skip to main content
15,920,508 members
Home / Discussions / COM
   

COM

 
GeneralRe: IPictureDisp with copy constructor Pin
27-Apr-02 5:48
suss27-Apr-02 5:48 
QuestionHow to use an activex when user does not have an administrator account ? Pin
Jean-Michel LE FOL19-Apr-02 23:17
Jean-Michel LE FOL19-Apr-02 23:17 
GeneralLinker Error Pin
Madmaximus19-Apr-02 4:20
Madmaximus19-Apr-02 4:20 
GeneralRe: Linker Error Pin
Tim Smith19-Apr-02 4:25
Tim Smith19-Apr-02 4:25 
GeneralCComPtr Pin
19-Apr-02 2:57
suss19-Apr-02 2:57 
GeneralRe: CComPtr Pin
Tim Smith19-Apr-02 3:34
Tim Smith19-Apr-02 3:34 
QuestionReturning values from COM object ?? Pin
19-Apr-02 1:37
suss19-Apr-02 1:37 
AnswerRe: Returning values from COM object ?? Pin
Paul M Watt21-Apr-02 9:39
mentorPaul M Watt21-Apr-02 9:39 
It is completely possible to create a COM interface function that returns the value directly like this:

DWORD GetCount();

However, I would only recommend doing this if you are only writing this object for use in your programs, and you will be using the object as an INPROC_SERVER.

If you want to write COM objects that are truely binary compatible, and can be used by other languages than C++, like VB, then you will need to alway return HRESULT. The reason why is for programs that perfrom network or interprocess communication through COM objects. Whenever you expand the boundaries of your program, there are certain situations that can occur that are out of your control, like the user disconnects their computer from the network. The other libraries that COM depends on will use the HRESULT to indicate this to your program or the program that is using your object.

If you do not use pointers to return values to the user, it becomes more difficult to marshal your data across process boundaries and computers.

Here is a simple prototype for a Get procedure:

HRESULT __stdcall GetCount(DWORD *dwCound);

You want to use the stdcall calling convention for all of your functions in COM, because this is the convention that all programs expect when dealing with a COM interface. _cdecl is the default for VC++.

The bool Essential COM,/i> by Don Box is very insightful for learning COM.


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: Returning values from COM object ?? Pin
21-Apr-02 11:48
suss21-Apr-02 11:48 
QuestionHow to implement a thread in a service? Pin
Bhikshapathi Gorantla18-Apr-02 21:42
Bhikshapathi Gorantla18-Apr-02 21:42 
QuestionHow to digital certificate Pin
liuage18-Apr-02 16:06
liuage18-Apr-02 16:06 
AnswerRe: How to digital certificate Pin
Todd Smith18-Apr-02 16:09
Todd Smith18-Apr-02 16:09 
GeneralIs there a class just as MFC's CTime in ATL/WTL Pin
18-Apr-02 15:50
suss18-Apr-02 15:50 
GeneralA Question of Using the Standard C++ to Programme Connectable Object in VC6.0 Pin
zjkw18-Apr-02 15:49
zjkw18-Apr-02 15:49 
GeneralRe: A Question of Using the Standard C++ to Programme Connectable Object in VC6.0 Pin
zjkw23-Apr-02 2:37
zjkw23-Apr-02 2:37 
GeneralActivex/VisualC++ Pin
Dr Anandhi18-Apr-02 0:40
Dr Anandhi18-Apr-02 0:40 
Generala question about WTL Pin
xsword17-Apr-02 21:48
xsword17-Apr-02 21:48 
GeneralRe: a question about WTL Pin
Paul M Watt17-Apr-02 22:08
mentorPaul M Watt17-Apr-02 22:08 
GeneralWhy this happened and how can I solve it Pin
chq1217-Apr-02 15:48
chq1217-Apr-02 15:48 
GeneralRe: Why this happened and how can I solve it Pin
Mike Nordell17-Apr-02 17:18
Mike Nordell17-Apr-02 17:18 
Questionatl book? Pin
bryce17-Apr-02 2:28
bryce17-Apr-02 2:28 
AnswerI think you should learn COM first. Pin
TomPeakz18-Apr-02 17:07
TomPeakz18-Apr-02 17:07 
GeneralRe: I think you should learn COM first. Pin
bryce21-Apr-02 14:54
bryce21-Apr-02 14:54 
AnswerRe: atl book? Pin
Paul M Watt18-Apr-02 17:39
mentorPaul M Watt18-Apr-02 17:39 
QuestionHow to add a new service to Outlook (2k/XP) just like Exchange ? Pin
TomPeakz16-Apr-02 20:34
TomPeakz16-Apr-02 20:34 

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.