Click here to Skip to main content
11,478,619 members (49,626 online)
   

COM

 
QuestionUrgent! How to instanciate an OCX ? Pin
turenne2-May-05 12:49
sussturenne2-May-05 12:49 
General,How to deploy COM+ Application. Pin
Het21091-May-05 20:38
memberHet21091-May-05 20:38 
GeneralRe: ,How to deploy COM+ Application. Pin
vinod shalgar12-May-05 2:41
membervinod shalgar12-May-05 2:41 
GeneralCOM and structures Pin
Imtiaz Murtaza30-Apr-05 7:10
memberImtiaz Murtaza30-Apr-05 7:10 
GeneralRe: COM and structures Pin
rwestgraham1-May-05 11:22
memberrwestgraham1-May-05 11:22 
GeneralRe: COM and structures Pin
Jörgen Sigvardsson5-May-05 13:52
memberJörgen Sigvardsson5-May-05 13:52 
GeneralRe: COM and structures Pin
rwestgraham5-May-05 20:05
memberrwestgraham5-May-05 20:05 
GeneralRe: COM and structures Pin
Jörgen Sigvardsson5-May-05 21:51
memberJörgen Sigvardsson5-May-05 21:51 
GeneralRe: COM and structures Pin
Santosh M. P.5-May-05 5:53
memberSantosh M. P.5-May-05 5:53 
GeneralRe: COM and structures Pin
vishalmore11-May-05 21:57
membervishalmore11-May-05 21:57 
GeneralRe: COM and structures Pin
Imtiaz Murtaza11-May-05 22:57
memberImtiaz Murtaza11-May-05 22:57 
GeneralRe: COM and structures Pin
vishalmore12-May-05 0:08
membervishalmore12-May-05 0:08 
GeneralThe problem while transfer C to MASM. really need your help. Pin
Anonymous29-Apr-05 21:06
sussAnonymous29-Apr-05 21:06 
Generalusing MSRdp control in windows application Pin
Behlool29-Apr-05 2:44
memberBehlool29-Apr-05 2:44 
Hi
I want to use the MSRdp (Microsoft Remote Desktop control) control from VC windows application but i dont want the control to be visible i want to create it programmatically. i used CoCreateInstance all things goes right and all the functions return S_OK but it doesnot get the session created on server however when i put the MSRdp control on the dialog box and use the same code from there it get connected .... and session is also created on server... Plz reply ASAP

this is the code i used for it

IID IID_RDP =
{0x9059f30f,0x4eb1,0x4bd2,{0x9F ,0xDC,0x36, 0xF4,0x3a, 0x21,0x8F, 0x4A}};


void Connect()
{
::CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);
DISPID dispid =0;

IDispatch* pDisp = NULL;

CString text;
GetDlgItemText(IDC_SERVER,text);
HRESULT hr;


hr = ::CoCreateInstance(IID_RDP,NULL,CLSCTX_SERVER ,IID_IDispatch,(void **)&pDisp);
pDisp->AddRef();

//Setting Username and server
SetProperty(pDisp,OLESTR("Server"),(OLECHAR *)text.AllocSysString());
GetDlgItemText(IDC_USER,text);
SetProperty(pDisp,OLESTR("UserName"),(OLECHAR *)text.AllocSysString());
SetProperty(pDisp,OLESTR("Domain"),(OLECHAR *)"");

//setting password
DISPPARAMS dispparams;
EXCEPINFO escep;
UINT uArgErr =0;

VARIANT Result;
::VariantInit(&Result);
Result.vt =VT_DISPATCH;
dispparams.cArgs = 0;
dispparams.rgvarg = NULL;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;

OLECHAR *szMem=OLESTR("AdvancedSettings2");
hr = pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);

hr =pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);

IDispatch *pAdvanced = 0;
pAdvanced = Result.pdispVal;
pAdvanced->AddRef();
GetDlgItemText(IDC_PASSWORD,text);
SetProperty(pAdvanced,OLESTR("ClearTextPassword"),(OLECHAR*)text.AllocSysString());

hr =pAdvanced->Invoke(0x68,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);
BOOL value = Result.boolVal;
//setting startup app
szMem=OLESTR("SecuredSettings");
pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);

hr =pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);

IDispatch *pSecured = Result.pdispVal;
pSecured->AddRef();
SetProperty(pSecured,OLESTR("StartProgram"),OLESTR("explorer.exe"));

//connecting to server
szMem=OLESTR("Connect");
pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);

hr = pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_METHOD,&dispparams,&Result,&escep,&uArgErr);
pSecured->Release();
pAdvanced->Release();
pDisp->Release();
return;
}


HRESULT SetProperty(IDispatch* pDispatch, OLECHAR* name , OLECHAR* value)
{
HRESULT hr;
VARIANTARG varg;
::VariantInit(&varg);
OLECHAR* szMem = name;
varg.vt = VT_BSTR;
varg.bstrVal = value;
DISPID dispidNamed = DISPID_PROPERTYPUT;
DISPID dispid;

DISPPARAMS dispparams;

dispparams.cArgs = 1;
dispparams.rgvarg = &varg;
dispparams.cNamedArgs = 1;
dispparams.rgdispidNamedArgs = &dispidNamed;

EXCEPINFO escep;
UINT uArgErr =0;

hr = pDispatch->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
if(SUCCEEDED(hr))
hr =pDispatch->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYPUT,&dispparams,NULL,&escep,&uArgErr);

return hr;
}

GeneralPort Blocking for Windows 98! Pin
URagavSouth28-Apr-05 21:10
memberURagavSouth28-Apr-05 21:10 
GeneralOutlook CreateDispatch error - "No such interface supported" Pin
Nickmatic28-Apr-05 16:39
memberNickmatic28-Apr-05 16:39 
GeneralPeculiar Exception Pin
Nirav Doshi28-Apr-05 7:32
memberNirav Doshi28-Apr-05 7:32 
GeneralRe: Peculiar Exception Pin
Sohail Kadiwala29-Apr-05 0:32
memberSohail Kadiwala29-Apr-05 0:32 
QuestionOLE VB Function equilivent for C++? Pin
BrianBoru28-Apr-05 5:42
memberBrianBoru28-Apr-05 5:42 
AnswerRe: OLE VB Function equilivent for C++? Pin
Vi212-May-05 2:42
memberVi212-May-05 2:42 
GeneralThrowing an event with a nested UDT Pin
GizzoF28-Apr-05 1:18
memberGizzoF28-Apr-05 1:18 
GeneralProperties in COM Pin
ckapil28-Apr-05 0:12
memberckapil28-Apr-05 0:12 
GeneralRe: Properties in COM Pin
ThatsAlok28-Apr-05 1:37
memberThatsAlok28-Apr-05 1:37 
GeneralRe: Properties in COM Pin
ThatsAlok28-Apr-05 2:03
memberThatsAlok28-Apr-05 2:03 
GeneralRe: Properties in COM Pin
ckapil28-Apr-05 2:24
memberckapil28-Apr-05 2:24 
GeneralIStream object string length error Pin
Matt Harvey27-Apr-05 15:09
sussMatt Harvey27-Apr-05 15:09 
GeneralRe: IStream object string length error Pin
Matt Harvey27-Apr-05 17:45
sussMatt Harvey27-Apr-05 17:45 
GeneralMaking DLL from Matlab Pin
marcelgilvega1327-Apr-05 4:39
membermarcelgilvega1327-Apr-05 4:39 
GeneralComponent Accessibility Pin
Robert Findlay27-Apr-05 3:52
memberRobert Findlay27-Apr-05 3:52 
GeneralRe: Component Accessibility Pin
Robert Findlay9-May-05 2:07
memberRobert Findlay9-May-05 2:07 
GeneralNeed help about Office Automation Pin
figer25-Apr-05 22:47
sussfiger25-Apr-05 22:47 
GeneralRe: Need help about Office Automation Pin
Jason Henderson26-Apr-05 9:16
memberJason Henderson26-Apr-05 9:16 
GeneralRe: Need help about Office Automation Pin
vishalmore11-May-05 22:13
membervishalmore11-May-05 22:13 
GeneralAcitveX container hanging problem Pin
kostik125-Apr-05 22:17
memberkostik125-Apr-05 22:17 
GeneralDCOM Pin
itkid25-Apr-05 20:32
memberitkid25-Apr-05 20:32 
GeneralRe: DCOM Pin
Mayur Mahajan26-Apr-05 18:21
memberMayur Mahajan26-Apr-05 18:21 
GeneralHandling COM Events Pin
i.chen24-Apr-05 21:34
sussi.chen24-Apr-05 21:34 
GeneralRe: Handling COM Events Pin
Frank_lgh9-May-05 15:45
memberFrank_lgh9-May-05 15:45 
GeneralC to MASM, troubles while converting. Pin
Brean24-Apr-05 12:34
memberBrean24-Apr-05 12:34 
GeneralActiveX controls on web pages Pin
Hugo Hallman24-Apr-05 12:01
memberHugo Hallman24-Apr-05 12:01 
GeneralRe: ActiveX controls on web pages Pin
vishalmore11-May-05 22:17
membervishalmore11-May-05 22:17 
GeneralRe: ActiveX controls on web pages Pin
Hugo Hallman12-May-05 2:27
memberHugo Hallman12-May-05 2:27 
QuestionHow can we typecast the Exported Function pointers of a DLL Pin
sijis21-Apr-05 23:26
membersijis21-Apr-05 23:26 
AnswerRe: How can we typecast the Exported Function pointers of a DLL Pin
Peter Ritchie23-Apr-05 8:36
memberPeter Ritchie23-Apr-05 8:36 
QuestionHow can I set DCOMCNFG Settings programmatically? Pin
Danillo21-Apr-05 5:49
memberDanillo21-Apr-05 5:49 
AnswerRe: How can I set DCOMCNFG Settings programmatically? Pin
Jason Henderson25-Apr-05 8:08
memberJason Henderson25-Apr-05 8:08 
GeneralError : "The procedure number is out of range." Pin
Ed K19-Apr-05 11:56
memberEd K19-Apr-05 11:56 
GeneralRe: Error : "The procedure number is out of range." Pin
Peter Ritchie23-Apr-05 8:38
memberPeter Ritchie23-Apr-05 8:38 
GeneralRe: Error : "The procedure number is out of range." Pin
Ed K23-Apr-05 8:47
memberEd K23-Apr-05 8:47 
GeneralOut of proc Interface Implementation Problem Pin
thomas_tom9918-Apr-05 0:27
memberthomas_tom9918-Apr-05 0:27 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 5 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid