Note that there are some explanatory texts on larger screens.

plurals
  1. POCOM object works in Win7 but not XP
    primarykey
    data
    text
    <p>This is frustrating me to no end. I have a OPOS program that reads RFID cards. I wrote 2 C# COM libraries. Both work in Windows 7 with no problems. One of them was rather difficult to get working, but I finally got it. To get my COM libraries to work with the OPOS program I had to make sure that the target platform was x86. Since I have win7 pro and I this same program runs on other computers that are x86 and run Win XP I fired up my virtual machine. I've tried a million things to try to get this to work and to no avail. Things I've tried</p> <p>My one C# library (keyboard) at first required that not only I use regasm but also I had to have that library in the location as the Service object and the executable (ie my OPOS program) I found that in Win7 if i search for the GUID in registry there is a key called CodeBase that is basically the location of the library. If i put that same key into my XP machine I don't have to have the library in both locations. Tested it and it works great.</p> <p>So then the need for another library came about. It is written in C# (same as keyboard) with almost the exact same settings. The ONLY difference between the two is the Network library class that inherits the interface has <code>ComSourceInterfaces(typeof(ITapEvents)</code> AND uses Log4Net. I've never used Log4Net. But in order to get it to compile I had to get it, so I just copied all the libraries to my Program Files folder and compiled. I did not run a installer (don't even know if one exists) but like I said. it works in Win7.</p> <p>I can't get it to work AT ALL in XP. The HResult that i get back is usually 0x80040154. Any clue what is going on? Anything that I should check?</p> <p><strong>EDIT</strong> Showing instantiation of the COM object</p> <pre><code>BOOL hasit = FALSE; try { CString str1; CString str2; str1.Format("%llu", sid); //send as decimal str2.Format("%llX", uid);//send as hex _bstr_t uidStr(str2); _bstr_t sidStr(str1); INetworkPtr obj = NULL; HRESULT hRes = obj.CreateInstance(_uuidof(Network)); hasit = SUCCEEDED(hRes); if (hasit) { CNetwork cti(obj); cti.SendStrings(sidStr, uidStr); cti.ReleaseDispatch(); } else { LogWriter::WriteError(__FUNCTION__, "Error sending Strings", (int)hRes); } } catch(...) { LogWriter::WriteError(__FUNCTION__, "Error sending Strings"); hasit = FALSE; } return hasit; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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