Create Instance Failed!

  • Thread starter Thread starter Joseph Lu
  • Start date Start date
J

Joseph Lu

Hi, all
Could any boday tell me why I failed to create instance here in the
following code ?

Codes sample
--------------------------------------------------------------------
void CInsertDataTestDlg::OnBnClickedButton1()
{
_ConnectionPtr pMyConnect=NULL;
HRESULT hr=pMyConnect.CreateInstance(__uuidof(Connection));
if(FAILED(hr))return ;
AfxMessageBox(_T("Successfull connected!"), MB_OK)
}
 
Joseph Lu said:
Could any boday tell me why I failed to create instance here in the
following code ?
...
--------------------------------------------------------------------
void CInsertDataTestDlg::OnBnClickedButton1()
{
_ConnectionPtr pMyConnect=NULL;
HRESULT hr=pMyConnect.CreateInstance(__uuidof(Connection));
if(FAILED(hr))return ;
AfxMessageBox(_T("Successfull connected!"), MB_OK)
}
--------------------------------------------------------------------

Um, what is the value of hr?

Regards,
Will
 
the value of hr is : 0x800401f0 , my code is very simple, I used VC to
create a dialog based application and the create a new button on the dialog,
then I added a button click event to this app ,and I have listed the code as
my previous mail detailed .
 
Back
Top