Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7743461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:32:27+00:00 2026-06-01T09:32:27+00:00

I’ve been at this for hours now and it’s starting to get upsetting. :(

  • 0

I’ve been at this for hours now and it’s starting to get upsetting. 🙁

I have a COM DLL that I created in .NET 4.0, that I want to be able to access with a legacy application made in VC++ 6. Its visible to COM, I already successfully created the TLB and SNK files, moved it over to the machine with the legacy C++ code, #imported the TLB, everything compiles fine.

Ran the following:

RegAsm ProtracFunctions.dll /codebase

gacutil /i ProtracFunctions.dll

They both are successful.

When I go to launch my application, as soon as I hit CoCreateInstance I’m given the message “Class not registered”.

I noted in RegEdit that my DLL does appear to be registered. Thats when I did some research, downloaded ProcMon, and realized that its looking at different locations. The CLSID is slightly different, and if I try to modify the ProtracFunctions.reg file (to use the GUID that ProcMon is picking up) that RegAsm gives me, and it DOES make an impact in ProcMon (more “SUCCESS” messages than “NAME NOT FOUND” messages at least), but I’m missing it seems, a ton of registry locations. Such as the key “TreatAs”, “InprocServerX86”, etc.

If anyone could tell me:

A) What I’m doing wrong in the first place

or

B) A list of exactly what registry values are added when you “register” a COM DLL so I can go in there and manually do it myself. (not ideal, I realize).

TIA!

My code:

CoInitialize(NULL);
CComQIPtr <ProtracFunctions::IDockingStation> spTestCom;
HRESULT hRes = spTestCom.CoCreateInstance(CLSID_ProtracDCS, 0, CLSCTX_ALL);

if (SUCCEEDED (hRes))
{
    printf("Created the instance");

    unsigned char Ret;
    unsigned char ErrCode;
    SAFEARRAY *pSA;

    spTestCom->DockConnect(3, 19200, &Ret);
    spTestCom->GetTagReads(1, &ErrCode, &pSA); 

    spTestCom->PowerOffReader(1, &Ret);
    spTestCom->DockDisconnect();

    spTestCom.Release ();
}
else
{
   _com_error error(hRes);
   LPCTSTR errorText = error.ErrorMessage();

   AfxMessageBox(errorText);

   //automatic cleanup when error goes out of scope
}

Added Notes:

The development machine is running Win XP 32 bit, and the “machine” with the legacy application is actually a Virtual Machine on the dev computer, also running XP.

Also, when I run my application, and I choose my test menu item that fires the above code, the first time I get the error “Class not registered” and if I click it again after that I’m seeing: “No such interface supported” … Very odd.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:32:29+00:00Added an answer on June 1, 2026 at 9:32 am

    I think you need to embedded a manifest in your assembly.
    See this URL. http://blogs.msdn.com/b/cheller/archive/2006/08/24/718757.aspx

    You can also make it works without having to register the assembly (Regasm.exe) with this code.

    {
        DWORD cookie;
        ACTCTX actctx = {sizeof(actctx)};
        actctx.lpSource = L"YOUR ASSEMBLY FULL PATH";
        actctx.lpResourceName = MAKEINTRESOURCE(1); //MAYBE 2 FOR DLL
        actctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;   
        HANDLE hActCtx = CreateActCtx(&actctx);
        BOOL fOK = ActivateActCtx(hActCtx, &cookie);
        if (!fOK)
            return E_FAIL;
    
        CComPtr<CSharpComInterface::ITestCSharpInterface> spCSharpTest;
        HRESULT hr = spCSharpTest.CoCreateInstance(__uuidof(CSharpComInterface::CoClass));
    
        if (hr != S_OK)
        {
            cout << "Failed to create instance CSharpComInterface::CoClass" <<endl;
        }
        else
        {
            cout << "Load Successfully : CSharpComInterface::CoClass" << endl;
            spCSharpTest->TestMethod();
        }
    
        DeactivateActCtx(0, cookie);
        ReleaseActCtx(hActCtx);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.