|
overwriting with some random values to all size of file.
|
|
|
|
|
Hi,
I have to display the Hard Disk free space in the Edit box, can anyone plz tell what function we have to use for calculating Hard disk free space and didplaying it in a edit box in read only mode.
Regards,
Parichay.
|
|
|
|
|
Hi,
BOOL GetDiskFreeSpaceEx(
LPCTSTR lpDirectoryName,
PULARGE_INTEGER lpFreeBytesAvailable,
PULARGE_INTEGER lpTotalNumberOfBytes,
PULARGE_INTEGER lpTotalNumberOfFreeBytes
);
where:
lpDirectoryName - Pointer to a null-terminated string that specifies a directory on the disk of interest. If this parameter is NULL, the function uses the root of the current disk.
You can use i.e.:
std::stringstream sstr;
sstr << lpTotalNumberOfFreeBytes << _T( " bytes" );
SetWindowText( hWnd, sstr.str().c_str() );
where hWnd is a handle to editbox window.
-----------
Mila
|
|
|
|
|
Hi Mila,
Thank u very much for the reply.
Now i have edit box by name IDC_SPACE , i want to know how to display the output in edit box.
it should show the free space when the dialog box is loaded.
how to use hwnd ??
|
|
|
|
|
Use the SendMessage() or SendDlgItemMessage() function passing along the text you want to enter as the lParam and WM_SETTEXT as the message.
|
|
|
|
|
Hi,
Can u please tell me how to use the space calculating function and where the code should be placed so that wehn dialog window loads edit box should have free space calculated.
|
|
|
|
|
So if project is MFC you can do:
std::stringstream sstr;
sstr << lpTotalNumberOfFreeBytes << _T( " bytes" );
GetDlgItem( IDC_SPACE )->SetWindowText( sstr.str().c_str() );
-----------
Mila
|
|
|
|
|
write the code of GetDiskFreeSpaceEx in OnInitDialog Of that particular dialog.
And show it in edit boxes using SetDlgItemText API.
Mahesh Kulkarni
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
|
check with GetVolumeInformation(...) Api to get the HardDisk Info.
cheers,
uday.
uday kiran
|
|
|
|
|
Exactly how can GetVolumeInformation() be used to get the hard disk free space?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi friends,
I use above class and CDaoRecordset for writing into xls file. I set one button. on button event, i write following code
CString Sql,Name,Addr;
GetDlgItemText(IDC_NAME,Name);
GetDlgItemText(IDC_ADDRESS,Addr);
db.Open("Pis.xls");
Sql = "SELECT * FROM Pis";
recset.Open(CRecordset::forwardOnly,Sql,NULL);
recset.AddNew();
recset.SetFieldValue("Name",(LPCSTR)Name);
recset.SetFieldValue("Addr",(LPCSTR)Addr);
recset.Update();
recset.Close();
db.Close();
}
when I enter name and address and click on button, error message come
could'nt open database. unrecognise database format
friend kindly give me a reply. why i am not able to write and read data from xls
Regards
kedar
Girish
Software Developer
|
|
|
|
|
did you specify the pis.xls path correctly? pls check the path of the xls file i mean db.open("path\\pis.xls") give path correctly and i hope it works correctly.
cheers,
uday.
uday kiran
|
|
|
|
|
I have added a new interface(using dispinterface) in odl file. Now how do I check whether the activex control register has the new interface or not. ?
Will "AfxOleRegisterTypeLib" will register all the interfaces existing in the library ? What if old library is register and I am to use new methods in new interfaces ?
Any help on it.
Best Regards,
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
- Bjarne Stroustrup
|
|
|
|
|
hi,
i want to send a singnal to another application thru socket and make a video(mpeg) file play.. wat r the steps i need to do to play the file
there is always a tomorrow
|
|
|
|
|
When the another application receives the signal, use ShellExecute function
nave
|
|
|
|
|
i'm a beginner,can u elaborate on that please..
there is always a tomorrow
|
|
|
|
|
I said the process to start playing a file after the second application have got the signal for the same( I think u have accomplished that task. isn't it? )
So when ur application receive the signal, use the ShellExecute api.See the help..
ShellExecute(NULL,_T("open"),"wmplayer.exe",csPath,NULL,SW_SHOW);
here the csPath should specify the path of file to play
nave
|
|
|
|
|
hi naveen,
thanks. i was able to open the wmplayer using ur code. the file does not play automatically. i gave full path of the file.. anyway i'll try it out.
there is always a tomorrow
|
|
|
|
|
i tried it out.. Its working here...I hope the problem is with the path u give.
if u r giving a path hard code in the program, Please note the point marked bold below ..
ShellExecute(NULL,_T("open"),"wmplayer.exe","c:\film\cut1.mpg",NULL,SW_SHOW); // will not work
ShellExecute(NULL,_T("open"),"wmplayer.exe","c:\\film\\cut1.mpg",NULL,SW_SHOW); // will work
good luck
nave
|
|
|
|
|
hi,
thank u so much its working
there is always a tomorrow
|
|
|
|
|
Hi,
Currently I am working on the printing issues.To break a lengthy string into multiple lines I am using DT_WORDBREAK.It works fine when the string contains spaces.But the problem arises when the string contains no spaces.When the string contains no spaces and if DT_WORDBREAK is used.....the string is getting clipped.Is there any way to overcome this problem still using the DT_WORDBREAK or is there any other alternative.
Taruni
|
|
|
|
|
add DT_EDITCONTROL style also
nave
|
|
|
|
|
What is the difference b/w function overloading and function overriding??
|
|
|
|
|
Function overloading: it is when you have two function with the same name but different arguments in the same scope. For example:
void Func1(int, int);
void Func1(float, float);
Depending of the type of the arguments that will be supplied to the function, the corresponding one will be called.
Function overriding: it is when you have a base class that defines a function and this function is redefined in an inherited class. This is usefull for providing a different behavior between the base and the child class.
|
|
|
|