ERROR_NOT_SUPPORTED in BiDiSpl.h using IBiDiSpl Interface

This is a discussion on ERROR_NOT_SUPPORTED in BiDiSpl.h using IBiDiSpl Interface within the C++ Programming forums, part of the General Programming Boards category; Hello, I am trying to create some bidirectional communication with a printer, and I am having a little problem. I ...

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    4

    ERROR_NOT_SUPPORTED in BiDiSpl.h using IBiDiSpl Interface

    Hello,

    I am trying to create some bidirectional communication with a printer, and I am having a little problem.

    I was originally working with a HP Color LaserJet 2820, which does not support bidirectional communication, so the error that I was getting (ERROR_NOT_SUPPORTED), makes sense.

    I've since switched to a Konica Minolta Magicolor 5450, which does support BiDi, yet I still get the same error. I would like to know if anyone has successfully implemented this interface with a bi-directional printer, or can assist me in doing so.

    My code so far is:
    The line with the error has a comment below it.

    Code:
    System::String^ BiDiTest::GetToner(System::String^ PrinterName, System::String^ valueRequired) 
    { 
        IBidiSpl        * pIBidiSpl = NULL;  
        IBidiRequest    * pIReq = NULL; 
        HRESULT hr = 0; 
         
        //Convert System::String^ to LPCWSTR ---------------------- 
        const wchar_t* chars = 
        (const wchar_t*)(Marshal::StringToHGlobalUni(PrinterName)).ToPointer(); 
        LPCWSTR name = chars; 
        //  ---------------------------------------------------- 
             
            DWORD dwAccess = BIDI_ACCESS_USER; 
             
            BSTR request = CString(mySchema).AllocSysString(); 
             
     
            DWORD Erroc = GetLastError(); 
             
            CoUninitialize(); 
            hr = CoInitializeEx (NULL, COINIT_MULTITHREADED); 
             
            hr = CoCreateInstance(CLSID_BidiSpl, NULL, CLSCTX_INPROC_SERVER, IID_IBidiSpl, 
                                   (void**)&pIBidiSpl);  
             
            hr = pIBidiSpl->BindDevice(name, dwAccess); 
     
            hr = CoCreateInstance(CLSID_BidiRequest, 
                                    NULL,  
                                    CLSCTX_INPROC_SERVER, 
                                    IID_IBidiRequest,  
                                    (void**)&pIReq); 
     
            hr = pIReq->SetSchema (L"\\Printer.Layout.InputBins.Tray2:Installed"); 
     
            LPWSTR   pszSchema = NULL; 
            DWORD    dwType = NULL; 
            BYTE     *pData = NULL; 
            ULONG    uSize = NULL; 
            bool bDuplexInstalled; 
            BSTR* response = NULL; 
             
            hr = pIBidiSpl->SendRecv(BIDI_ACTION_GET, pIReq);
               // This is where I get the error....
     
            hr = pIReq->GetOutputData (0, &pszSchema, &dwType, &pData, &uSize); 
     
                                 
            CoTaskMemFree (pData); 
     
            hr = pIBidiSpl->UnbindDevice (); 
     
            pIReq->Release(); 
            pIBidiSpl->Release(); 
            CoUninitialize(); 
             
                 
        return PrinterName; 
    }

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    I think the author of the component you're calling would be able to help more. This is a general purpose C++ forum.

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    4
    I've talked to Microsoft (they're the author), no help there. I've posted on a plethora of forums across the web and no one has an answer.

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    Who created the component? Ask them. If Microsoft did not create the component then I'm not surprised they did not help you.

  5. #5
    Registered User
    Join Date
    Jun 2008
    Posts
    4
    Microsoft created it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to get RSSI value, send to sensor, sensor receive package, repackage it?
    By techissue2008 in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-04-2009, 09:13 AM
  2. Calling IRichEditOle interface methods
    By Niara in forum C Programming
    Replies: 2
    Last Post: 01-16-2009, 12:23 PM
  3. marshall interface needed?
    By George2 in forum Windows Programming
    Replies: 2
    Last Post: 04-06-2008, 07:15 PM
  4. game user interface
    By DavidP in forum Game Programming
    Replies: 3
    Last Post: 06-19-2004, 12:44 PM
  5. OOP in C
    By lyx in forum C Programming
    Replies: 4
    Last Post: 11-23-2003, 12:12 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21