Solved

Interface not registered in registry

Posted on 2004-10-14
1
400 Views
Last Modified: 2008-03-06
Hi !
  I made a component with two interfaces. I used the ATL wizards. Its a simple object only. Only the first interface is registered in the registry. I dont see the registry entry for the second! Hence, my CoCreateInstance fails when I try to create a pointer to the second interface! How do I ensure that the registry entry is made (Under Classes) for the second interface?

0
Comment
Question by:manoj_johar
1 Comment
 
LVL 3

Accepted Solution

by:
stu_pb earned 250 total points
Comment Utility
You can edit the object.rgs file in the project to add the second object.

You can use a tool likd GUIDgen to create a CLSID for the second object.

HKCR
{
      MyObject.Object1.1 = s 'Object Class'
      {
            CLSID = s '{FF01DABF-43C5-4B80-8696-FB81C6CBA74A}'
      }
      MyObject.Object1= s 'Object Class'
      {
            CLSID = s '{FF01DABF-43C5-4B80-8696-FB81C6CBA74A}'
            CurVer = s MyObject.Object1.1'
      }
      NoRemove CLSID
      {
            ForceRemove {FF01DABF-43C5-4B80-8696-FB81C6CBA74A} = s Object Class'
            {
                  ProgID = s MyObject.Object1.1'
                  VersionIndependentProgID = s MyObject.Object1
                  ForceRemove 'Programmable'
                  InprocServer32 = s '%MODULE%'
                  {
                        val ThreadingModel = s 'Apartment'
                  }
                  'TypeLib' = s '{5BC2EA21-81ED-44CE-ADDA-02ABE29790B8}'
            }
      }
               MyObject.Object2.1 = s 'Object Class'
      {
            CLSID = s '{AF01DABF-43C5-4B80-8696-FB81C6CBA74A}'
      }
      MyObject.Object2= s 'Object Class'
      {
            CLSID = s '{AF01DABF-43C5-4B80-8696-FB81C6CBA74A}'
            CurVer = s MyObject.Object2.1'
      }
      NoRemove CLSID
      {
            ForceRemove {AF01DABF-43C5-4B80-8696-FB81C6CBA74A} = s Object Class'
            {
                  ProgID = s MyObject.Object2.1'
                  VersionIndependentProgID = s MyObject.Object2
                  ForceRemove 'Programmable'
                  InprocServer32 = s '%MODULE%'
                  {
                        val ThreadingModel = s 'Apartment'
                  }
                  'TypeLib' = s '{ABC2EA21-81ED-44CE-ADDA-02ABE29790B8}'
            }
      }
}

Good Luck!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now