none
DSF GenericHID device emulation C++ RRS feed

  • Question

  • Hello.

    I'm trying to do subj on Win7x64 pc, VS2013 and WDK 7.1

    I followed instuctions and able to run sample from C:\Program Files\dsf\GenericHID\ with vb script

    trying to customize this code I was faced with 2 problems:

    1)

    I built all samples from ..WinDDK\7600.16385.1\src\test\dsf\usb\GenericHID\ with build -cZP command

    sample from objchk_win7_amd64 works fine

    but sample from objchk_win7_x86

    returns an error:

    TestGenericHid.wsf(70, 26) WScript.CreateObject: Could not create object named "SoftHIDReceiver.HIDDevice.1".

    The same error I got when tried to run script with dll built under VS2013

    Can someone explain me why I have such behavior? 

    2) I created a win32 console app, 

    added SoftHIDReceiver.lib

    and dsfif.lib

    and tried to create COM object with code

    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 );
    
    .....

    but all 

    CoCreateInstance

    methods return Class not registered.

    I tried to register SoftHIDReceiver.dll and dsfif.tlb, but result is the same.

    Thursday, November 24, 2016 4:41 PM