|
Probably its working correct.
Instead of message box, use some other method. Like writing message to a file.
B'coz invokation of message box will coz loosing focus of second edit box.
Try following code in killfocus handlers of respective edit boxes
FILE *fp=NULL;
fp=fopen("test.txt","a+");
char ch[]="OnKillfocusEdit1";
fwrite(ch,1,sizeof(ch),fp);
fclose(fp);
|
|
|
|
|
You'll need to show us both methods.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi Gurus,
I want to retrieve the sub directory names from a directory. I dont want the file names if any are present. Presented below is code I am working on. However FindFileData.cFileName is giving only the first letter of the directory. How do I correct this? Since I have to use the code for productions, any corrections or better sample code will be most welcome.
void GetSubFolderNames( LPCTSTR szFolderPath )
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind = INVALID_HANDLE_VALUE;
DWORD dwError;
hFind = FindFirstFile(szFolderPath, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
printf ("Invalid file handle. Error is %u\n", GetLastError());
return (-1);
}
else
{
do
{
if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if ( !lstrcmp( FindFileData.cFileName, L"." )
|| !lstrcmp( FindFileData.cFileName, L".."))
{
//Do nothing for "." and ".." folders
}
else
{
CString fileName = FindFileData.cFileName;
printf ("First file name is %s\n", fileName);
}
}
} while (FindNextFile(hFind, &FindFileData) != 0) ;
dwError = GetLastError();
FindClose(hFind);
if (dwError != ERROR_NO_MORE_FILES)
{
printf ("FindNextFile error. Error is %u\n", dwError);
return (-1);
}
}
return (0);
}
Thanks
C++beginer
|
|
|
|
|
Use CFileFind
Jubin Almighty
braindrain1@rediffmail.com
-----------------------------
Come online at:-
fitiyal@yahoo.com
|
|
|
|
|
SADirRead[^] class is perfect for what you need...
|
|
|
|
|
ashokvishnu wrote:
CString fileName = FindFileData.cFileName;
strange you getting problem here! try CString construtor!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
So are you using Unicode or not? If so, then try:
printf("First file name is %S\n", (LPCTSTR) fileName);
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
where's my coffee ?
did you right click in the resource editor and tried the "add new toolbar resource" ?
|
|
|
|
|
i want i want i want...
did you see here[^] ?
|
|
|
|
|
Your answer is important(i remember one thing,Did you remember your answer (the question was please share your information with me and you said one answer like this)
|
|
|
|
|
i don't remember all...lol
i post too mch
|
|
|
|
|
me too but i remember posts
|
|
|
|
|
toxcct wrote: i want i want i want...
I want i want
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
while(1) print("i want ");
|
|
|
|
|
toxcct wrote: while(1) print("i want ");
he he he
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
if you want to how to create a toolbar its simple you can create a single document or Multiple documents(MainFrm.cpp)
|
|
|
|
|
hi all,
Can anyone please tell me how to create a property sheet application.
|
|
|
|
|
Start a Dialog based project.
Take the Project->Add to Project->Components and Controls
open the VC++ components folder->Property Sheet.
Click insert button and then Close button. A property shet will be inserted in ur dialog
nave
|
|
|
|
|
hi,
I have inserted the Property Sheet,but the Apply button is not getting enabled.What should i do.
|
|
|
|
|
for the apply button to get enable, u must call
SetModified(TRUE); of the coresponding page
nave
|
|
|
|
|
|
Hi Naveen,
In my PropertySheet i have 3 pages and each page is having a text box.Now i want to store these text box values into a file on pressing the apply button.
What should i do in "CMyPropertySheet::OnApply()" method.Could u kindly help.
|
|
|
|
|
|