|
Please spell names correctly dear.
Thanks and you are always welcome
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You can go in the resource editor and open the properties window for the dialog. There should be a tab where you can add a title bar and add a minimize and maximize button (don't remember exactly the name of the tabs, so you have to look a little bit by yourself).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
If there is api to delete a directory????
yours faithfully
ajeesh
|
|
|
|
|
|
|
SHFileOperation()
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This will delete a directory and all of its contents:
static BOOL DeleteDirectoryPath(const CString& path)
{
// Function to delete a directory, including the case where
// files and sub-directories exist. Also deletes the name specified,
// if it is actually a file.
WIN32_FIND_DATA find;
HANDLE findHandle;
CString file, filePattern;
DWORD fileAttrib, err;
filePattern = path + "\\*.*";
findHandle = FindFirstFile(filePattern, &find);
while (findHandle != INVALID_HANDLE_VALUE)
{
if ((strcmp(find.cFileName, ".") != 0) && (strcmp(find.cFileName, "..") != 0))
{
file.Format("%s\\%s", path, find.cFileName);
if (find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (! DeleteDirectoryPath(file))
{
return FALSE;
}
}
else
{
SetFileAttributes(file, FILE_ATTRIBUTE_NORMAL); //Prevents some deletion failures
if (! DeleteFile(file))
{
return FALSE;
}
}
}
if (! FindNextFile(findHandle, &find))
break;
}
FindClose(findHandle);
fileAttrib = GetFileAttributes(path);
if (fileAttrib == 0xFFFFFFFF)
{
err = GetLastError();
if (err == ERROR_FILE_NOT_FOUND)
{
return TRUE;
}
else
{
return FALSE;
}
}
else if (fileAttrib & FILE_ATTRIBUTE_DIRECTORY)
{
if (! RemoveDirectory(path))
{
return FALSE;
}
}
else
{
SetFileAttributes(path, FILE_ATTRIBUTE_NORMAL); //Prevents some deletion failures
if (! DeleteFile(path))
{
return FALSE;
}
}
return TRUE;
}
cheers,
Neil
|
|
|
|
|
Hi previously my code is building fine.But now it is showing many errors like
integrator\item.h(52) : error 2039: 'iterator_facade' : is not a member of 'boost'
integrator\item.h(52) : error 2504: 'iterator_facade' : base class undefined
iam using Boost library.
All project setting are ok.
Ur experiance might be so useful for me.
Thank u.
krishna
|
|
|
|
|
Did you include the header file where this class is defined into the source file in which you are using it ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
I have added already
#include "boost.h"
|
|
|
|
|
I suppose iterator_facade is not defined in boost.h. Looking at this page[^], it seems that it is defined in <boost/iterator/iterator_facade.hpp>.
I suggest you read the documentation first, normally, everything should be explained there (I suppose, I never used boost before).
Cédric Moonen
Software developer
Charting control
-- modified at 8:24 Friday 30th June, 2006
I forgote thos godamn < > tags
-- modified at 8:24 Friday 30th June, 2006
|
|
|
|
|
Cedric Moonen wrote: I never used boost before
You should; it takes C++ to a new level. I've learnt a lot about C++ by simply reading the Boost documentation.
Steve
|
|
|
|
|
Stephen Hewitt wrote: You should
Yes I know. I plan to do that when I have a little more spare time (which I don't know when )
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hi
how to hide/show a button from dialog in Win32 Application.
Manjunath S
GESL
Bangalore
|
|
|
|
|
|
Try:
MyButton.ShowWindow(SW_HIDE);
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hide:
ShowWindow(GetDlgItem(hWndDlg, ButtonID), SW_HIDE);
show:
ShowWindow(GetDlgItem(hWndDlg, ButtonID), SW_SHOW);
|
|
|
|
|
HI,
My applicaion is using CPU value 99 in task manager, that makes makes the machine slow,
How can i reduce the cpu usage , or how can i detect which part is gettting more cpu.
Thanks
Regards.Hi,
|
|
|
|
|
If you don't provide more info, we won't be able to help. It's not by reposting the same question twice without more details that you will get an answer.
First, try to locate where to problem comes from. What are you doing continuously that take so much time ? Once you located that, you can still put some sleep in it to free some CPU time (not very elegant but works).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Can you be more specific
whitesky
|
|
|
|
|
Most likely cause is a for or while loop that does not end because there is a bad value of a variable or wrong assumption in the code somewhere
cheers,
Neil
|
|
|
|
|
Hi,
I am writing a DLL that links dynamically to MFC. I am having a serious problem with threads; when I create a thread using AfxBeginThread, the thread process fails.
After examining with the debugger, it seems that the data I pass to the thread (a void*, which in my case is a pointer to a CObject* derived class) is being corrupted; calling ASSERT_KINDOF on the object fails (the actual failure is that internally the object cannot call GetRuntimeClass) and skipping ASSERT_KINDOF and simply calling a function of the class fails.
It seems the object's virtual function table is being problematic. At the beginning of every possible relevant function I have used AFX_MANAGE_STATE(AfxGetStaticModuleState()); to see if this helps. It doesn't.
Is there an in-built limitation to threading like this in DLLs? BTW this is not an MFC extension DLL, just a dll that dynamically links to MFC.
I have a big deadline approaching and any help would be enormously appreciated!
Thanks in advance!
Dave Kerr
|
|
|
|
|
|
CreateThread gives exactly the same problem. I am convinced it is a memory issue. The first part of the thread process is:
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// Cast the data.
CThreadFunction* pFunction = reinterpret_cast<cthreadfunction*>(pData);
// Assert it is the correct type.
ASSERT_KINDOF(CThreadFunction, pFunction);
// Do the work.
UINT uError = pFunction->DoFunction();
...
However when I examine pFunction in the memory window, the memory looks to be " .Anywhere.dll _AFX_MANAGE_STATE.." so the pointer is definately not pointing to the correct address.
Any ideas?
Dave Kerr
codechamber@hotmail.com
http://www.codechamber.com
|
|
|
|
|
hi all
plz tell me how can i place a picture
(image ) on buton control in
mfc dialog bsed application
plz send some example
Ashish Dogra
MCA
Noida
|
|
|
|