|
I think the problem is in this line.
CDeleteJed d(this);
Dont pass "this" to the constructor.
Just check it.
It should work fine.
Thanks,
Sujeet
|
|
|
|
|
thanks for reply.I use without "this" key but result is same..
|
|
|
|
|
I developing a SDI based application. the VIEW area have some rectangle and text messages the problem here is that when i maximize the VIEW area every thing in the view area disturbed and misplaced. can anyone help me solving this problem, that when i maximize the application the every thing in the VIEW area maximize accordingly.
Thanks
kkkljj
|
|
|
|
|
You need to resize the rectangle and text messages according to window resized when its maximized.
chk this.ResizableFormView[^]
and CResizableFormView[^]
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I want to create a local webservice and pass soap message from a browser to this webservice.
i.e. lets say i have opened one web page in my browser. On clicking of one button in browser, i want to pass a soap message to a locally created webservice in vc++.
Can anyone help how to do this?
Thanks,
Sujeet Kumbhar
|
|
|
|
|
You have to use INET api to do so! read more about it in your local copy of MSDN.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
HALLO and thanks for the answer, i have the followinbg code in the view.cpp file:
BEGIN_MESSAGE_MAP(CTest_View, CEditView)
ON_WM_LBUTTONDOWN(OnCursorLine) // this should get if the user pressed the return or the up or down arrows
END_MESSAGE_MAP()
// where should i handle WM_KEYDOWN event?
CTest_View::OnCursorLine()
{
if(nChar==VK_DOWN & nChar==VK_RETURN)// how can i get the value of nChar?
}
When i start ma SDI application and press the Return or arrow up/down the Debuger does not go to the OnCursorLine ().
What should i do?
|
|
|
|
|
ON_WM_LBUTTONDOWN gets called when the user presses the left mouse button and not on the key press. I corrected my post after someone pointed out the mistake and suggested you to use the WM_KEYDOWN message instead. You can perform a check for VK_DOWN & VK_RETURN.
You can add the WM_KEYDOWN event in the same manner you do for WM_LBUTTONDOWN
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
i did it in this way but it did not work when i press any or the Return Key.
BEGIN_MESSAGE_MAP(CTest_View, CEditView)
ON_WM_KEYDOWN(WM_KEYDOWN,OnKeyDown)
END_MESSAGE_MAP()
void CTest_View::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
}
|
|
|
|
|
Please check PreTranslateMessage!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
i ckecked the PreTranslateMessage(MSG *pMsg), so i tried to override it but the debugger does come to it when i pressed any key.
BOOL CTest_View::PreTranslateMessage(MSG *pMsg)
{
// Do stuff
return true;
}
|
|
|
|
|
are you adding your event handlers manually?
why not use the wizard for the same because ON_WM_KEYDOWN() is what you need to add to the message map.
The VS editor adds void Cyourclassview::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
which later on gets called by the framework from where you can call your function to execute
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
modified on Friday, May 22, 2009 5:27 AM
|
|
|
|
|
You don't need the parameters you've passed to ON_WM_KEYDOWN - the line shown below is sufficient:
ON_WM_KEYDOWN()
I added a keydown handler to a sample SDI app's view and it captured key-presses fine, including the Return key.
Oh - one other thing - you should call the default CView key-down handler for any messages you don't handle. My WM_KEYDOWN handler (with no functionality) looks like this:
void CsditryView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CView::OnKeyDown(nChar, nRepCnt, nFlags);
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
in the CTest_View.cpp i wrote this:
BEGIN_MESSAGE_MAP(CTest_View, CEditView)// CTest_View Class is derived from CEditView Class
ON_WM_KEYDOWN()
END_MESSAGE_MAP()
/
/
/
void CTest_View::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nChar == VK_RETURN)
{
}
CEditView::OnKeyDown(nChar, nRepCnt, nFlags);
}
But it stiil not work???
|
|
|
|
|
Looking at one of your other messages where you show your PreTranslateMessage override - you return TRUE from your PreTranslateMessage override and if do that, you're telling MFC that you've done something with the message and it shouldn't be passed on to your window's message handlers. Try altering the return from PreTranslateMessage to FALSE...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i change it but nothing work.
BEGIN_MESSAGE_MAP(CProSeS_SQLTalk_View, CEditView)
ON_WM_KEYDOWN()
END_MESSAGE_MAP()
void CTestView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nChar == VK_RETURN)
{
}
CEditView::OnKeyDown(nChar, nRepCnt, nFlags);
}
///////////////////////////////////////////////////////////////////////////////////////////
BOOL CTest_View::PreTranslateMessage(MSG *pMsg)
{
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_RETURN)
{
//int bIsShiftKeyDown=(int)::GetAsyncKeyState(int nvKey);
}
}
return FALSE;
}
|
|
|
|
|
So...do breakpoints placed in your view's PreTranslateMessage get triggered?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i already put breakpoints as you said but the Debugger did not go to the PreTranslateMessage().
|
|
|
|
|
And you're sure that you are building a debug build?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Are you sure your view class is being used?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
i do not know, how can i check that ? and if it is not being used what should i do?
|
|
|
|
|
Have you got some code in your CMainFrame class that you can a) add some code to, and b) guarantee will be executed application's running?
If so, then add a call to the active view's OnKeyDown handler:
GetActiveView()->OnKeyDown((UINT)'a', 1, 0);
Set a breakpoint on that line. When the breakpoint triggers, repeatedly step into the call (it'll call the GetActiveView() methods first, then step back out, then step into the OnKeyDown handler). When you get to an OnKeyDown handler, you can see what the view type is.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i got this error when i wrote this in my CMainFrame class:
GetActiveView()->OnKeyDown((UINT)'a', 1, 0);
error C2248: "CWnd::OnKeyDown" Members of a derived class cannot access private members of a base class.
|
|
|
|
|
My fault - didn't realise OnKeyDown was private. Ummm, OK - you need to add (to your view class) an override for a public method of CView. Call that from your CMainFrame. For example, CDocument:
CDocument* CTest_View::GetDocument() const
{
return CEditView::GetDocument();
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|