none
Problem with this dsf c++ code? RRS feed

  • Question

  • I have been fooling around with dsf but have referenced this forum link (http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/48b72e29-5589-4aa8-9547-380058da93ba) for the code below I have plugged the code into an empty ATL project in which I threw a few classes using the c++ wizards. The problem: the dsfdevice is not being plugged-in and showing up in device manager I am doing something wrong? (refer to the comment that says step 3). I thought at first it wasn't finding a softehci controller but ran it and it does not display the messagebox if VARIANT_TRUE==varbool so Iam stumped. P.S. is the dsf support email still operational? More information on system: windows 7 64-bit.

    long usernum;
    //long i; 
    long j;
    	IDSF* piDSF = 0;
    IDSFDevices* piDSFDevices = NULL;
    ISoftEHCIRootHubPort* piPort = NULL;
    ISoftUSBHubPort* piHubPort1 = NULL;
    boolean pluggedin[5];
    //IHIDDevice* piSoftHidDevice1 = NULL;
    
    //ISoftUSBHub* ExtHub[12];
    
    	BYTE HIDDescriptors[8];
    	BYTE ReportDescriptorsMouse[66];
      // SoftUSBHubPort ExtHubPort[4];
    	
    		    HRESULT             hr          = S_OK;
    // CMMEmulator
    
    
    
    STDMETHODIMP CMMEmulator::initdevices(void)
    {
    	// TODO: Add your implementation code here
    	 //   HRESULT             hr          = S_OK;
    
    
    //IHIDDevice* piSoftHidDevice1 = NULL;
     HRESULT hr = S_OK;
    	CComBSTR bstrIDSFBus        = CComBSTR(__uuidof(IDSFBus));
    	CComBSTR bstrISoftEHCICtrlr = CComBSTR(__uuidof(ISoftEHCICtrlr));
    	hr = CoInitialize(NULL);
    	// Step 1:
    	// Create SoftUSBHub Object
    	ISoftUSBHub* piSoftUSBHub = 0;
    
    	hr = CoCreateInstance( __uuidof(SoftUSBHub),
    							NULL,
    							CLSCTX_INPROC_SERVER,
    							__uuidof(ISoftUSBHub),
    							reinterpret_cast<void**>(&piSoftUSBHub) );
    	// Step 2:
    	// Find the DSF Controller
    	hr = CoCreateInstance( __uuidof(DSF),
    							NULL,
    							CLSCTX_INPROC_SERVER,
    							__uuidof(IDSF),
    							reinterpret_cast<void**>(&piDSF) );
    	LONG lNumDevices = 0;
    	hr = piDSF->get_Devices( reinterpret_cast<DSFDevices**>(&piDSFDevices) );
    	hr = piDSFDevices->get_Count( &lNumDevices );
    	IDSFDevice *piDSFDevice = NULL;
    	IDSFBus *piDSFBus = NULL;
    	ISoftEHCICtrlr *ppiEHCIDevice = NULL;
    
    	VARIANT_BOOL varBool = VARIANT_FALSE;
    	VARIANT varIndex;
    	VariantInit(&varIndex);
    
    
    	for(long i = 0; i < lNumDevices; i++) 
    	{
    		varIndex.vt = VT_I4;
    		varIndex.lVal = i;
    
    		hr = piDSFDevices->get_Item(varIndex,reinterpret_cast<DSFDevice**>(&piDSFDevice));
    	 
    
    		if (NULL != piDSFDevice)
    		{
    			//Check if the device contain a IDSFBus object
    			hr = piDSFDevice->HasObject(bstrIDSFBus, &varBool);
    		   
    
    			if(VARIANT_TRUE == varBool)
    			{
    				//Found the controller device
    				IUnknown *punkCtrlrDevice = NULL;
    
    				// Getting ISoftEHCICtrlr, not IDSFBus here
    				hr = piDSFDevice->get_Object(bstrISoftEHCICtrlr, &punkCtrlrDevice);
    			
    
    				// Need additional QueryInterface call to get working ISoftEHCICtrlr
    				punkCtrlrDevice->QueryInterface(__uuidof(ISoftEHCICtrlr), reinterpret_cast<void**>(&ppiEHCIDevice));
    				punkCtrlrDevice->Release();
    			}
    			else
    	        {
    		 MessageBox(NULL,L"Could not find simulated a EHCI controller. Did you remember to run softehcicfg.exe /install?",NULL,NULL);
    	        }
    		}
    	}
    	// Step 3:
    	// get port 1 of of the Root USB Hub
    	ISoftEHCIRootHubPorts* piPorts = NULL;
    	hr = ppiEHCIDevice->get_Ports( reinterpret_cast<SoftEHCIRootHubPorts**>(&piPorts) );
    	varIndex.vt = VT_I4;
    	varIndex.lVal = 1;
    	
    	hr = piPorts->get_Item( varIndex, reinterpret_cast<SoftEHCIRootHubPort**>(&piPort) );
    	ISoftUSBDevice* piSoftUSBDevice = NULL;
    	hr = piSoftUSBHub->get_SoftUSBDevice( reinterpret_cast<SoftUSBDevice**>(&piSoftUSBDevice) );
    	hr = piSoftUSBDevice->get_DSFDevice( reinterpret_cast<DSFDevice**>(&piDSFDevice) );
    	hr = piPort->HotPlug( reinterpret_cast<DSFDevice*>(piDSFDevice) );
    	
    	// step 5
    	// get port 1 of of the Soft USB Hub
    	ISoftUSBHubPorts* piHubPorts = NULL;
    	hr = piSoftUSBHub->get_Ports( reinterpret_cast<SoftUSBHubPorts**>(&piHubPorts) );
    	varIndex.vt = VT_I4;
    	varIndex.lVal = 1;
    	hr = piHubPorts->get_Item( varIndex, reinterpret_cast<SoftUSBHubPort**>(&piHubPort1) );
    	// step 6
    	// create and initialize the Soft HID Device
    //	hr = CoCreateInstance( __uuidof(HIDDevice),
    						//	NULL,
    						//	CLSCTX_INPROC_SERVER,
    						//	__uuidof(IHIDDevice),
    						//	reinterpret_cast<void**>(&piSoftHidDevice1) );
    
    
    	return S_OK;
    }


    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr

    Monday, June 10, 2013 11:36 PM

Answers

  • I have been fooling around with dsf but have referenced this forum link (http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/48b72e29-5589-4aa8-9547-380058da93ba) for the code below I have plugged the code into an empty ATL project in which I threw a few classes using the c++ wizards. The problem: the dsfdevice is not being plugged-in and showing up in device manager I am doing something wrong? (refer to the comment that says step 3). I thought at first it wasn't finding a softehci controller but ran it and it does not display the messagebox if VARIANT_TRUE==varbool so Iam stumped. P.S. is the dsf support email still operational? More information on system: windows 7 64-bit.

    long usernum;
    //long i; 
    long j;
    	IDSF* piDSF = 0;
    IDSFDevices* piDSFDevices = NULL;
    ISoftEHCIRootHubPort* piPort = NULL;
    ISoftUSBHubPort* piHubPort1 = NULL;
    boolean pluggedin[5];
    //IHIDDevice* piSoftHidDevice1 = NULL;
    
    //ISoftUSBHub* ExtHub[12];
    
    	BYTE HIDDescriptors[8];
    	BYTE ReportDescriptorsMouse[66];
      // SoftUSBHubPort ExtHubPort[4];
    	
    		    HRESULT             hr          = S_OK;
    // CMMEmulator
    
    
    
    STDMETHODIMP CMMEmulator::initdevices(void)
    {
    	// TODO: Add your implementation code here
    	 //   HRESULT             hr          = S_OK;
    
    
    //IHIDDevice* piSoftHidDevice1 = NULL;
     HRESULT hr = S_OK;
    	CComBSTR bstrIDSFBus        = CComBSTR(__uuidof(IDSFBus));
    	CComBSTR bstrISoftEHCICtrlr = CComBSTR(__uuidof(ISoftEHCICtrlr));
    	hr = CoInitialize(NULL);
    	// Step 1:
    	// Create SoftUSBHub Object
    	ISoftUSBHub* piSoftUSBHub = 0;
    
    	hr = CoCreateInstance( __uuidof(SoftUSBHub),
    							NULL,
    							CLSCTX_INPROC_SERVER,
    							__uuidof(ISoftUSBHub),
    							reinterpret_cast<void**>(&piSoftUSBHub) );
    	// Step 2:
    	// Find the DSF Controller
    	hr = CoCreateInstance( __uuidof(DSF),
    							NULL,
    							CLSCTX_INPROC_SERVER,
    							__uuidof(IDSF),
    							reinterpret_cast<void**>(&piDSF) );
    	LONG lNumDevices = 0;
    	hr = piDSF->get_Devices( reinterpret_cast<DSFDevices**>(&piDSFDevices) );
    	hr = piDSFDevices->get_Count( &lNumDevices );
    	IDSFDevice *piDSFDevice = NULL;
    	IDSFBus *piDSFBus = NULL;
    	ISoftEHCICtrlr *ppiEHCIDevice = NULL;
    
    	VARIANT_BOOL varBool = VARIANT_FALSE;
    	VARIANT varIndex;
    	VariantInit(&varIndex);
    
    
    	for(long i = 0; i < lNumDevices; i++) 
    	{
    		varIndex.vt = VT_I4;
    		varIndex.lVal = i;
    
    		hr = piDSFDevices->get_Item(varIndex,reinterpret_cast<DSFDevice**>(&piDSFDevice));
    	 
    
    		if (NULL != piDSFDevice)
    		{
    			//Check if the device contain a IDSFBus object
    			hr = piDSFDevice->HasObject(bstrIDSFBus, &varBool);
    		   
    
    			if(VARIANT_TRUE == varBool)
    			{
    				//Found the controller device
    				IUnknown *punkCtrlrDevice = NULL;
    
    				// Getting ISoftEHCICtrlr, not IDSFBus here
    				hr = piDSFDevice->get_Object(bstrISoftEHCICtrlr, &punkCtrlrDevice);
    			
    
    				// Need additional QueryInterface call to get working ISoftEHCICtrlr
    				punkCtrlrDevice->QueryInterface(__uuidof(ISoftEHCICtrlr), reinterpret_cast<void**>(&ppiEHCIDevice));
    				punkCtrlrDevice->Release();
    			}
    			else
    	        {
    		 MessageBox(NULL,L"Could not find simulated a EHCI controller. Did you remember to run softehcicfg.exe /install?",NULL,NULL);
    	        }
    		}
    	}
    	// Step 3:
    	// get port 1 of of the Root USB Hub
    	ISoftEHCIRootHubPorts* piPorts = NULL;
    	hr = ppiEHCIDevice->get_Ports( reinterpret_cast<SoftEHCIRootHubPorts**>(&piPorts) );
    	varIndex.vt = VT_I4;
    	varIndex.lVal = 1;
    	
    	hr = piPorts->get_Item( varIndex, reinterpret_cast<SoftEHCIRootHubPort**>(&piPort) );
    	ISoftUSBDevice* piSoftUSBDevice = NULL;
    	hr = piSoftUSBHub->get_SoftUSBDevice( reinterpret_cast<SoftUSBDevice**>(&piSoftUSBDevice) );
    	hr = piSoftUSBDevice->get_DSFDevice( reinterpret_cast<DSFDevice**>(&piDSFDevice) );
    	hr = piPort->HotPlug( reinterpret_cast<DSFDevice*>(piDSFDevice) );
    	
    	// step 5
    	// get port 1 of of the Soft USB Hub
    	ISoftUSBHubPorts* piHubPorts = NULL;
    	hr = piSoftUSBHub->get_Ports( reinterpret_cast<SoftUSBHubPorts**>(&piHubPorts) );
    	varIndex.vt = VT_I4;
    	varIndex.lVal = 1;
    	hr = piHubPorts->get_Item( varIndex, reinterpret_cast<SoftUSBHubPort**>(&piHubPort1) );
    	// step 6
    	// create and initialize the Soft HID Device
    //	hr = CoCreateInstance( __uuidof(HIDDevice),
    						//	NULL,
    						//	CLSCTX_INPROC_SERVER,
    						//	__uuidof(IHIDDevice),
    						//	reinterpret_cast<void**>(&piSoftHidDevice1) );
    
    
    	return S_OK;
    }


    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr


    It appears I had it compiling it to 32-bit so now that I change it doesnt compile and gives me an error about a module not being x86. retrying on 32-bit computer but if anyone sees an error they can point it out.

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr



    I recompiled for 32-bit and it works! I wonder if its possible to compile for 64-bit machines with dsf when executing code from c++?

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr

    • Marked as answer by The Thinker Wednesday, June 12, 2013 12:57 PM
    Wednesday, June 12, 2013 12:19 PM

All replies

  • I have been fooling around with dsf but have referenced this forum link (http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/48b72e29-5589-4aa8-9547-380058da93ba) for the code below I have plugged the code into an empty ATL project in which I threw a few classes using the c++ wizards. The problem: the dsfdevice is not being plugged-in and showing up in device manager I am doing something wrong? (refer to the comment that says step 3). I thought at first it wasn't finding a softehci controller but ran it and it does not display the messagebox if VARIANT_TRUE==varbool so Iam stumped. P.S. is the dsf support email still operational? More information on system: windows 7 64-bit.

    long usernum;
    //long i; 
    long j;
    	IDSF* piDSF = 0;
    IDSFDevices* piDSFDevices = NULL;
    ISoftEHCIRootHubPort* piPort = NULL;
    ISoftUSBHubPort* piHubPort1 = NULL;
    boolean pluggedin[5];
    //IHIDDevice* piSoftHidDevice1 = NULL;
    
    //ISoftUSBHub* ExtHub[12];
    
    	BYTE HIDDescriptors[8];
    	BYTE ReportDescriptorsMouse[66];
      // SoftUSBHubPort ExtHubPort[4];
    	
    		    HRESULT             hr          = S_OK;
    // CMMEmulator
    
    
    
    STDMETHODIMP CMMEmulator::initdevices(void)
    {
    	// TODO: Add your implementation code here
    	 //   HRESULT             hr          = S_OK;
    
    
    //IHIDDevice* piSoftHidDevice1 = NULL;
     HRESULT hr = S_OK;
    	CComBSTR bstrIDSFBus        = CComBSTR(__uuidof(IDSFBus));
    	CComBSTR bstrISoftEHCICtrlr = CComBSTR(__uuidof(ISoftEHCICtrlr));
    	hr = CoInitialize(NULL);
    	// Step 1:
    	// Create SoftUSBHub Object
    	ISoftUSBHub* piSoftUSBHub = 0;
    
    	hr = CoCreateInstance( __uuidof(SoftUSBHub),
    							NULL,
    							CLSCTX_INPROC_SERVER,
    							__uuidof(ISoftUSBHub),
    							reinterpret_cast<void**>(&piSoftUSBHub) );
    	// Step 2:
    	// Find the DSF Controller
    	hr = CoCreateInstance( __uuidof(DSF),
    							NULL,
    							CLSCTX_INPROC_SERVER,
    							__uuidof(IDSF),
    							reinterpret_cast<void**>(&piDSF) );
    	LONG lNumDevices = 0;
    	hr = piDSF->get_Devices( reinterpret_cast<DSFDevices**>(&piDSFDevices) );
    	hr = piDSFDevices->get_Count( &lNumDevices );
    	IDSFDevice *piDSFDevice = NULL;
    	IDSFBus *piDSFBus = NULL;
    	ISoftEHCICtrlr *ppiEHCIDevice = NULL;
    
    	VARIANT_BOOL varBool = VARIANT_FALSE;
    	VARIANT varIndex;
    	VariantInit(&varIndex);
    
    
    	for(long i = 0; i < lNumDevices; i++) 
    	{
    		varIndex.vt = VT_I4;
    		varIndex.lVal = i;
    
    		hr = piDSFDevices->get_Item(varIndex,reinterpret_cast<DSFDevice**>(&piDSFDevice));
    	 
    
    		if (NULL != piDSFDevice)
    		{
    			//Check if the device contain a IDSFBus object
    			hr = piDSFDevice->HasObject(bstrIDSFBus, &varBool);
    		   
    
    			if(VARIANT_TRUE == varBool)
    			{
    				//Found the controller device
    				IUnknown *punkCtrlrDevice = NULL;
    
    				// Getting ISoftEHCICtrlr, not IDSFBus here
    				hr = piDSFDevice->get_Object(bstrISoftEHCICtrlr, &punkCtrlrDevice);
    			
    
    				// Need additional QueryInterface call to get working ISoftEHCICtrlr
    				punkCtrlrDevice->QueryInterface(__uuidof(ISoftEHCICtrlr), reinterpret_cast<void**>(&ppiEHCIDevice));
    				punkCtrlrDevice->Release();
    			}
    			else
    	        {
    		 MessageBox(NULL,L"Could not find simulated a EHCI controller. Did you remember to run softehcicfg.exe /install?",NULL,NULL);
    	        }
    		}
    	}
    	// Step 3:
    	// get port 1 of of the Root USB Hub
    	ISoftEHCIRootHubPorts* piPorts = NULL;
    	hr = ppiEHCIDevice->get_Ports( reinterpret_cast<SoftEHCIRootHubPorts**>(&piPorts) );
    	varIndex.vt = VT_I4;
    	varIndex.lVal = 1;
    	
    	hr = piPorts->get_Item( varIndex, reinterpret_cast<SoftEHCIRootHubPort**>(&piPort) );
    	ISoftUSBDevice* piSoftUSBDevice = NULL;
    	hr = piSoftUSBHub->get_SoftUSBDevice( reinterpret_cast<SoftUSBDevice**>(&piSoftUSBDevice) );
    	hr = piSoftUSBDevice->get_DSFDevice( reinterpret_cast<DSFDevice**>(&piDSFDevice) );
    	hr = piPort->HotPlug( reinterpret_cast<DSFDevice*>(piDSFDevice) );
    	
    	// step 5
    	// get port 1 of of the Soft USB Hub
    	ISoftUSBHubPorts* piHubPorts = NULL;
    	hr = piSoftUSBHub->get_Ports( reinterpret_cast<SoftUSBHubPorts**>(&piHubPorts) );
    	varIndex.vt = VT_I4;
    	varIndex.lVal = 1;
    	hr = piHubPorts->get_Item( varIndex, reinterpret_cast<SoftUSBHubPort**>(&piHubPort1) );
    	// step 6
    	// create and initialize the Soft HID Device
    //	hr = CoCreateInstance( __uuidof(HIDDevice),
    						//	NULL,
    						//	CLSCTX_INPROC_SERVER,
    						//	__uuidof(IHIDDevice),
    						//	reinterpret_cast<void**>(&piSoftHidDevice1) );
    
    
    	return S_OK;
    }


    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr


    It appears I had it compiling it to 32-bit so now that I change it doesnt compile and gives me an error about a module not being x86. retrying on 32-bit computer but if anyone sees an error they can point it out.

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr


    Monday, June 10, 2013 11:47 PM
  • I have been fooling around with dsf but have referenced this forum link (http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/48b72e29-5589-4aa8-9547-380058da93ba) for the code below I have plugged the code into an empty ATL project in which I threw a few classes using the c++ wizards. The problem: the dsfdevice is not being plugged-in and showing up in device manager I am doing something wrong? (refer to the comment that says step 3). I thought at first it wasn't finding a softehci controller but ran it and it does not display the messagebox if VARIANT_TRUE==varbool so Iam stumped. P.S. is the dsf support email still operational? More information on system: windows 7 64-bit.

    long usernum;
    //long i; 
    long j;
    	IDSF* piDSF = 0;
    IDSFDevices* piDSFDevices = NULL;
    ISoftEHCIRootHubPort* piPort = NULL;
    ISoftUSBHubPort* piHubPort1 = NULL;
    boolean pluggedin[5];
    //IHIDDevice* piSoftHidDevice1 = NULL;
    
    //ISoftUSBHub* ExtHub[12];
    
    	BYTE HIDDescriptors[8];
    	BYTE ReportDescriptorsMouse[66];
      // SoftUSBHubPort ExtHubPort[4];
    	
    		    HRESULT             hr          = S_OK;
    // CMMEmulator
    
    
    
    STDMETHODIMP CMMEmulator::initdevices(void)
    {
    	// TODO: Add your implementation code here
    	 //   HRESULT             hr          = S_OK;
    
    
    //IHIDDevice* piSoftHidDevice1 = NULL;
     HRESULT hr = S_OK;
    	CComBSTR bstrIDSFBus        = CComBSTR(__uuidof(IDSFBus));
    	CComBSTR bstrISoftEHCICtrlr = CComBSTR(__uuidof(ISoftEHCICtrlr));
    	hr = CoInitialize(NULL);
    	// Step 1:
    	// Create SoftUSBHub Object
    	ISoftUSBHub* piSoftUSBHub = 0;
    
    	hr = CoCreateInstance( __uuidof(SoftUSBHub),
    							NULL,
    							CLSCTX_INPROC_SERVER,
    							__uuidof(ISoftUSBHub),
    							reinterpret_cast<void**>(&piSoftUSBHub) );
    	// Step 2:
    	// Find the DSF Controller
    	hr = CoCreateInstance( __uuidof(DSF),
    							NULL,
    							CLSCTX_INPROC_SERVER,
    							__uuidof(IDSF),
    							reinterpret_cast<void**>(&piDSF) );
    	LONG lNumDevices = 0;
    	hr = piDSF->get_Devices( reinterpret_cast<DSFDevices**>(&piDSFDevices) );
    	hr = piDSFDevices->get_Count( &lNumDevices );
    	IDSFDevice *piDSFDevice = NULL;
    	IDSFBus *piDSFBus = NULL;
    	ISoftEHCICtrlr *ppiEHCIDevice = NULL;
    
    	VARIANT_BOOL varBool = VARIANT_FALSE;
    	VARIANT varIndex;
    	VariantInit(&varIndex);
    
    
    	for(long i = 0; i < lNumDevices; i++) 
    	{
    		varIndex.vt = VT_I4;
    		varIndex.lVal = i;
    
    		hr = piDSFDevices->get_Item(varIndex,reinterpret_cast<DSFDevice**>(&piDSFDevice));
    	 
    
    		if (NULL != piDSFDevice)
    		{
    			//Check if the device contain a IDSFBus object
    			hr = piDSFDevice->HasObject(bstrIDSFBus, &varBool);
    		   
    
    			if(VARIANT_TRUE == varBool)
    			{
    				//Found the controller device
    				IUnknown *punkCtrlrDevice = NULL;
    
    				// Getting ISoftEHCICtrlr, not IDSFBus here
    				hr = piDSFDevice->get_Object(bstrISoftEHCICtrlr, &punkCtrlrDevice);
    			
    
    				// Need additional QueryInterface call to get working ISoftEHCICtrlr
    				punkCtrlrDevice->QueryInterface(__uuidof(ISoftEHCICtrlr), reinterpret_cast<void**>(&ppiEHCIDevice));
    				punkCtrlrDevice->Release();
    			}
    			else
    	        {
    		 MessageBox(NULL,L"Could not find simulated a EHCI controller. Did you remember to run softehcicfg.exe /install?",NULL,NULL);
    	        }
    		}
    	}
    	// Step 3:
    	// get port 1 of of the Root USB Hub
    	ISoftEHCIRootHubPorts* piPorts = NULL;
    	hr = ppiEHCIDevice->get_Ports( reinterpret_cast<SoftEHCIRootHubPorts**>(&piPorts) );
    	varIndex.vt = VT_I4;
    	varIndex.lVal = 1;
    	
    	hr = piPorts->get_Item( varIndex, reinterpret_cast<SoftEHCIRootHubPort**>(&piPort) );
    	ISoftUSBDevice* piSoftUSBDevice = NULL;
    	hr = piSoftUSBHub->get_SoftUSBDevice( reinterpret_cast<SoftUSBDevice**>(&piSoftUSBDevice) );
    	hr = piSoftUSBDevice->get_DSFDevice( reinterpret_cast<DSFDevice**>(&piDSFDevice) );
    	hr = piPort->HotPlug( reinterpret_cast<DSFDevice*>(piDSFDevice) );
    	
    	// step 5
    	// get port 1 of of the Soft USB Hub
    	ISoftUSBHubPorts* piHubPorts = NULL;
    	hr = piSoftUSBHub->get_Ports( reinterpret_cast<SoftUSBHubPorts**>(&piHubPorts) );
    	varIndex.vt = VT_I4;
    	varIndex.lVal = 1;
    	hr = piHubPorts->get_Item( varIndex, reinterpret_cast<SoftUSBHubPort**>(&piHubPort1) );
    	// step 6
    	// create and initialize the Soft HID Device
    //	hr = CoCreateInstance( __uuidof(HIDDevice),
    						//	NULL,
    						//	CLSCTX_INPROC_SERVER,
    						//	__uuidof(IHIDDevice),
    						//	reinterpret_cast<void**>(&piSoftHidDevice1) );
    
    
    	return S_OK;
    }


    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr


    It appears I had it compiling it to 32-bit so now that I change it doesnt compile and gives me an error about a module not being x86. retrying on 32-bit computer but if anyone sees an error they can point it out.

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr



    I recompiled for 32-bit and it works! I wonder if its possible to compile for 64-bit machines with dsf when executing code from c++?

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://www.computerprofessions.co.nr

    • Marked as answer by The Thinker Wednesday, June 12, 2013 12:57 PM
    Wednesday, June 12, 2013 12:19 PM
  • Hello.

    Now I'm trying just run test sample.

    vb script returns error with null handler.

    Could you explain how you set up working project on c++ or may be you can share it?

    Thanks

    Monday, November 21, 2016 8:12 AM