Click here to Skip to main content
15,914,594 members
Home / Discussions / COM
   

COM

 
AnswerRe: How to release memory? when calling COM with param type BSTR* from VB exe application Pin
Steve S18-Sep-03 2:36
Steve S18-Sep-03 2:36 
GeneralRe: How to release memory? when calling COM with param type BSTR* from VB exe application Pin
Vi218-Sep-03 19:54
Vi218-Sep-03 19:54 
GeneralRe: How to release memory? when calling COM with param type BSTR* from VB exe application Pin
Steve S18-Sep-03 21:43
Steve S18-Sep-03 21:43 
GeneralRe: How to release memory? when calling COM with param type BSTR* from VB exe application Pin
Lim Bio Liong19-Sep-03 1:19
Lim Bio Liong19-Sep-03 1:19 
GeneralOffice::CommandBarControl problem Pin
dorutzu17-Sep-03 4:30
dorutzu17-Sep-03 4:30 
GeneralDVTARGETDEVICE structure Pin
CodeBrain17-Sep-03 3:02
CodeBrain17-Sep-03 3:02 
GeneralRe: DVTARGETDEVICE structure Pin
CodeBrain17-Sep-03 4:14
CodeBrain17-Sep-03 4:14 
QuestionAny ideas on gettin a IDispatch interface from Remote Computer? Pin
FearlessBurner15-Sep-03 9:47
FearlessBurner15-Sep-03 9:47 
I have wrote a SDI windows application(MyApp.exe) with an automation IDispatch interface for remote control. My problem is that I want to connect my client program to a running instance of MyApp.exe, rather than start up a new instance.

I succeeded doing this by changing the orignal initialisation

pIMyApp = new IMyApp;<br />
pIMyApp->CreateDispatch( "MyApp.Document" );


to the lines

pIMyApp = new IMyApp;<br />
CLSID clsid;<br />
if ( CLSIDFromProgID( OLESTR( "MyApp.Document" ), &clsid)==NOERROR)<br />
{<br />
    IUnknown *pUnknown=NULL;<br />
    HRESULT hr=GetActiveObject(clsid,NULL,&pUnknown);<br />
    if ( SUCCEEDED(hr) )<br />
    {<br />
        IDispatch *pIDispatch=NULL;<br />
        hr=pUnknown->QueryInterface(IID_IDispatch,(void **)&pIDispatch);<br />
        if (SUCCEEDED(hr) )<br />
        {<br />
            pIMyApp->AttachDispatch(pIDispatch,FALSE );<br />
            bInitialised = true;<br />
        }<br />
        pUnknown->Release();<br />
    }<br />
}


which attaaches pIMyApp interface pointer to the running instance of MyApp.exe (the IMyApp is registered in the Running-Object-Table) on my own computer.

I want be able to do the same on a remote computer. Is it possible to get apply GetActiveObject() to a remote instsance? The MS Knowledge base has a over complicated example
of achieving this for a program called ROTMONK.EXE which seems over complicated to me.

As I missing something? Does anyone know of a straightforward way of achieving a connection to a runing instance on a remote computer? Or more importantly, does anyone have any suggestions of a better way of achieving my aim?
AnswerRe: Any ideas on gettin a IDispatch interface from Remote Computer? Pin
Vi215-Sep-03 21:45
Vi215-Sep-03 21:45 
GeneralRe: Any ideas on gettin a IDispatch interface from Remote Computer? Pin
FearlessBurner16-Sep-03 11:22
FearlessBurner16-Sep-03 11:22 
GeneralMFC + TNA Pin
BERNERT15-Sep-03 4:02
BERNERT15-Sep-03 4:02 
GeneralRight Click Pin
Srikar Y14-Sep-03 0:20
Srikar Y14-Sep-03 0:20 
GeneralRe: Right Click Pin
Jagadeesh VN16-Sep-03 22:39
Jagadeesh VN16-Sep-03 22:39 
Questioninstallation and DLL? Pin
Maverick13-Sep-03 1:05
Maverick13-Sep-03 1:05 
AnswerRe: installation and DLL? Pin
Jagadeesh VN16-Sep-03 22:43
Jagadeesh VN16-Sep-03 22:43 
GeneralIOleCommandTarget Impleimentation Pin
suri babu12-Sep-03 5:16
suri babu12-Sep-03 5:16 
GeneralIs this safe? (map) Pin
Jeremy Pullicino11-Sep-03 3:45
Jeremy Pullicino11-Sep-03 3:45 
GeneralUsing ActiveX Pin
daphna10-Sep-03 4:21
daphna10-Sep-03 4:21 
GeneralRe: Using ActiveX Pin
Jagadeesh VN10-Sep-03 9:44
Jagadeesh VN10-Sep-03 9:44 
Question_bstr_t::copy and memory leak? Pin
Maverick9-Sep-03 22:56
Maverick9-Sep-03 22:56 
AnswerRe: _bstr_t::copy and memory leak? Pin
Jagadeesh VN9-Sep-03 23:27
Jagadeesh VN9-Sep-03 23:27 
GeneralRe: _bstr_t::copy and memory leak? Pin
Steve S11-Sep-03 1:58
Steve S11-Sep-03 1:58 
GeneralRe: _bstr_t::copy and memory leak? Pin
Maverick11-Sep-03 22:06
Maverick11-Sep-03 22:06 
GeneralRe: _bstr_t::copy and memory leak? Pin
doisy18-Sep-03 3:01
doisy18-Sep-03 3:01 
Generalasp to asp.net with com problem Pin
mark2229-Sep-03 22:44
mark2229-Sep-03 22:44 

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.