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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:43:43+00:00 2026-05-16T08:43:43+00:00

I’m working on my first COM project that is importing a c# DLL with

  • 0

I’m working on my first COM project that is importing a c# DLL with a C# COM Wrapper class into a C++ native code application. Our application is based on the CSRegFreeCOMServer VS2008 sample project from Microsoft’s All-In-One Framework. Our system is using – VS2008, .Net3.5, boost 1.4.2 and Qt 4.6.2.

This application has been running fine on our 32bit XP dev boxes. However, when we load the system onto our Windows 7-64bit system. We cannot get the com objects to initialize. We keep getting error 0x80040154 (which I cannot seem to determine what it means).

Our header file is –

#ifndef ControlComInterface_h__
#define ControlComInterface_h__
#include <string>
#include <ole2.h>    // OLE2 Definitions
// Importing mscorlib.tlb is necessary for .NET components
// see: 
//  http://msdn.microsoft.com/en-us/library/s5628ssw.aspx
#import "mscorlib.tlb" raw_interfaces_only                \
    high_property_prefixes("_get","_put","_putref")        \
    rename("ReportEvent", "InteropServices_ReportEvent")
using namespace mscorlib;
// import the COM Declarations exported com the CSRegFreeCOMServer
#import "..\CSRegFreeCOMServer\bin\Release\CSRegFreeCOMServer.tlb"  no_namespace named_guids
using namespace std;
class ControlComInterface
{
public:
    ControlComInterface(void);
    ~ControlComInterface(void);
    IFieldsPtr spFields;
    IPchFilePtr spPchFileWrapper;
    bool CreateInterfaceObjects(string &errorMsg);
};
#endif // ControlComInterface_h__

The simplified class code is

    #include "ControlComInterface.h"
#include <boost/lexical_cast.hpp>
ControlComInterface::ControlComInterface(void)
    {    }
ControlComInterface::~ControlComInterface(void)
    {    }
bool ControlComInterface::CreateInterfaceObjects( string &errorMsg )
{
HRESULT hr = S_OK;
hr = ::CoInitialize(NULL);  
if (FAILED(hr))
{
    errorMsg = "CoInitialize failed w/err: ";
    errorMsg.append(boost::lexical_cast<string>(hr));
    return false;
    }
errorMsg = "";
hr = spFields.CreateInstance(__uuidof(Fields));
if (FAILED(hr))
    {
    errorMsg = "IFields::CreateInstance failed w/err: ";
    errorMsg.append(boost::lexical_cast<string>(hr));
    return false;
    }
return true;
}

The code is failing with a error code of 0x80040154 on the call to spFields.CreateInstance(...), which just creates an instance of the class in the com object using a default constructor.

Suggestions?

  • 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-16T08:43:43+00:00Added an answer on May 16, 2026 at 8:43 am

    0x80040154 is REGDB_E_CLASSNOTREG. That is, class not registered.

    The COM couldn’t find (in the registry) the class factory with CLSID = __uuidof(Fields).

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.