|
How could i distinguish a DVD-RAM from a flash memory card
(both are Removable storage drives)
in runtime?
|
|
|
|
|
I hope "GetDriveType" API will return
DRIVE_RAMDISK for DVD-RAM Disk and
DRIVE_REMOVABLE for Removeable Drive.
Thanks & Rgds,
Sri..
|
|
|
|
|
Hai,
Good Evening....
I was working with the controls of textbox i have a doubt in that can anyone
clear it....
I created a form in MFC by having various controls.
1.In that i have a textbox in which iam entering some values.
2.I want that value to be printed in the message box...
Can anyone please tell me how to do....
Thanks
Harshadha
|
|
|
|
|
You have a editbox CEdit m_EDit; and it has values "12345" now you want to show these values use of m_Edit1.GetWindowText();
|
|
|
|
|
hai,
i cant understand ..
Iam passing values to the editbox in run time ,then if i click a command button iam displaying a messagebox,where i want these value to be shown...
Harshadha
|
|
|
|
|
Use the text got by m_Edit1.GetWindowText(); with the MessageBox method...
|
|
|
|
|
When click button use of
CEdit m_Edit;
CString str;
m_Edit.GetWindowText(str);
MessageBox(str);
And if you want to set a value dynamicly for editbox use of SetWindowText
|
|
|
|
|
Use WM_KILLFOCUS for your text box and get the text using GetWindowText . I hope this is you want.
|
|
|
|
|
Hai,,
I cant really understand i brief my question..
Iam entering the values in edit box during runtime and displaying it...
CEdit m_ce;
m_ce.GetWindowText();
TCHAR szMsg[256];
wsprintf(szMsg,_T("hEIGHT: %ld "),m_ce);
MessageBox(szMsg,NULL,MB_OK);
error C2661: 'GetWindowTextA' : no overloaded function takes 0 parameters
Thanks For Spending Your Precious Time
Harshadha
|
|
|
|
|
int GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const;<br />
void GetWindowText( CString& rString ) const;
Use as below
CEdit m_ce; <br />
CString str;<br />
m_ce.GetWindowText(str);<br />
TCHAR szMsg[256];<br />
long lValue = _ttol((LPCTSTR)str);<br />
wsprintf(szMsg,_T("hEIGHT: %ld "),lValue);<br />
MessageBox(szMsg,NULL,MB_OK);
-- modified at 6:26 Thursday 8th March, 2007
|
|
|
|
|
Hai,
Iam sorry for troubling you again but iam getting memory error like asking
whether to retry or abort...
If i click ignore its displaying msgbox with 0 in it..
Thanks
Harshadha
|
|
|
|
|
have you done validation on the text box like the input is only numeric value and not alphabet nor alphanumeric...
|
|
|
|
|
|
Hi,
I think u havent created a member variable for the editbox. Simply you would have written like
CEdit m_ce;
It ll not work out.
First you need to create a member variable for the edit box using class wizard with the control type as Edit.
say, the member variable is m_editChar. then,
CString str;
m_editChar.GetWindowText(str);
MessageBox(str);
now, the str ll give u the value entered by the user in the edit box.
Hope this ll solve your problem.
Thanks & Rgds,
Sri..
|
|
|
|
|
|
I wrote for you an exmaple and also GetWindowText needs to a parameter for hold values
|
|
|
|
|
harshadha wrote:
TCHAR szMsg[256];
wsprintf(szMsg,_T("hEIGHT: %ld "),m_ce);
So then why are not using CString with your MFC application?
harshadha wrote: MessageBox(szMsg,NULL,MB_OK);
Consider using AfxMessageBox() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hai,
Thanks a lot to all...
i got the output....
Harshadha
|
|
|
|
|
I hope you got your answer with best way
|
|
|
|
|
Hi,
If iknow the filename and its path i hould be able to open and display that file.if any ideas on how to do it please let me know..
harsha
|
|
|
|
|
Which? Open a file or get path of a file?
|
|
|
|
|
i should be able to open and display the contents to the user ..
harsha
|
|
|
|
|
|
Have you tried the following:
Open File
HANDLE CreateFile(
LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile
);
Read Contents:
BOOL ReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);
Read File[^]
Open File[^]
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
i dont want to read or open or create a file.. i want to display a file to the user say when user clicks a button. will this help in that regard ?
harsha
|
|
|
|