Can't instanciate Errors object in C++/MFC dialog app == :-(
- From: "Jeff" <budajeff@xxxxxxxxx>
- Date: 13 Jan 2006 10:31:17 -0800
My overall goal is to use ADO to execute some simple sql commands. I
can instantiate and Open() a Connection object, but Execute() results
in a _com_error exception. I'm trying to get at the error info, and I
believe that I have to instantiate an Errors object to do so. However,
instantiation fails, "Class not registered", on my XP SP2 machine w/
MDAC 2.81.1117.0.
Here's some code from a C++/MFC dialog app that illustrates my problem
instantiating the Errors object:
....
#import "C:\\Program Files\\Common Files\\System\\ado\\msado15.dll"
rename_namespace("msado15") rename("EOF", "adoEOF")
....
BOOL CAdoNoWorkyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
AfxEnableControlContainer();
OleInitialize(NULL);
msado15::ErrorsPtr errors;
HRESULT hr = errors.CreateInstance(__uuidof(msado15::Errors));
if(FAILED(hr))
{
return false;
}
return TRUE;
}
....
The HRESULT comes back as:
0x80040154 Class not registered.
My copy of msad015.tlh contains this:
struct __declspec(uuid("00000501-0000-0010-8000-00aa006d2ea4"))
Errors : _Collection
and that GUID does appear in my registry, so I conclude that the class
I want to instantiate is at least partially registered.
What am I doing wrong?
Thanks in advance!
Jeff
.
- Follow-Ups:
- Prev by Date: RE: How do I use ADO in VC++ 7.0 to get the size of the database
- Next by Date: Re: Can't instanciate Errors object in C++/MFC dialog app == :-(
- Previous by thread: RE: How do I use ADO in VC++ 7.0 to get the size of the database
- Next by thread: Re: Can't instanciate Errors object in C++/MFC dialog app == :-(
- Index(es):
Relevant Pages
- Re: Runtime error
... the system registry has no ... If the attempt to instantiate is the result
of a CreateObject or GetObject ... Many third-party applications will create an add-in
and place it in the ... Office\Startup folder or use a COM add-in to integrate their ...
(microsoft.public.word.application.errors) - Re: ClassFactory cannot supply requested class
... I have been unable to reproduce the error on my machine. ... to instantiate
a COM component. ... Anytime there is a 'COM' issue the registry is an active player, ...
logging, error trapping, or other debugging tools to isolate and identify ... (microsoft.public.vb.general.discussion) - Instantiating Remote component through COM
... I want to instantiate a component in Machine B from Machine A. i.e The ... orginal
component is registered in Machine A and i want to create a object of ... I have made an entry
in teh registry of machine B with the same class ID ... Deepak ... (microsoft.public.win32.programmer.ole) - Instantiating Remote Objects through COM
... I want to instantiate a component in Machine B from Machine A. i.e The ... orginal
component is registered in Machine A and i want to create a object of ... I have made an entry
in teh registry of machine B with the same class ID ... Deepak ... (microsoft.public.win32.programmer.ole) - Instantiating Remote Objects through COM
... I want to instantiate a component in Machine B from Machine A. i.e The ... orginal
component is registered in Machine A and i want to create a object of ... I have made an entry
in teh registry of machine B with the same class ID ... Deepak ... (microsoft.public.win32.programmer.ole)