Solved

Interface not registered in registry

Posted on 2004-10-14
1
405 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
stu_pb earned 250 total points
ID: 12309147
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

707 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