Re: How to registere Com classes of MFC/ATL support application
On Feb 20, 9:11 pm, "Brian Muth" <bm...@mvps.org> wrote:
<doublemaster...@gmail.com> wrote in messagenews:5f155070-4049-4698-bc5f-3=
ba54eee7ff3@i29g2000prf.googlegroups.com...
On Feb 20, 3:54 am, "Brian Muth" <bm...@mvps.org> wrote:
<doublemaster...@gmail.com> wrote in messagenews:6588f83c-87ef-4c6f-88db=
-78b246a1f36d@i7g2000prf.googlegroups.com...
Hi,
I have a MFC Dilog based apllication with 'spport ATL'. i have
projectname.idl file in the project solution, which declares some
interfaces and coclasses.. Problem is how to register this calsses?
I can create the object using CCOmObject::Createinstance which doesnt
require any CLSID_XXX,,, but CCOMQIPtr failes..saying that class not
registered.. i tried manually registering the exe..still classes are
not registered..OLEVIEWER doesnt show up the interfaces or classes...
please help me..
I'm wondering if you want it the other way around, that is an ATL projec=
t with MFC support.
Brian
Noo...MFC project with ATL support. No way we can register the
classes??
Well, you probably can, but the wizard you chose doesn't put the infrastru=
cture in place. You will have to craft all that work by
hand.
Frankly, MFC and ATL really don't mix that well together in the same proje=
ct. I recommend either splitting the projects into two
subprojects (MFC in one, ATL in the other) or if you need an ATL project w=
ith GUI capabilities such as a dialog box, take a look at
WTL.
Brian- Hide quoted text -
- Show quoted text -
I think i have solved the problem..anyways thanks for ur help....
i was just debugging these methods and tried to see what is the
problem..
_AtlModule.RegisterClassObjects(CLSCTX_LOCAL_SERVER,
REGCLS_MULTIPLEUSE)
_AtlModule.UpdateRegistryAppId(FALSE);
_AtlModule.UnregisterServer(TRUE);
These weree the problem
1) for each class .rgs file will be created which has a entry..
val AppID = s '%APPID%'
i found that there was some trouble in %APPID%..so hard coded that
value
val AppID = s '{1111111-11111-1111-1111-111111}'
2) tlb file generated by the MFC application had a different name than
the exe...that is tlb file should have the same name as
[executablename.tlb]
----------------------------------------------------------------------------=
----------------------------------------------------------------------------=
----------------------------
Some possible errors that you may get...
1) HRESULT returns 'interface not registered'->>> may be becoz tlb is
not registered..