Click here to Skip to main content
15,917,652 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to calculate the monitor size ? Pin
David Crow4-Nov-05 4:54
David Crow4-Nov-05 4:54 
AnswerRe: How to calculate the monitor size ? Pin
vikas amin4-Nov-05 19:29
vikas amin4-Nov-05 19:29 
AnswerRe: How to calculate the monitor size ? Pin
ThatsAlok6-Nov-05 21:08
ThatsAlok6-Nov-05 21:08 
QuestionHow to calculate the monitor size ? Pin
pradish4-Nov-05 0:47
pradish4-Nov-05 0:47 
AnswerRe: How to calculate the monitor size ? Pin
vikas amin4-Nov-05 2:01
vikas amin4-Nov-05 2:01 
QuestionERROR please help Pin
shivditya4-Nov-05 0:27
shivditya4-Nov-05 0:27 
AnswerRe: ERROR please help Pin
vikas amin4-Nov-05 2:06
vikas amin4-Nov-05 2:06 
GeneralRe: ERROR please help Pin
shivditya4-Nov-05 2:43
shivditya4-Nov-05 2:43 
yes I am trying to connect to database but its name is not
sqloledb. There is lot description of this word in msdn.
but i didnot understood.Anyway this type of connectivity he has used at
another place successfully but here it is giving error

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<cdynamicaccessor> 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<i;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);
}

|| ART OF LIVING ||
QuestionPLEASE HELP ME OUT?????????? Pin
shivditya4-Nov-05 3:48
shivditya4-Nov-05 3:48 
QuestionRe: ERROR please help Pin
David Crow4-Nov-05 5:06
David Crow4-Nov-05 5:06 
QuestionRe: ERROR please help Pin
shivditya4-Nov-05 18:32
shivditya4-Nov-05 18:32 
QuestionRe: ERROR please help Pin
David Crow6-Nov-05 2:41
David Crow6-Nov-05 2:41 
Questionchange the format of media file Pin
vineet singh3-Nov-05 23:19
vineet singh3-Nov-05 23:19 
AnswerRe: change the format of media file Pin
Blake Miller4-Nov-05 10:51
Blake Miller4-Nov-05 10:51 
QuestionVC++ Pin
inew3-Nov-05 22:30
inew3-Nov-05 22:30 
AnswerRe: VC++ Pin
Rob Caldecott3-Nov-05 22:33
Rob Caldecott3-Nov-05 22:33 
AnswerRe: VC++ Pin
vikas amin4-Nov-05 1:41
vikas amin4-Nov-05 1:41 
AnswerRe: VC++ Pin
ThatsAlok6-Nov-05 21:22
ThatsAlok6-Nov-05 21:22 
Question&quot;Got Focus&quot; on a tab page Pin
Ger Hayden3-Nov-05 22:02
Ger Hayden3-Nov-05 22:02 
AnswerRe: &amp;quot;Got Focus&amp;quot; on a tab page Pin
Barm3-Nov-05 22:15
Barm3-Nov-05 22:15 
GeneralRe: &amp;amp;quot;Got Focus&amp;amp;quot; on a tab page Pin
vikas amin4-Nov-05 2:14
vikas amin4-Nov-05 2:14 
GeneralRe: &amp;amp;quot;Got Focus&amp;amp;quot; on a tab page Pin
Ger Hayden4-Nov-05 4:17
Ger Hayden4-Nov-05 4:17 
AnswerRe: &amp;quot;Got Focus&amp;quot; on a tab page Pin
David Crow4-Nov-05 5:08
David Crow4-Nov-05 5:08 
QuestionHelp!!! Pin
friendly man3-Nov-05 21:48
friendly man3-Nov-05 21:48 
Questiontotally confused about UINT_PTR Pin
Saurabh.Garg3-Nov-05 21:46
Saurabh.Garg3-Nov-05 21:46 

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.