Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
Hello,
I am trying to create Remote Desktop application using  CMstscax1 object.

The USB stick can display in client when I plug it before my instance starts,but can't realize plug and play

When my RDP instance starts,the drive redirection is not working when I plug in a USB stick. It works in normal RDP though (by mstsc.exe).

C++
COleDispatchDriver disp;
	COleException *e = new COleException;

	if(disp.CreateDispatch(this->m_VSOConnector.GetClsid(), e))
	{
		IMsRdpClientNonScriptable3 * pNonScript = NULL;
		IUnknown* pUnknown = this->m_VSOConnector.GetControlUnknown();
		HRESULT hr=pUnknown->QueryInterface(IID_IMsRdpClientNonScriptable3,(void**)&pNonScript);
		if(SUCCEEDED(hr))
		{
			VARIANT_BOOL boolean = 0;
			pNonScript->put_RedirectDynamicDrives( VARIANT_TRUE );
			pNonScript->put_RedirectDynamicDevices( VARIANT_TRUE );

			pNonScript->get_ShowRedirectionWarningDialog(&boolean);

			pNonScript->get_RedirectDynamicDrives(&boolean);

			pNonScript->Release();

		} 
	}

Any ideas ?
Posted
Updated 30-Jul-15 22:08pm
v2
Comments
august213 17-Apr-19 14:50pm    
Did you ever get it to work?
I'm facing a problem MSTSC.EXE redirects USB printers but the activex doesn't

Tom

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900