Menu

System cannot find file specified

Help
2012-01-07
2013-05-20
  • James Bremner

    James Bremner - 2012-01-07

    I have installed, apparently successfully v2.2.2.0 on a 64bit Windows 7 machine.

    I run the command, like this:

    command> install PortName=COM9 PortName=COM8
           CNCA0 PortName=COM9
           CNCB0 PortName=COM8
    ComDB: COM8 - logged as "in use"
    ComDB: COM9 - logged as "in use"
    command> busynames COM?*
    COM3
    COM4
    COM5
    COM6
    COM8
    COM9
    COMPOSITEBATTERY
    

    Then I try to open COM8 like this

        m_hIDComDev = CreateFileA( szCodedPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL );
        if( m_hIDComDev == NULL  || m_hIDComDev == INVALID_HANDLE_VALUE ) {
            wchar_t * lpMsgBuf;
            DWORD dw = ::GetLastError(); 
            FormatMessage(
                FORMAT_MESSAGE_ALLOCATE_BUFFER | 
                FORMAT_MESSAGE_FROM_SYSTEM |
                FORMAT_MESSAGE_IGNORE_INSERTS,
                NULL,
                dw,
                MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                (LPTSTR) &lpMsgBuf,
                0, NULL );
            myErrorMsg = (char*)malloc( 200 );
            sprintf(myErrorMsg,"Error creating connection %s ( %s ) %S",
                szPort,szCodedPort,lpMsgBuf);
    

    This fails with

    Error creating connection COM8 ( COM8 ) The system cannot find the file specified.
    

    Not that the exact same call to CreateFileA works perfectly on a 'real' COM port.

    Can someone tell me what the problem is?

    James

     
  • James Bremner

    James Bremner - 2012-01-09

    On windows 7 64 bit you have to enable testing of unsigned drivers.

    Run a command prompt as administrator. ( It is not enough just to run from an account with admin privileges. See here ( http://www.softwx.com/weather/virtualvp/VirtualSerialPorts64bitHelp.pdf ) for details of how to do this. )

    Type in the command bcdedit -set TESTSIGNING ON

    reboot. ( Windows will place a "test Mode" note on the bottom right of the desktop )

    James


    Suggestions:

    1 The instructions for running bcdedit in the README could be improved.

    2. Could the setup GUI not test to see if it is running 64 bit Windows 7.  If it is, and when it attempts to create a port pair and it does not appear in the register HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\SERIALCOMM could it not pop up a friendly description of the problem and the liikely solution?

    James

     
  • Vyacheslav Frolov

    … or use signed driver com0com-2.2.2.0-x64-fre-signed.zip

     

Log in to post a comment.