|
Yes there is. It is called virus scanner!
Don't try it, just do it!
|
|
|
|
|
I have made a simple dialog based application in which there is just one button.ON that button click i have written the following code.
ShellExecute(NULL,"open","c:/myfile.zip",NULL,NULL,0);
The problem is when i click the button first time , the dialog window loses the focus and that zip file doesn't open but when i press that button again it perfectly opens that file.Can anyone explain what is the problem.
Thanks in advance.
Be FaithFull To Your Work.
|
|
|
|
|
Usman Tasleem Akshaf wrote:
i have written the following code.
ShellExecute(NULL,"open","c:/myfile.zip",NULL,NULL,0);
You mean ShellExecute(NULL,"open","c:\\myfile.zip",NULL,NULL,0) , right?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Try using SW_SHOWNORMAL as the last parameter:
ShellExecute(NULL,"open","c:\\myfile.zip",NULL,NULL,SW_SHOWNORMAL);
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Now it works perfect.But what i want is that when i click the button , that file get unzipped.What code should i include to do that.
Thanks in advance.
Be FaithFull To Your Work.
|
|
|
|
|
I think you are not using pkunzip from the Dos world, so...
Check your unzip software e.g, WinZip or WinRar etc for its command-line version to unzip the files. Look in the unzip software's help.
this is this.
|
|
|
|
|
Either that or use the zip lib (google for it) to unzip the files yourself without launching a separate application.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hello..
I made a dialog resource with three CButton's and a CEdit for use on a CDialogBar.. the dialog resource is set to WS_CHILD..
Now when i used the resource on a CDialogBar.. and i used CDialogBar directly without subclassing it, the buttons is always disabled... But i didn't set it to disabled on the resource editor..
Why is this?
The scenario is that I have a CDockBar docked on a mainframe, and i placed a LayeredCWnd on it as its child..Now the LayeredCWnd has the CDialogBar as its child..
Then when i run the program the buttons in the dialogbar is always disabled, while the Edit control is not..
"WatcH the BIrDiE!"
|
|
|
|
|
I don't understand why it's happenning but you could force to enable these controls when you initializes the dialog (OnInitDialog):
m_button.EnableWindow(true);
m_edit.EnableWindow(true);
Hope it helps,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
One reason they may be disabled is that there is no handler for them. Since you say the DialogBar is on your MainFrame, add handlers in the MainFrm class for the buttons.
I'm assuming MFC here, and MFC automatically disables items it can't find a handler for.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Well, actually i did have a handler for the buttons already.. specifically the OnButtonClicked handler.. tnx anyways..
|
|
|
|
|
hey,
thats a good idea.. im gonna try that.. tnx
but still want to know why the buttons are disabled by default when im using dialog bars -- not dialog boxes..
regards,
Maverick
"wATCh THe BirDIe!..."
|
|
|
|
|
Is the handler in your MainFrm class or some other class. Since the DialogBar is in the MainFrame, that's where the handler needs to be.
If it is there, I'm at a loss why the button is disabled.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I want to make a tree control based on database file.(I want to group the same occurence in database using tree control). but when I run my program, the tree control is not grouping
here i my function:
HTREEITEM CCDBMainDlg::LoadTree(CStringArray& tree)
{
//HTREEITEM hItem2;
m_treeNetwork = m_treeCDB.GetNextItem(m_treeNetwork,TVGN_ROOT);
//m_treeNetwork = m_treeCDB.GetChildItem(m_treeNetwork);
//m_treeCDB.SetImageList(&m_ImageList,TVSIL_NORMAL);
if((m_treeNetwork = m_treeCDB.GetChildItem(m_treeNetwork)) != NULL)
{
while(m_treeCDB.GetItemText(m_treeNetwork).Compare(tree.GetAt(12))!=NULL || m_treeNetwork != NULL)
{
m_treeNetwork = m_treeCDB.GetNextSiblingItem(m_treeNetwork);
}
if((m_treeNetwork = m_treeCDB.GetChildItem(m_treeNetwork)) != NULL)
{
while(m_treeCDB.GetItemText(m_treeNetwork).Compare(tree.GetAt(11))!=NULL || m_treeNetwork != NULL)
{
m_treeNetwork = m_treeCDB.GetNextSiblingItem(m_treeNetwork);
}
if((m_treeNetwork = m_treeCDB.GetChildItem(m_treeNetwork)) != NULL)
{
while(m_treeCDB.GetItemText(m_treeNetwork).Compare(tree.GetAt(0))!=NULL || m_treeNetwork != NULL)
{
m_treeNetwork = m_treeCDB.GetNextSiblingItem(m_treeNetwork);
}
}
else
{
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(0),0,1,m_treeNetwork);
}
}
else
{
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(11),0,1,m_treeNetwork);
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(0),0,1,m_treeNetwork);
}
}
else
{
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(12),0,1,m_treeNetwork);
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(11),0,1,m_treeNetwork);
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(0),0,1,m_treeNetwork);
}
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(1),0,1,m_treeNetwork);
return m_treeNetwork;
}
sorry if my function is too complicated, because I am still new in MFC
pls help..thx
|
|
|
|
|
Hai..
I want to get the path of the file which is currently opened in the notepad. Please let me know.
Thanks,
E.Veera Raghavendra.
|
|
|
|
|
You want a third app to find the path to the file open in notepad ? If notepad has a MRU list, it's probably in the registry, otherwise I reckon you're in trouble.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What is the difference between CArray and CTypedPtrArray?
The CTypedPtrArray only could contains pointer, but the CArray could contains pointer and object.
When should I use CTypedPtrArray?
Thanks,
Ray
|
|
|
|
|
To be honest, they are both crap, and you should use std::vector. However, the TypedPtrArray is obviously a specialisation, so I'd guess if you must use non standard containers that don't offer an algorithm library, use CTypedPtrArray when it fits. You have the MFC source code on your hard drive, so you can look at the source if you want to know exactly what it's doing.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
description:
I made a dll(ATL-base) that recognize the text "Hello" when I click the mouse right button on the Internet Explorer.
I already add a my menu to context menu. If I select it something happen.
my goal:
Now I want to modify my .dll to recognize the mouse left button.
I need the mothod OnClick event.
So I'm reading the Internet Explorer 5(MS).
In "Sinking Events for DHTML Objects in visual C++" on this book,
I want to modify the OnDblClick event to OnClick.
the problem:
class CMfcObjMdlDlg;
class CHTMLDocEvents : public CCmdTarget
{
DECLARE_DYNCREATE(CHTMLDocEvents)
.
.
.
I need to use CCmdTarget ....
It is MFC way. I have to change my dll(ATL-base) to MFC I think.
So I found a reference about that(http://support.microsoft.com/default.aspx?scid=kb;en-us;173974#XSLTH3125121122120121120120[^].
I already applied this method in my .dll.
But failed.. haha(-_-)a
I don't understand some description what it saying..
:::section5:::...entry point is set to wWinMainCRTStartup in the Output category of the Link field in the...
What is wWinMainCRTStartup ?
How do I have to modify and to apply?
:::section4::: what is meaning of _tWinMain function with the following...
I coudln't understand _tWinMain function .
:::section6:::function of a COM interface, window procedure, and exported function
I have to apply the AFX_MANAGE_STATE(AfxGetAppModuleState());.
I found exported function by dumpbin.exe.
What is another thing such as COM interface, window procedure?
please reply to my question~
|
|
|
|
|
When I applied the method of MSDN there was so many errors like atl_cstringex.h(17) : error C2872: 'CString' : ambiguous symbol.
How to change it?
|
|
|
|
|
I think CArray is type-safe.
For example:
CArray<cstring, cstring&=""> strArr;
We only could put CString into the strArr.
But in MSDN, it's not type-safe.
Thanks
Ray
|
|
|
|
|
CArray is crap. What was your question ?
Which doc are you looking at ? I reckon it says it's not thread safe.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
it does not say that at all.
'Tip The nontemplate collection classes have been provided by MFC beginning with MFC version 1.0. If your code already uses these classes, you can continue to use them. If you write new type-safe collection classes for your own data types, consider using the newer template-based classes.'
This tip is really old, seeing as CArray is itself old, obsolete code since the C++ standard which is a few years ago now. They had a generic, non-template version, which was not type safe. Then there is the template version ( which is crap, but ) which is type safe. Nowadays, you should use neither, you should use the stl::vector class.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I think CArray is type-safe too.
But do you see the Table of “Characteristics of MFC Collection Classes” in MSDN? The last column is “Is type-safe”, in this column CArray is “No”.
Maybe it’s a publishing bug.
Thanks,
Ray
|
|
|
|