|
#include <io.h>
inline bool dir_exists(const char* str)
{
return _access(str,0)==0;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
This way works pretty well, and handles the odd case where the "directory" is really a file:
bool DoesDirectoryExist(LPCTSTR inputPath)
{
bool bRet = false;
DWORD dwRc = ::GetFileAttributes(inputPath);
if (dwRc == 0xFFFFFFFF)
{
bRet = false;
} else if(dwRc & FILE_ATTRIBUTE_DIRECTORY)
{
bRet = true;
} else
{
bRet = false;
}
return bRet;
}
Even a broken clock is right twice a day.
|
|
|
|
|
hai,
We customized the default open dialog by deriving the class from
cfiledialog . These are the issues that we faced.
Issues:
1. How to handle the default messages in cfiledialog class?
2. In Win'2000 & above, we tried to change the listview style to
LVS_REPORT using Modifystyle method The style is changed, but the files and
column headers are not displayed.
3. In Win'98, how to remove the separator in toolbarwindow32.
Please give me the solution as early as possible.
sureshb
sujtha
|
|
|
|
|
|
Is there any samples/articles describing the MS Excel automation(using MFC),i want to read the data from an excel sheet and put something in to that also.
Thanks In Advance
~~~~Code the Dreams~~~~~
|
|
|
|
|
|
|
ThankYou Kannan...
~~~~Code the Dreams~~~~~
|
|
|
|
|
I have written a composite control which have many sub-controls such as button ,grid ,list ,but i have a problem with it. When i use the control in the dialog-based application , the control is not visible ( we can't see the button and grid etc. on it) in the design mode . Because i create the sub-controls in the control's WM_CREATE message response function. I want it can be seen in the design mode , how can i do? I search the msdn for some message, it has a article about the similar problem , but i can't understand it. Who can help me? I wish the master about the activex programming can give me a hand ,and i'll thank you very much!
|
|
|
|
|
This is due to the dialog editor not actually creating your control. It just puts in a placeholder and calls the OnPaint() of your control. You will have to plot the additional windows yourself in your OnPaint() handler. You can tell when you need to do this as the ActiveX controls m_hWnd member will be NULL. Your control will not actually receive an WM_CREATE until it is used in a dialog for real, so in effect until this time it upto you to draw the correct output.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
How can I accomplish this? Will it reuiqre nested loops?
Can someone show me code on how to accomplish this?
Thanks!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
You can use this to traverse the tree!
HTREEITEM hItem = GetRootItem();
while(hItem)
{
hItem = GetNextTreeItem(hItem);
}
HTREEITEM C3StateTree::GetNextItem(HTREEITEM hItem)
{
HTREEITEM hti = NULL;
if (ItemHasChildren(hItem))
hti = GetChildItem(hItem);
if (hti == NULL)
{
while ((hti = GetNextSiblingItem(hItem)) == NULL)
{
if ((hItem = GetParentItem(hItem)) == NULL)
return NULL;
}
}
return hti;
}
Arjan.
|
|
|
|
|
Thanks, this was driving me nutts. I appreciate it!!!
Cheers
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
hi all,
i want to create tabbed dialogs for my application. can anyone help me out please. thanks a lot..
himanshu
|
|
|
|
|
Hello,
You might want to check this out. http://codeguru.earthweb.com/propertysheet/inside_dialog.shtml
Rob
|
|
|
|
|
dear all,
i want my mfc dialog app not to appear in tasks list in close program dialog if someone hits ctrl+alt+del.
how to do this.
this should happen for all windows platform 98, nt, 2k, xp
can anyone post some code or show me links for the same
thanx
wishing all of u a very happy new year!
|
|
|
|
|
If you want to write a Virus or Worm, you have come to quite a wrong place.
Now please piss off.
I was told by a CP participant that including "plase" was good.
|
|
|
|
|
hide the dialog, then it will not be in tasks list.
try!!
|
|
|
|
|
my app is a dlg based one & its already hidden. Only an icon is visible at notification area, which on dblclick opens the dlg.
|
|
|
|
|
I want to find out that how much memory my program is consuming at certain point of execution. How can i find it ???? Actualy the application i developed, is multithreaded and at many occasions, memory is selected from the heap and returned back. I want to find out that how much memory (complete i.e stack+ heap+ etc ) is under consumption by my program. Plesae tell me ???
Note: I want to build this feature inside my application..for example SQL server can tell us that how much resources it is currently consuming. I asked this question last night and someone answered me to look at windows task manager I repeat again that I want to build this feature inside my application
|
|
|
|
|
Iterate the heaps of your app (HeapWalk) and check their usage. As for stack, you'd have to record starting stack for every thread your app creates and... Better just stick to heapwalk I believe.
For a total check, what about GetWorkingSetSize?
|
|
|
|
|
I have with no succes so i'm hoping you can maybe help me out!!!
How do you clear the selection on a CTreeCtrl in-place edit control? I tried inside OnBeginlabeledit() but had no success, perhaps the framework selects test after this call or i'm maybe...totally wrong
Perhaps i called the function wrong
SetSel(0,0);
Any help???
Thanks!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
the correct form is
SetSel(-1,0);
call this function, current selection will be removed
have a try!
good luck
|
|
|
|
|
Actually...it didn't work...
Any ideas???
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
dear all,
i have an mfc app which starts a thread and executes exe files in the thread at specified times using CreateProcess(...) function.
i use TerminateProcess() to terminate those processes.
Everything is working fine.
i know that ExitProcess() is a better way to terminate a proceess, but when i use
ExitProcess(GetLastError()); the processes do not terminate.
how do i terminate my sub processes using ExitProcess()?
is it safe to use TerminateProcess() b'coz its seems to be working fine.
thanx
Happy New Year.
|
|
|
|