|
Since when is saying thanks worthy of a '1' vote?
|
|
|
|
|
Do note that this parameter is useless for all practical purposes.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I occasionally use it in logging data if I'm tracking what various threads are doing. It's a little easier on the eyes than using the thread handle.
Judy
|
|
|
|
|
Hello,
I have a problem with opening a view, while opening a document (MDI).
What i do is I have a configuration file and when i read it, i can open a debug view (richtextview) and see the details about the configuration. I can import as many as configuration files i want. I can also open a document attached with a configuration file, but cannot open the debug view .
BOOL Test::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
CMainFrame* mainWnd = (CMainFrame*)AfxGetMainWnd();
mainWnd->OnNewwindowDebugwindow();
Log().inform("Hello !",getDebugWindow());
}
In above code, the mainframe creates a debug window, and getDebugWindow() just finds the debug view if there is any, and in the OpenDocument, it always returns NULL. the question is how i can create a view while opening a document?
CDebugWindow* Test::getDebugWindow()
{
if(debugWindow==0)
{
POSITION pos = GetFirstViewPosition();
CView* pView=0;
bool found=false;
while (pos != NULL)
{
pView = GetNextView(pos);
if(pView->IsKindOf(RUNTIME_CLASS(CDebugWindow)))
{
found=true;
break;
}
}
if(found)
{
debugWindow = (CDebugWindow*) pView;
return debugWindow;
}
else
return 0;
}
else
return debugWindow;
}
Thanks in advance.
Bekir.
|
|
|
|
|
Hello, I have a weird problem regarding the deleting of a folder.
I'm trying to delete a folder using this code
TCHAR exeDirectory[MAX_PATH];
GetCurrentDirectory(sizeof(exeDirecotry) - 1, exeDirectory);
CString szStoreFolder;
szStoreFolder.Format(_T("%s\\td10"),exeDirectory);
......
SHFILEOPSTRUCT op;
op.pFrom = szFolderName;
op.wFunc = FO_DELETE;
op.fFlags = FOF_SILENT | FOF_NOCONFIRMATION;
op.fAnyOperationsAborted = false;
op.hNameMappings = NULL;
int er= SHFileOperation(&op);
_tprintf(_T("Eroare %d "),er);
The problem is that it doesn't work every time.
It depends on the exeDirectory name and on the folder name (the folder that I'm trying to delete)
For instance if the exeDirectory is TEST and the folder name is Td10 it doesn't work. If the exeDirectory is ZIP_OPTION and the folder name TD10 it works. If the exe folder is TEST and the folder name is TemporaryData it works but now for the ZIP_OPTION folder it dosn't work.
I made a debug and the szFolder contains the correct path.
I've got the error 1026.
I tried to take the path with CFileFinder but still the same problem appears. I tried also to take the short folder name but it the same. I do not know what to do.
Any help or advice would be appreciate
Tnx
|
|
|
|
|
Why are you using GetCurrentDirectory()?
I don't know the rest of your code but there is a chance that the current directory changes after a recursive deletion with SHFileOperation or elsewhere in your code.
Also, you are mentioning 3 different variables for the path: "szStoreFolder", "szFolder" and "szFolderName". Very confusing.
|
|
|
|
|
problem solved
You should use the relative name to the current folder and the short name of the folder DOES NOT WORK WITH LONG FOLDER NAME.
|
|
|
|
|
I think your problem may actually be that your szStoreFolder is terminated only with a single NULL character and it should be terminated with double NULL characters.
MSDN[^]says to use fully qualified path names (not relative) - this allows the files/folders to be moved to the recycle bin.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Maybe that is true. I tried to build the string like there but the code didn't delete the folder.
Anyway I want to permanently delete the folder so it is ok like it is now.
The problem was related with full path and full name of folder that I want to delete (for the folder name you must use the short name not the long one).
Anyway that was a weird problem because in 50%-60% of case the code was working fine, without any changes.
|
|
|
|
|
I have created toolbar and statusbar controls on dialog.
But if i do not call the below function the controls are not appearing.
RepositionBars(......)
I have specified the controls position too..
Please explain.
|
|
|
|
|
How did you make your statusbar?
|
|
|
|
|
Here is the code
static UINT indicators[] =
{
ID_INDICATOR_COORD,
ID_INDICATOR_TIME,
};
.........
.........
m_StatusBar.Create(this);
m_StatusBar.SetIndicators(indicators, 2);
CRect rect;
GetClientRect(&rect);
m_StatusBar.SetPaneInfo(0, ID_INDICATOR_COORD, SBPS_NORMAL, rect.Width() - 100 );
m_StatusBar.SetPaneInfo(1, ID_INDICATOR_TIME, SBPS_STRETCH, 0);
........
..........
|
|
|
|
|
Well use of this code and it works for you 100%.
CStatusBarCtrl m_StatusBar;
CRect rect;
GetClientRect(&rect);
int m_status[2]= {100, 160};
m_StatusBar.Create(WS_CHILD|WS_VISIBLE,rect, this, 0);
m_StatusBar.SetParts(2, m_status);
m_StatusBar.SetText(_T("Oh"),0,0);
m_StatusBar.SetText(_T("RSAK"), 1, 0);
|
|
|
|
|
I need samples for creating toolbar in a dialogs.
link?
|
|
|
|
|
I think I gove you links about make statusbar,right?
|
|
|
|
|
No its given by Cédric Moonen
|
|
|
|
|
No you wrong see here[^] its good example.
|
|
|
|
|
Why would that help him ? The status bar is used in a SDI application, not a dialog application. Furthermore, the only thing it does is displaying text, so how is it related to his problem ?
|
|
|
|
|
Realy I didnt see it I saw that link of my messages.I answered to more a question about statusbar in these days so maybe my address was wrong
|
|
|
|
|
I have added status bar using the link given by you.
Kindly share a link for adding Toolbar in a dialog.
How to display status text if i move cursor over toolbar buttons?
|
|
|
|
|
RSAK wrote: How to display status text if i move cursor over toolbar buttons?
The search function on codeproject hasn't been disabled yet you know. Anyway, here[^] is what I've found after 20 seconds searching.
|
|
|
|
|
Actually the link which you gave for statusbar is simple, clear and easy to do also.
Thats why i requested for toolbar.
|
|
|
|
|
Yes. I was wrong. Its also given by Cédric Moonen.
Ok we are going away from my query...thats about RepositionBars(...)...
|
|
|
|
|
When I'm running an application, I got a Debug error Message(R6034), which says,"An application has made an attempt to load the C Runtime library without using a manifest". I've developed this application using Visual C++ 2008 Express Edition. How do I resolve this error?
modified on Tuesday, June 10, 2008 2:32 AM
|
|
|
|
|