|
Thanks, I read it and little bit confusing. Do you know any place I can see a small worked example.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: I read it
Mmmh, if you had scrolled down the page, there is a link to an exemple here[^].
|
|
|
|
|
Thanks pal, now I have two such examples. I'll be if I got any issue there.
Thanks again.
I appreciate your help all the time...
Eranga
|
|
|
|
|
hai...
in codeproject site itself so many examples are there.....y cant u go and search...any how... refer this <pre<a href="http://www.codeproject.com/buttonctrl/CBrowseCtrl.asp">http://www.codeproject.com/buttonctrl/CBrowseCtrl.asp</a>[<a href="http://www.codeproject.com/buttonctrl/CBrowseCtrl.asp" target="_blank" title="New Window">^</a>]>
Born to win...!
|
|
|
|
|
What about calling CFileDialog ??? Would it help you?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Actually all the worked examples I've found are too complected for me. Is there any easy way. All of the program use a edit box and use it for browsing. I'm not clear what's happened there.
I appreciate your help all the time...
Eranga
|
|
|
|
|
There are not difficult maybe you need to more work for learn them.
|
|
|
|
|
Yes, it's true. Those things are really new for me. That's why I'm stuck on different steps.
I appreciate your help all the time...
Eranga
|
|
|
|
|
I think if you buy a book about mfc is helpful for you.
|
|
|
|
|
donot get confused.
do as nelek has suggested using a CFileDialog. i had been using it since years.
see the example here.
CFileDialog dlg(true,NULL,_T("*.*"),OFN_FILEMUSTEXIST|OFN_HIDEREADONLY,"textfiles(*.*)|*.*|*.*");<br />
dlg.m_ofn.lpstrTitle="select the required file";<br />
if(dlg.DoModal()!=IDCANCEL)<br />
{<br />
CString filename=dlg.GetPathName();<br />
}<br />
else<br />
return;
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
|
|
Thanks pal. I've read it well and do my work well. I have another question regarding MFC control editing. I'll start a new thread.
Thanks again.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Look at your docu and read about CFileDialog
One example with my personal use in my project, it gives something like save as... asking to overwrite if the file already exists:
CFileDialog newFileDlg (TRUE, "*.ext", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "Searched File (*.ext) | *.ext|", NULL);
Then you can use functions like newDlg.GetFileName (), GetFilePath ()... and others, that will help you to create the archive with CFile or CArchive
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I found this and refer, but lots of coding going there. I'm really confusing. Someone can give a brief explanation how to refer it.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Are you reading the answers we give you?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello,
I create a "Windows Form Application" project that names p2pport, in Microsoft visual .NET 2005.
I want to use the Message Map. I see it on MSDN. MFC uses it.
So I include the #include <afxwin.h>, and use MFC in a shared DLL.
This is my code.
BEGIN_MESSAGE_MAP(p2pport::Dlg,public System::Windows::Forms::Form)
ON_MESSAGE(WM_UI1, p2pport::Dlg::OnUI1, WPARAM wParam, LPARAM lParam)
ON_MESSAGE(WM_UI2, p2pport::Dlg::OnUI2, WPARAM wParam, LPARAM lParam)
ON_MESSAGE(MM_MIXM_LINE_CHANGE,p2pport::Dlg::onMixerCallBack)
ON_MESSAGE(MM_MIXM_CONTROL_CHANGE,p2pport::Dlg::onMixerCallBack)
END_MESSAGE_MAP()
p2pport is my project name, and Dlg is the name of my form file.
But I get a lots of errors.
error C2039: 'GetMessageMap' : is not a member of 'p2pport::Dlg'
error C2039: 'GetThisMessageMap' : is not a member of 'p2pport::Dlg'
error C2039: 'GetThisMessageMap' : is not a member of 'System::Int32'
error C2270: 'GetMessageMap' : modifiers not allowed on nonmember functions
error C2365: 'GetThisMessageMap' : redefinition; previous definition was 'formerly unknown identifier'
error C2440: 'static_cast' : cannot convert from 'void (__clrcall p2pport::Dlg::* )(WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
error C2440: 'static_cast' : cannot convert from 'void (__clrcall p2pport::Dlg::* )(WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
error C2440: 'static_cast' : cannot convert from 'void (__clrcall p2pport::Dlg::* )(WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
error C2440: 'static_cast' : cannot convert from 'void (__clrcall p2pport::Dlg::* )(WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
error C3861: 'GetThisMessageMap': identifier not found
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I google it, but nothing finds.
Can anybody help me to solve it?
Appreciate for ur reply. Thx.
-- modified at 5:03 Tuesday 6th November, 2007
|
|
|
|
|
Own created messages will be handled this way in >>MFC<<:
In header:
class MyView
{
...
LRESULT OnMyMessage(WPARAM w=0,LPARAM l=0);
...
};
in .cpp:
BEGIN_MESSAGEMAP(MyView,CFormView)
ON_MESSAGE(WM_MY_OWN_MESSAGE,OnMyMessage)
END_MESSAGE_MAP()
LRESULT MyView::OnMyMessage(WPARAM w,LPARAM l)
{
// Work
return TRUE;
}
I hope this helps you
|
|
|
|
|
Thx for your reply.
It helps me a lot.
But I still get some errors.
I create a header file that named CMyView and the content is following.
#ifndef CMYVIEW_H<br />
#define CMYVIEW_H<br />
#include <afxwin.h><br />
#include <afxext.h><br />
public class CMyView : public CFormView<br />
{<br />
LRESULT OnUI1(WPARAM wParam, LPARAM lParam);<br />
LRESULT OnUI2(WPARAM wParam, LPARAM lParam);<br />
LRESULT onMixerCallBack(WPARAM wParam, LPARAM lParam);<br />
<br />
};<br />
#endif
And my code is modified as below.
BEGIN_MESSAGE_MAP(CMyView,CFormView)<br />
ON_MESSAGE(WM_UI1, OnUI1)<br />
ON_MESSAGE(WM_UI2, OnUI2)<br />
ON_MESSAGE(MM_MIXM_LINE_CHANGE,onMixerCallBack)<br />
ON_MESSAGE(MM_MIXM_CONTROL_CHANGE,onMixerCallBack)<br />
END_MESSAGE_MAP()
And there's the error.
error C2509: 'GetMessageMap' : member function not declared in 'CMyView'
error C2509: 'GetThisMessageMap' : member function not declared in 'CMyView'
How could I solve this problem?
Appreciate for ur reply.
Thx.
|
|
|
|
|
I got it.
I lose DECLARE_MESSAGE_MAP()in the header file.
The correct code is as below.
#ifndef CMYVIEW_H<br />
#define CMYVIEW_H<br />
<br />
#include <afxwin.h><br />
#include <afxext.h><br />
<br />
public class CMyView : public CFormView<br />
{<br />
<br />
public:<br />
afx_msg LRESULT OnUI1(WPARAM wParam, LPARAM lParam);<br />
LRESULT OnUI2(WPARAM wParam, LPARAM lParam);<br />
LRESULT onMixerCallBack(WPARAM wParam, LPARAM lParam);<br />
protected:<br />
DECLARE_MESSAGE_MAP();<br />
<br />
};<br />
<br />
#endif
|
|
|
|
|
Outstanding
Great that it works for you
|
|
|
|
|
Hi All,
I have a notepad like application. I want to avoid from taking snapshots of my application using printscreen like facility. Is there any way?
|
|
|
|
|
I don't know the correct answer,
but i don't think so, because the PrintScreen-Key will be handled in each way in windows itselfs,
so you can't suppress this key in your app and windows never remarks it.
Because you can "steal" any picture in a browser which is protected via different methods over
the printscreen...
If the disabling of the PrintScreen-Key works, all browsers would use this method to protect
the pics into the browser
But propably there is a specific technique to do that, but i never heared about it.
Good luck
|
|
|
|
|
Im not sure about, but I think that hooking the message of "print screen" and doing nothing / something different while the application is active could work. But its pretty hard work.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Injecting a hook into windows? ouch
I never want to try this LOL, that's to hard for me
I even don't know in which DLL to hook in
But it's a solution, right
|
|
|
|