|
Artem Kustikov wrote: It seems to me direct call of destructor (od.~OperatorDetails() and so on) is very bad technique (((
Then what technique to use?
free(&obj);
obj.~Objct();
I don't get any error or exception no, or stack. On retry it immediately shows "An unsupported operation was attempted". Alt+7 also doesn't work. I am not able to debug or give breakpoints with CE & eVC++4. If their is a way to work out, let me know. To figure out such errors, I always opt for debugging only.
Thanks
Terry
|
|
|
|
|
Hi all,
I have made a dialog based application from which i am calling another dialog based application using shell execute. Now what i want is when my second application is displayed first aplication should hide and it should not be diaplayed in task bar also, and when second application finishes it task first application should become visible.
I tried doing it using:-
CDialog::OnShowWindow(SW_HIDE,SW_PARENTOPENING);
but it doesnot hide the window.
How can i do this....
Thanks in advance
|
|
|
|
|
Instead of ShellExecute() , Create the process by using CreateProcess() . From the PROCESS_INFORMATION structure, you'll get the new process handle.
Now hide yourself by calling ShowWindow( FALSE ) function and wait until your second process gets finished by calling MsgWaitForSingleObject( hSecondProcess, ...) . Now your first application is in waiting state.
Once the second child process is finished, the MsgWaitForSingleObject() will returns and now, show your window again by calling ShowWindow( TRUE ) .
If can use WaitForSingleObject() instead of MsgWaitForSingleObject() , but then your first application dialog will not process any messages.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
You should call ShowWindow(SW_HIDE); instead of OnShowWindow.
-Saurabh
|
|
|
|
|
You need to handle to these programs and then you can use of ShowWindow().
|
|
|
|
|
Hello everyone!
I'm trying to make something similar to the color toolbar in MS Paint. A regular toolbar doesn't do the job, so I must create my own... But how? I can't derive my class from CToolBar (at least not with the class wizard).
I tried deriving from CToolBarCtrl, but I can't figure out how to put it in my window/make it dockable.
Any clues? Thanks in advance!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Will this help. [^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Okay, I figured it out. Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Hi,
i'm using the classes from Barretto VN http://www.codeproject.com/KB/tree/enumdeskclones.aspx to build a Win32ExplorerTreeView & ListView and it works very good.
Now i want to load and view an (in the Listview)doubleclicked file in another view, so i need to get the full path name and extension of a file when it is double clicked in a listview for example :
F:\WORKING\MISC\OpenGL C++\OGL\MilkshapeModel.cpp
I think a need a shell function or something like that?
Could you help me with this?
Best regards Croc
|
|
|
|
|
You are not showing the full path of the file obviously, otherwise it would have been too easy to get it from there , but when you get the file name intially (from whatsoever method by extracting string from the selected path or finding files from a directory) do you store the rest of the path and extension of the file in some variable. May be a vector or something? if yes, then when the user clicks on the selected file you can map the entry in the list view to that in your data structure, prepend the path to the file name and do a ShellExecute ( not very sure that you would be needing ShellExecute.)???
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Tkanks for your quick replies, perhaps you have the time to look a bit closer to the example, becuse i tried to get these information from the file for 2 days now and it wouldn't ! . Perhaps you could help me with some details specified to this example !
Best regards
croc
|
|
|
|
|
I didn't have a look at the code as of now. Did you try what I suggested?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Yes i tried it, but
Here is the code of the function, it's a lot but i hope it will help!
void CShellListView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
{
CString text;
char szBuff[MAX_PATH];
CString ptrPath[5];
int i = 0;
LVHITTESTINFO lvhInf;
GetCursorPos(&lvhInf.pt);
ScreenToClient(&lvhInf.pt);
int item = ListView_HitTest(GetListCtrl().m_hWnd, &lvhInf);
if((LVHT_ONITEMLABEL & lvhInf.flags ) || (LVHT_ONITEMICON & lvhInf.flags))
{
LPTVITEMDATA* lptvid = NULL;
lptvid = (LPTVITEMDATA*) m_pMalloc->Alloc (sizeof (LPTVITEMDATA));
LVITEM lvi;
lvi.mask = LVIF_PARAM;
lvi.iItem = lvhInf.iItem;
ListView_GetItem(GetListCtrl().m_hWnd, &lvi);
lptvid = (LPTVITEMDATA*)lvi.lParam;
ULONG uAttr = SFGAO_FOLDER;
lptvid->lpsfParent->GetAttributesOf(1, (LPCITEMIDLIST *) &lptvid->lpi, &uAttr);
if(uAttr & SFGAO_FOLDER)
{
CShellClass csc;
csc.GetName(lptvid->lpsfParent , lptvid->lpi , SHGDN_NORMAL, szBuff);
this->m_pShellTreeView->SelectThisItem(szBuff);
IShellFolder *psfProgFiles = NULL;
HRESULT hr = lptvid->lpsfParent->BindToObject(lptvid->lpi, NULL, IID_IShellFolder, (LPVOID *) &psfProgFiles);
if(FAILED(hr))
return;
lptvid->lpsfParent = psfProgFiles;
LVPopulateFiles(lptvid);
text = szBuff;
ptrPath[i] = text;
AfxMessageBox(ptrPath[i]);
i++;
}
else
{
AfxMessageBox(ptrPath[0]+ptrPath[1]+ptrPath[2]+ptrPath[3]);
}
}
*pResult = 0;
}
Best regards
Croc
|
|
|
|
|
I have not looked at these classes but why don't you just add a handler and/or a member variable for your purpose?
|
|
|
|
|
CrocodileBuck wrote: I think a need a shell function or something like that?
Sounds like SHGetPathFromIDList() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Mr.Crow,
yes i tried it with this function, but i didn't manage to get the file path, name and extension.
Could you perhaps explain me how to use this function in the right way?
Best regards
Croc
|
|
|
|
|
Assuming you have a valid IDL pointer:
LPITEMIDLIST idl;
TCHAR szPath[MAX_PATH];
SHGetPathFromIDList(idl, szPath);
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
CrocodileBuck wrote: how to use this function
See here[^].
|
|
|
|
|
I am making web Crawler. I can get hard coded URL but not able to get dynamic generated URL (URL contain ? mark ). Can you tell me, how can i get this in C++.
|
|
|
|
|
sumit.durg wrote: but not able to get dynamic generated URL (URL contain ? mark ).
From where do you want to get this "dynamically generated URL"
and where do you get the hard code URL from?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
while parsing HTML code itself.
|
|
|
|
|
Hello I have a little big problem that drive me crazy for 3 hours.
I have a function that browse the content of a folder (with subfolders).
After that operation is done I want to delete the folder. The function is recursive.
All the files in the route folder are deleted ok. But I cannot delete the subFolders and their content.
I use this code for retrieve information about files and folders:
WIN32_FIND_DATA FindFileData;
HANDLE hFind=INVALID_HANDLE_VALUE;
hFind= FindFirstFile(aux,&FindFileData);
FindNextFile(hFind, &FindFileData);
I guess that it is us
How can I remove the file/folder in use tag?
I tried with
delete &FindFileData it doesn't work. There must be a way out there ...
I tried to delete the folder without browse it first and it works fine.
The weird thing is that I can delete the files that are in the root.
|
|
|
|
|
Did you use FindClose(hFind) ?
|
|
|
|
|
Why don't you use
DeleteFile(FindFileData.cFileName); ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Can you use of _rmdir or SHFileOperation without this code?
|
|
|
|