|
kiran.pinjarla wrote: Is there any api with which we can show a folder selecting dialog
(like CFileDialog)?
Hope this[^] helps.
|
|
|
|
|
Thank you both of u.
Thank you so much.
KIRAN PINJARLA
|
|
|
|
|
hi
i need to found out the free spaces there in ausb disk?is there any MFC function or API for that....
thanx in advance
birajendu
CyberG India
Delhi
India
|
|
|
|
|
Hi,
BOOL GetDiskFreeSpaceEx(
LPCTSTR lpDirectoryName,
PULARGE_INTEGER lpFreeBytesAvailable,
PULARGE_INTEGER lpTotalNumberOfBytes,
PULARGE_INTEGER lpTotalNumberOfFreeBytes
);
-----------
Mila
|
|
|
|
|
thanx a lot....
birajendu
CyberG India
Delhi
India
|
|
|
|
|
|
Hi
i am working on BackUp module can anybody help me out on it?
i want backup fundamental policy and simple application
Thanks & Regards
rakesh baldha
|
|
|
|
|
Hi,
I want to run a new instance of EXCEL.EXE from my code (if there is already one running) in VC++ .
I am using Visual Studio 7.0 ..and then i need to attach my process to that new instance of EXCEL.EXE..
please help
Regards,
Prashant
|
|
|
|
|
Do you want to run excel of your program?
|
|
|
|
|
yes, i need to create a new instance of excel for my project if there is already any instance running . And also i have to keep the new instance embedded in my project .
Please suggest if u have some idea .
Thanks for ur intrest !
|
|
|
|
|
Hi all
I have a Bitmap which is drawn over a dialog box. This bitmap is drawn over several buttons so that buttons are not visible. If I change the DPI of screen from 96 to 120 then the dialog box appears big and buttons are properly redrawn with increased size. But the bitmap is not drawn in the centre of the dialog. The code is given below . Please help me !
Bitmap.LoadBitmap(iIdBmp);
hBitmap = (HBITMAP)Bitmap;
GetObject(hBitmap, sizeof(BITMAP), &bm);
HDC hDC = GetDC(hDlg);
HDC hMemDC = CreateCompatibleDC(hDC);
SelectObject(hMemDC, hBitmap);
hRef = GetDlgItem(hDlg, iIdMap);
if(hRef != NULL)
{
POINT ptTopLeft;
POINT ptBottomRight;
GetWindowRect(hRef, &Rect);
ptTopLeft.x=Rect.left;
ptTopLeft.y=Rect.top;
ptBottomRight.x=Rect.right;
ptBottomRight.y=Rect.bottom;
ScreenToClient(hDlg,&ptTopLeft);
ScreenToClient(hDlg,&ptBottomRight);
StretchBlt(hDC, ptTopLeft.x,
ptTopLeft.y,
(long)(Rect.right-Rect.left),
(long)(Rect.bottom-Rect.top),
hMemDC,
0, 0,
bm.bmWidth,
bm.bmHeight,
SRCCOPY);
}
DeleteDC(hMemDC);
ReleaseDC(hDlg, hDC);
redindian
|
|
|
|
|
You said if you change 96 to 120 dialog box is appears big but bitmap no where you use this code
|
|
|
|
|
Hi all,
can anybody provide me link of Backup fundamental policy with application?.
i want all policy like full, incremental,differential backup policy with simple application.
Thanks & Regards
rakesh baldha
|
|
|
|
|
Hi,
I am creating an Excel File from my MFC project. In my project, am using CDatabase class to execute SQL statements.
In the below piece of code, database refers CDatabase object, and sSal is a string.
I have created the table name "Pin_List" already. After creating i need to sort the data according to the column named "DUT_PIN". For that, i used the following lines of code.
But still the output data is not sorted. How to do it..? Is there any error in the following..?
sSql = "SELECT NET_NAME,DUT_PIN,TESTER_CHANNEL,TRACE_LENGTH FROM Pin_List ORDER BY 3";
database.ExecuteSQL(sSql);
With Regards,
Sangeetha.
|
|
|
|
|
Hi,
Sorry i have typed "ORDER BY 3" instead of "ORDER BY 2". I corrected in this. Still the sorting is not working.
sSql = "SELECT NET_NAME,DUT_PIN,TESTER_CHANNEL,TRACE_LENGTH FROM Pin_List ORDER BY 2";
database.ExecuteSQL(sSql);
With Regards,
Sangeetha.
With Regards,
Sangeetha.
|
|
|
|
|
Hi Sangeetha,
You cannot use CDatabase::ExecuteSQL for SELECT query. It is only for action query like UPDATE, DELETE and INSERT.
You need a CRecordset object to get the result of a SELECT query.
|
|
|
|
|
Hi Ismail,
Can you tell how to use it..?
CRecordset* record;
record = new CRecordset(&database);
record -> m_strSort = "DUT_PIN ASC";
record -> Open(CRecordset::snapshot, "Pin_List");
recset -> Close();
I used the codings above. But error is coming..
With Regards,
Sangeetha.
|
|
|
|
|
|
WhiteSky, the error is coming while the control goes to BuildSelectSQL() function of CRecordset class. While its coming to the ASSERT(m_nFields != 0) line, its showing the Abort, Retry, Cancel message.
With Regards,
Sangeetha.
|
|
|
|
|
CFileDialog MyFileDialog( FALSE, _T("xls"), NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY, _T("Access Files (*.xls)|*.xls|(*.xls)|*.xls|all files(*.*)|*.xls||"),this);
MyFileDialog.m_ofn.lpstrTitle = "Save As";
if(MyFileDialog.DoModal() == IDOK)
{
FileName = MyFileDialog.GetPathName();
}
CDatabase database;
CString sDriver = "MICROSOFT EXCEL DRIVER (*.XLS)"; // exactly the same name as in the ODBC-Manager
CString sExcelFile = FileName;
CString sSql;
CString str1;
TRY
{
// Build the creation string for access without DSN
sSql.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s", sDriver,sExcelFile,sExcelFile);
// Create the database (i.e. Excel sheet)
if( database.OpenEx(sSql,CDatabase::noOdbcDialog) )
{
// Create table structure
float j;
CPinListSet1* recset;
recset = new CPinListSet1(&database);
recset->Open(NULL,NULL,NULL,"'TABLE','SYSTEM TABLE'",CRecordset::snapshot);
CString TableName, sSql;
TableName = "\0";
if(!recset -> IsEOF())
{
recset->MoveFirst();
while(!recset->IsEOF())
{
TableName = "[" + recset->m_strTableName + "]";
recset->MoveNext();
}
}
recset->Close();
if(TableName == "[Pin_List]")
{
sSql = "DROP TABLE Pin_List";
database.ExecuteSQL(sSql);
}
sSql = "CREATE TABLE Pin_List (NET_NAME TEXT,DUT_PIN TEXT,TESTER_CHANNEL TEXT,TRACE_LENGTH float)";
database.ExecuteSQL(sSql);
int ResultSize = aResult_Array.GetSize();
for(int i = 0; i < ResultSize; i++)
{
CResult* Result = (CResult*) aResult_Array.GetAt(i);
// Insert data
CString Sql("INSERT INTO Pin_List (NET_NAME,DUT_PIN,TESTER_CHANNEL,TRACE_LENGTH) VALUES (");
Sql = Sql;
str1 = Result -> NetName;
Sql = Sql + "'" + str1 + "',";
str1 = Result -> DutName;
Sql = Sql + "'" + str1 + "',";
str1 = Result -> TesterName;
if( (ExportUnit == INCH) || (ExportUnit == MM) )
Sql = Sql + "'" + str1 + "'," + "%.4f)";
else
Sql = Sql + "'" + str1 + "'," + "%.2f)";
j = (float) (Result -> TraceLength * Factor);
sSql.Format(Sql,j);
database.ExecuteSQL(sSql);
}
CRecordset* record;
record = new CRecordset(&database);
record -> Close();
record -> m_strSort = "DUT_PIN ASC";
record -> Open(CRecordset::snapshot, "Pin_List");
UpdateData(FALSE);
}
// Close database
if(database.IsOpen())
database.Close();
}
CATCH_ALL(e)
{
TRACE1("Driver not installed: %s",sDriver);
}
END_CATCH_ALL;
The above are the coding lines i used to create the excel file.
With Regards,
Sangeetha.
|
|
|
|
|
Hi Whitesky,
Why no reply from you..?
Sangeetha.
|
|
|
|
|
Your error is in this line recset->Open(NULL,NULL,NULL,"'TABLE','SYSTEM TABLE'",CRecordset::snapshot); ,right?
|
|
|
|
|
No Whitesky.. That recset instance is of one more derived class's instance.. My error is in the line,
record -> Open(CRecordset::snapshot, "Pin_List");
No problem in creating the excel sheet.. Its getting created.. But when i am trying to sort through the CRecorset's object, i am getting the error, Whitesky.
Thank you a lot for finding out this thread and replying..
Thank you very much.
With Regards,
Sangeetha.
|
|
|
|
|
Expecting the reply..
With Regards,
Sangeetha.
|
|
|
|
|
You dont need to say Thank you.I am here for help to people .I run your code and I saw that your problem was in the line that you want to open recset->Open(NULL,...) and this error was on two parameter that needs to a statement sql for example recset->Open(NULL,"Select * from a"); in previous thread you said you got ASSERT(m_nFields != 0) and I checked for it but for this problem did you use of debugger for see error
|
|
|
|
|