Click here to Skip to main content
15,896,063 members
Home / Discussions / COM
   

COM

 
Questionhow to get mail address in outlook express Pin
nikhil3131-Mar-09 22:25
nikhil3131-Mar-09 22:25 
QuestionC++ COM EventHandler: How to catch COM events from Delphi COM Server / VC6 Pin
ipforce30-Mar-09 4:57
ipforce30-Mar-09 4:57 
AnswerRe: C++ COM EventHandler: How to catch COM events from Delphi COM Server / VC6 Pin
Jonathan Davies2-Apr-09 5:32
Jonathan Davies2-Apr-09 5:32 
GeneralRe: C++ COM EventHandler: How to catch COM events from Delphi COM Server / VC6 Pin
ipforce2-Apr-09 6:08
ipforce2-Apr-09 6:08 
GeneralRe: C++ COM EventHandler: How to catch COM events from Delphi COM Server / VC6 Pin
ipforce2-Apr-09 6:59
ipforce2-Apr-09 6:59 
QuestionUpdating Resource Pin
sumedh_code30-Mar-09 0:55
sumedh_code30-Mar-09 0:55 
QuestionAccess Denied in VC++ COM Pin
RevathiRamakumar30-Mar-09 0:20
RevathiRamakumar30-Mar-09 0:20 
AnswerRe: Access Denied in VC++ COM Pin
Roger Stoltz30-Mar-09 3:35
Roger Stoltz30-Mar-09 3:35 
RevathiRamakumar wrote:
I have a server Component which is a inprocess exe


Ummm, I think not... If it's an EXE it is out-of-process.
Try and change CLSCTX_LOCAL_SERVER in the call to ::CoCreateInstance() into CLSCTX_INPROC_SERVER and the call will most likely fail.


RevathiRamakumar wrote:
IGetStatus* pGetStatus;
....
str1 = pGetStatus->GetBeat();


It looks like you're using the raw COM interface and not a wrapper for dispatch interfaces. If this is the case you're violating the COM rule that says every function must return a HRESULT. Thus you cannot return a string, it has to be an output parameter.
How is your IGetStatus::GetBeat() interface function declared in the IDL-file?
What attributes have you added to your IGetStatus interface? "oleautomation"?
Is your IGetStatus interface declared as a "dispinterface" or just "interface" in the IDL-file?

I would suggest that you declare your IGetStatus interface as an ordinary interface using the "interface" keyword in the IDL-file, but add the "oleautomation" attribute in order to use typelib-marshalling. The benefit is that you don't have to worry about how the interface is marshalled, but the downside is that you're restricted to use automation compatible data types such as BSTR (any type that can be contained in a VARIANT).
Then your interface function declaration should look something like this:
HRESULT GetBeat( [out] BSTR* pTheBeat );
and you should call it some way similar to this:
BSTR* pbstrTheBeat = NULL;
hr = pGetStatus->GetStatus( pbstrTheBeat ); // pGetStatus is the interface pointer
if( SUCCEEDED( hr ) )
{
    // The call was successful, do whatever you like with the string
    ::SysFreeString( pbstrTheBeat ); // Since it was allocated by the server or stub
}



"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


GeneralRe: Access Denied in VC++ COM [modified] Pin
RevathiRamakumar30-Mar-09 19:39
RevathiRamakumar30-Mar-09 19:39 
AnswerRe: Access Denied in VC++ COM Pin
Roger Stoltz30-Mar-09 22:17
Roger Stoltz30-Mar-09 22:17 
GeneralRe: Access Denied in VC++ COM Pin
RevathiRamakumar30-Mar-09 22:46
RevathiRamakumar30-Mar-09 22:46 
AnswerRe: Access Denied in VC++ COM Pin
Roger Stoltz30-Mar-09 23:04
Roger Stoltz30-Mar-09 23:04 
GeneralRe: Access Denied in VC++ COM Pin
RevathiRamakumar30-Mar-09 23:10
RevathiRamakumar30-Mar-09 23:10 
AnswerRe: Access Denied in VC++ COM Pin
Roger Stoltz30-Mar-09 23:13
Roger Stoltz30-Mar-09 23:13 
GeneralRe: Access Denied in VC++ COM Pin
RevathiRamakumar30-Mar-09 23:16
RevathiRamakumar30-Mar-09 23:16 
GeneralRe: Access Denied in VC++ COM Pin
RevathiRamakumar30-Mar-09 23:56
RevathiRamakumar30-Mar-09 23:56 
AnswerRe: Access Denied in VC++ COM Pin
Roger Stoltz31-Mar-09 3:17
Roger Stoltz31-Mar-09 3:17 
QuestionRe: Access Denied in VC++ COM Pin
Roger Stoltz31-Mar-09 3:17
Roger Stoltz31-Mar-09 3:17 
AnswerRe: Access Denied in VC++ COM Pin
RevathiRamakumar31-Mar-09 18:32
RevathiRamakumar31-Mar-09 18:32 
GeneralRe: Access Denied in VC++ COM Pin
Roger Stoltz1-Apr-09 6:08
Roger Stoltz1-Apr-09 6:08 
GeneralRe: Access Denied in VC++ COM Pin
RevathiRamakumar1-Apr-09 18:11
RevathiRamakumar1-Apr-09 18:11 
QuestionRe: Access Denied in VC++ COM Pin
Roger Stoltz1-Apr-09 22:57
Roger Stoltz1-Apr-09 22:57 
AnswerRe: Access Denied in VC++ COM Pin
RevathiRamakumar1-Apr-09 23:33
RevathiRamakumar1-Apr-09 23:33 
AnswerRe: Access Denied in VC++ COM Pin
RevathiRamakumar8-Apr-09 1:17
RevathiRamakumar8-Apr-09 1:17 
AnswerRe: Access Denied in VC++ COM Pin
Vi21-Apr-09 21:20
Vi21-Apr-09 21:20 

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.