Click here to Skip to main content
15,886,707 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Loading Resource from dll fails Pin
Super Hornet13-May-09 0:16
Super Hornet13-May-09 0:16 
GeneralRe: Loading Resource from dll fails Pin
«_Superman_»13-May-09 0:21
professional«_Superman_»13-May-09 0:21 
GeneralRe: Loading Resource from dll fails Pin
Super Hornet13-May-09 0:22
Super Hornet13-May-09 0:22 
GeneralRe: Loading Resource from dll fails Pin
Super Hornet13-May-09 0:29
Super Hornet13-May-09 0:29 
AnswerRe: Loading Resource from dll fails Pin
Super Hornet13-May-09 1:21
Super Hornet13-May-09 1:21 
AnswerRe: Loading Resource from dll fails Pin
Stuart Dootson13-May-09 0:10
professionalStuart Dootson13-May-09 0:10 
GeneralRe: Loading Resource from dll fails Pin
Super Hornet13-May-09 0:23
Super Hornet13-May-09 0:23 
QuestionNot able to connect to the database Pin
vital_parsley200012-May-09 23:34
vital_parsley200012-May-09 23:34 
I m doing a database application.

in my OnNewDocument() i have the following code..


HRESULT hr;
try
{
AfxMessageBox("Inside try executed.",NULL,MB_OK); //Excecuted
hr = m_pConnection.CreateInstance(__uuidof(Connection));
AfxMessageBox("Created instance executed.",NULL,MB_OK);
if(SUCCEEDED(hr))
{
AfxMessageBox("If hr succeeded.",NULL,MB_OK);//Not Executed
hr = m_pConnection->Open(_bstr_t(L"Provider=sqloledb;Data Source=C:\\Program Files\\Microsoft SQL Server\\MSSQL\\Data\\LibDB.mdf;"),_bstr_t(L""),_bstr_t(L""),adModeUnknown);
if(SUCCEEDED(hr))
{
AfxMessageBox("Open connection executed.",NULL,MB_OK); //not executed
m_pConnection=TRUE;
}
}
AfxMessageBox("out",NULL,MB_OK);
}
catch(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
TRACE( "Exception thrown for classes generated by #import" );
TRACE( "\tCode = %08lx\n", e.Error());
TRACE( "\tCode meaning = %s\n", e.ErrorMessage());
TRACE( "\tSource = %s\n", (LPCTSTR) bstrSource);
TRACE( "\tDescription = %s\n", (LPCTSTR) bstrDescription);
}
catch(...)
{
TRACE( "*** Unhandled Exception ***" );
}
return TRUE;
}

In the above code the if(SUCCEEDED(hr)) block is not executed.What could be the reason ?
AnswerRe: Not able to connect to the database Pin
CPallini12-May-09 23:40
mveCPallini12-May-09 23:40 
AnswerRe: Not able to connect to the database Pin
Madhu Nair12-May-09 23:44
Madhu Nair12-May-09 23:44 
GeneralRe: Not able to connect to the database Pin
vital_parsley200013-May-09 4:19
vital_parsley200013-May-09 4:19 
AnswerRe: Not able to connect to the database Pin
Madhu Nair13-May-09 19:45
Madhu Nair13-May-09 19:45 
AnswerRe: Not able to connect to the database [modified] Pin
Madhu Nair13-May-09 20:03
Madhu Nair13-May-09 20:03 
AnswerRe: Not able to connect to the database Pin
David Crow13-May-09 3:17
David Crow13-May-09 3:17 
QuestionLoad data from database to BCG grid Pin
MrKBA12-May-09 21:56
MrKBA12-May-09 21:56 
AnswerRe: Load data from database to BCG grid Pin
Madhu Nair12-May-09 22:14
Madhu Nair12-May-09 22:14 
GeneralRe: Load data from database to BCG grid Pin
MrKBA12-May-09 22:27
MrKBA12-May-09 22:27 
RantRe: Load data from database to BCG grid Pin
Rajesh R Subramanian12-May-09 22:32
professionalRajesh R Subramanian12-May-09 22:32 
GeneralRe: Load data from database to BCG grid Pin
MrKBA12-May-09 22:37
MrKBA12-May-09 22:37 
GeneralRe: Load data from database to BCG grid Pin
MrKBA13-May-09 22:47
MrKBA13-May-09 22:47 
QuestionAppend BStr Pin
Mogaambo12-May-09 21:23
Mogaambo12-May-09 21:23 
AnswerRe: Append BStr Pin
Madhu Nair12-May-09 21:27
Madhu Nair12-May-09 21:27 
QuestionRe: Append BStr Pin
CPallini12-May-09 21:31
mveCPallini12-May-09 21:31 
AnswerRe: Append BStr Pin
Mogaambo12-May-09 22:26
Mogaambo12-May-09 22:26 
GeneralRe: Append BStr Pin
CPallini12-May-09 22:33
mveCPallini12-May-09 22:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.