Note that there are some explanatory texts on larger screens.

plurals
  1. POImplement COM interface C++ / VC++ 6.0 / MFC
    text
    copied!<p>Entry level programmer here trying to implement a COM interface. I am working on a program that interfaces with the Aloha point of sale system. Aloha uses COM to work with external programs. I am trying to intercept card data from the mag card reader, which is an OPOS reader, not a keyboard wedge. The documentation I have doesn't explain how to implement this particular interface, but it does explain how to implement a similar one. I have tried to follow this example but I am getting no where. Support from Aloha is non-existent, their documentation is poor, outdated and sometimes just wrong, even though I have paid for a license.</p> <p>I tried to make a simple app just to test this functionality. Here is what I did:</p> <p>1) create a new project in vc++ 6.0 using ATL COM app wizard 2) server type dll 3) insert new atl object -> simple object 4) right click on my new class and choose implement interface 5) browse for type library, chose Iber.tlb (Aloha's tlb) 6) chose the interface I want to implement</p> <p>That made a .h, .cpp and .rgs file.</p> <p>The .h file has:</p> <pre><code>public: // IInterceptMagcard STDMETHOD(InterceptMagcard)(BSTR bstrAccountNumber, BSTR bstrCustomerName, BSTR bstrExpirationDate, BSTR bstrTrack1Info, BSTR bstrTrack2Info, BSTR bstrTrack3Info, BSTR bstrRawMagcardData, LONG * bWasDataHandled) { if (bWasDataHandled == NULL) return E_POINTER; return E_NOTIMPL; } </code></pre> <p>Is that where I implement my code? I put some test code in there to write out to a txt file just to test it. I then used:</p> <pre><code>HRESULT hr = CoCreateInstance(CLSID_AlohaMag, NULL, CLSCTX_INPROC_SERVER, IID_IAlohaMag, (void **) &amp;g_pIInterceptMagcard); </code></pre> <p>where g_pIInterceptMagcard is a pointer to my interface class created with the wizard above.</p> <p>When I try to register I get the following HRESULT: 0x80040112 That is "class not licensed for use."</p> <p>Does that mean my program didn't make the necessary registry entries?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload