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 7643003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:20:11+00:00 2026-05-31T09:20:11+00:00

In a VC++ project, I am trying to create an instance (via COM) of

  • 0

In a VC++ project, I am trying to create an instance (via COM) of a C# class contained within a C# project.

Facts

  • Both the C# and C++ projects are compiled using .NET 4.0
  • The C# .dll is being registered using regasm /codebase “CSharpProjectName.dll”“, and windows command prompt reports, “Types registered successfully.”
  • In the c++ project, I attempt to create an instance of a class in the C# project, but I get an HRESULT of 0x80040154 – class not registered

Here is an example of my attempt to create an instance of the .NET object from the C# .dll. The concrete class I am trying to instantiate is called Employee, which for the sake of presenting my question simply, implements the IPerson interface:

    CSharpProjectName::IPersonPtr pPersonPtr;
    HRESULT hr = pPersonPtr.CreateInstance(CSharpProjectName::CLSID_Employee);

Why am I getting a “class not registered” error even though I registered the c# .dll using “regasm /codebase” and confirmed existence of the key in the registry?

Any help would greatly be appreciated. Thanks!

  • 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-05-31T09:20:12+00:00Added an answer on May 31, 2026 at 9:20 am

    I’ve had that problem in the past and it was due to both processes not being 32 or 64 bit. If you are running a 32-bit OS, you can stop reading now because what I say doesn’t apply.

    Use regedit to try and find your ProgIds and CLSIDs in the registry. If your C++ project is 32-bit, make sure that your C# classes were registered to the 32-bit hive–HKEY_CLASSES_ROOT\Wow6432Node. If your C++ project is 64-bit, make sure that your C# classes were registered to the 64-bit hive–HKEY_CLASSES_ROOT.

    If you need to register to the 64-bit hive, you may need to call the version of RegAsm.exe under c:\windows\microsoft.net\framework64…

    The other possibility for things to go wrong is that you might need to run the .NET 4.0 version of regasm.exe. If you just type “regasm” in the command line, it will give you the version of regasm you are running. You might need to type the full path of .NET 4.0 version of regasm–found at c:\windows\microsoft.net\framework\v4.0.3019\regasm.exe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a multi project template. I wish the sub projects
I'm trying to create a very basic Setup and Deployment project using Visual Studio.
I'm trying to create a Zend Framework project using PHP 5.3.2 and Zend Framework
I am trying to create an instance of an Entity Framework object using reflection:
I'm trying to create a frame VCL inside my project using factory pattern something
I'm trying to create a database within the app_data folder of an asp.net mvc
I'm trying to create a new project in NetBeans PHP from existing sources. When
I'm trying to create a project-like document, in that it contains subdocuments in a
I'm trying to create a build script for my current project, which includes an
I'm trying to create my own error window for the project I am working

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.