Click here to Skip to main content
15,921,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to start with creating Device Drivers Pin
kakan6-Nov-05 19:51
professionalkakan6-Nov-05 19:51 
AnswerRe: How to start with creating Device Drivers Pin
David Crow7-Nov-05 3:01
David Crow7-Nov-05 3:01 
QuestionSystem menu and Notify Icon Menu Pin
Nibu babu thomas6-Nov-05 17:54
Nibu babu thomas6-Nov-05 17:54 
AnswerRe: System menu and Notify Icon Menu Pin
ThatsAlok6-Nov-05 23:57
ThatsAlok6-Nov-05 23:57 
GeneralRe: System menu and Notify Icon Menu Pin
Nibu babu thomas7-Nov-05 0:20
Nibu babu thomas7-Nov-05 0:20 
QuestionDesktop switching Pin
Nishad S6-Nov-05 17:53
Nishad S6-Nov-05 17:53 
Questionnaming the class Pin
Chintoo7236-Nov-05 17:46
Chintoo7236-Nov-05 17:46 
QuestionThird time I am posting please annswer Pin
shivditya6-Nov-05 17:08
shivditya6-Nov-05 17:08 
-----> hr = db.Open(_T("SQLOLEDB.1"), dbinit);
if (FAILED(hr))
{AfxMessageBox("Failed To Connect Datasource"); }

My code is terminating on above line please help.
Actually senior programmer who developed code left for me to debug
help.

Detailed code is below
void OleList::ExecuteQuery(CString str,bool refreshcol,bool fillcheckbox)
{


ptr=new CObArray;
USES_CONVERSION;

CDataSource db;
-----> HRESULT hr = db.Open(_T("SQLOLEDB.1"), dbinit);
if (FAILED(hr))
{
AfxMessageBox("Failed To Connect Datasource");
return;
}

CSession session;
session.Open(db);
int i=0;
CCommand product;
CString temp=GenerateSQL();

LONG row;
char tt[50];
hr=product.Open(session,temp, NULL, &row, DBGUID_DEFAULT, true);
if (FAILED(hr))
{
AfxMessageBox("Failed To Create Table");
return;

}
if(refreshcol)
{
// coltype.RemoveAll();
DBTYPE pType;//=NULL;

for(ULONG j=0;j< product.GetColumnCount() && j < colsize;j++)
if(product.GetColumnType(j+1,&pType))
coltype->SetAt(j,pType);
}
i=0;
if(product.MoveFirst()==S_OK)
do{
CStringArray* sarr=new CStringArray;
sarr->SetSize(colsize);
for(int k=1;k<=colsize;k++)
{
CString st;
switch(coltype->GetAt(k-1))
{
case DBTYPE_STR :
{
char* tm=(char*)product.GetValue(k);
st=A2T(tm);break;
}
case DBTYPE_DBTIMESTAMP : st=GetTime(product.GetValue(k)); break;
case DBTYPE_BOOL : GetBool(product.GetValue(k),&st); break;
case DBTYPE_R4 : GetFloat(product.GetValue(k),&st); break;
case DBTYPE_R8 : GetDouble(product.GetValue(k),&st); break;
case DBTYPE_I4 : GetLong(product.GetValue(k),&st); break;
case DBTYPE_I2 : GetSort(product.GetValue(k),&st); break;
case DBTYPE_UI1 : GetUInt(product.GetValue(k),&st); break;
}
/*if(k==1)
InsertItem(i,st);
else
SetItemText(i,k-1,st);*/
st.TrimRight();
sarr->SetAt(k-1,st);
}
ptr->Add(sarr);
i++;
product.FreeRecordMemory();
}while(product.MoveNext()==S_OK);
if(checkarr!=NULL)
checkarr->RemoveAll();
checkarr=new CWordArray;
checkarr->SetSize(i);
for(int m=0;m checkarr->SetAt(m,fillcheckbox+1);
SetItemCountEx(i);
//char tt[50];
//AfxMessageBox(itoa(i,tt,10));
// SetItemCount(i);
Invalidate();
m_HeaderCtrl.listsize=i;
m_HeaderCtrl.checkarr=checkarr;
product.Close();
session.Close();
db.Close();
m_HeaderCtrl.ptr=ptr;
SetCursor(hcurSave);
}

My code is terminating on above line please help.
Actually senior programmer who developed code left for me to debug
help.

|| ART OF LIVING ||

-- modified at 23:11 Sunday 6th November, 2005
AnswerRe: Third time I am posting please annswer Pin
Christian Graus6-Nov-05 17:38
protectorChristian Graus6-Nov-05 17:38 
QuestionRe: Third time I am posting please annswer Pin
shivditya6-Nov-05 19:25
shivditya6-Nov-05 19:25 
AnswerRe: Third time I am posting please annswer Pin
Christian Graus7-Nov-05 9:01
protectorChristian Graus7-Nov-05 9:01 
AnswerRe: Third time I am posting please annswer Pin
kakan6-Nov-05 19:56
professionalkakan6-Nov-05 19:56 
AnswerRe: Third time I am posting please annswer Pin
David Crow7-Nov-05 3:08
David Crow7-Nov-05 3:08 
Question32 or 16 bit color icons for Visual C++ 6.0 Pin
haputanlas6-Nov-05 13:16
haputanlas6-Nov-05 13:16 
AnswerRe: 32 or 16 bit color icons for Visual C++ 6.0 Pin
LighthouseJ6-Nov-05 17:23
LighthouseJ6-Nov-05 17:23 
GeneralRe: 32 or 16 bit color icons for Visual C++ 6.0 Pin
haputanlas6-Nov-05 19:03
haputanlas6-Nov-05 19:03 
AnswerRe: 32 or 16 bit color icons for Visual C++ 6.0 Pin
ThatsAlok6-Nov-05 17:29
ThatsAlok6-Nov-05 17:29 
AnswerRe: 32 or 16 bit color icons for Visual C++ 6.0 Pin
Taka Muraoka7-Nov-05 0:17
Taka Muraoka7-Nov-05 0:17 
QuestionHBITMAPS and pixels Pin
BBJ_NYC6-Nov-05 9:33
BBJ_NYC6-Nov-05 9:33 
AnswerRe: HBITMAPS and pixels Pin
Ravi Bhavnani6-Nov-05 11:40
professionalRavi Bhavnani6-Nov-05 11:40 
AnswerRe: HBITMAPS and pixels Pin
Christian Graus6-Nov-05 12:01
protectorChristian Graus6-Nov-05 12:01 
GeneralRe: HBITMAPS and pixels Pin
Jörgen Sigvardsson6-Nov-05 12:21
Jörgen Sigvardsson6-Nov-05 12:21 
QuestionIsKindOf detection Pin
LighthouseJ6-Nov-05 7:30
LighthouseJ6-Nov-05 7:30 
AnswerRe: IsKindOf detection Pin
Ravi Bhavnani6-Nov-05 9:22
professionalRavi Bhavnani6-Nov-05 9:22 
AnswerRe: IsKindOf detection Pin
S. Senthil Kumar7-Nov-05 2:22
S. Senthil Kumar7-Nov-05 2:22 

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.