Solved

Interface not registered in registry

Posted on 2004-10-14
1
402 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
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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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.

773 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