|
Believe it or not the VS Debugger is not perfect and sometimes it will miss breakpoints if they are too 'early' in the code. Either because it doesn't think the line will be called or because it isn't completely ready when that line is hit. Sometimes static construction can fall into this trap and become 'undebuggable' although not usually. It may also depend on whether the Debugger can find and match the source for the CRT.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks Matthew,
Where to set DebugBreak in the sample we discussed before? Confused.
class CSomeclass
{
public:
static int MyMember;
};
int CSomeclass::MyMember = 42;
int main()
{
return 0;
}
regards,
George
|
|
|
|
|
In this case you can't because int doesn't have a constructor, at least not one with source code. If you make CSomeclass::MyMember something more complex like a COtherclass then you could insert a DebugBreak(); in COtherclass::COtherclass();
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Thanks Matthew,
I have made exercise (post code below), and find there is no need to use DebugBreak(). I can set breakpoint directly in class CSomeclass. Please help to review my code and feel free to correct me if I am wrong.
class Foo {
private:
int i;
public:
Foo (int i)
{
this->i = i;
}
};
class CSomeclass
{
private:
Foo* pFoo ;
public:
CSomeclass()
{
pFoo = new Foo (100);
}
~CSomeclass()
{
delete pFoo;
}
};
CSomeclass ginstance;
int main()
{
return 0;
}
have a good weekend,
George
|
|
|
|
|
I have 2 dialogs in my application. now i need to pass continuous values from one dialog box to another.
both the dialogs are opened simultaneously.
the calculations are done on one dialog box and the result needs to be shown in another dialog box. how do i do it?
i tried passing the value by
<br />
m_realtime.value = m_value <br />
but nothing is displaying on the edit box.
|
|
|
|
|
Chandrasekharanp wrote: but nothing is displaying on the edit box.
Why would it? All you're doing is changing a variable. Windows / MFC is not psychic enough to know that variable should be put into some control on a dialog box.
m_realtime.UpdateData (FALSE); will call that dialog DoDataExchange method, which would call any DDX_etc lines of code put in there by codewizard (or yourself) to transfer variables to controls.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
You can use like this code:
CMain *main=(CMain*)GetParent();
main->yourcontrol
|
|
|
|
|
Hi all,
Anyone can tell me how can resize the control which is inside of other control.
i m using "BPCtrlAnchorMap.h" this class for resizing this available on CodeProject.
in brief i m using a SDI type of application here in 1 FormView i m using a TabCtrl and inside the Tab Control i m using diffrent dialog box those are having ListCtrl and some other control.
with the using of class for resizing the TabCtrl is Resized Properly but other control inside the Tab control are not resized.
Please anyone can help me.
Thanks in advance.
|
|
|
|
|
ThatsMe. wrote: Anyone can tell me how can resize the control which is inside of other control.
Control is a fancy name for Window. And all windows are inside other windows. So, you do it the same way you resize anything:
SetWindowPos.<br />
<br />
If you are using one of the articles on codeproject that does resizing for you, then you need to look at the example code that comes with that article. And each article has a message board on it. First read all the postings on that article; someone may have already fixed your problem. If you're still struggle, try posting on that message board first - the author is notified of any posting, and may be able to help you.<br />
<br />
Iain. <br />
<br />
<div class="ForumSig">Iain Clarke appears because <sup class="Error">C</sup>Pallini still cares.</div>
|
|
|
|
|
Did you use of MoveWindow?
|
|
|
|
|
hi
i need study about Structure of MFC Architecture ...please send me some useful links ..
Thanks And Regards
Nisha.S
|
|
|
|
|
Never heard of something called google[^] ?
|
|
|
|
|
Well, there are lots of books on MFC but i'll particularly recommend
http://www.codeproject.com/?cat=2[^] as it contains lots of userful articles for both biginners and advanced users/programmers...
|
|
|
|
|
|
For the structure of MFC, I find the MFC source code to be the best place to study.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Did you search on the codeproject?
|
|
|
|
|
This code snippet is used to bring up a confirmation dialod box to close the window only when the top right close box is clicked not for any other methods of closing like File>Exit and Syatem Close and Alt+F4. The behaviour of getAsyncKeyState() is not undersatndable here...
LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg,WPARAM wParam, LPARAM lParam)
{
LRESULT result=0L;
int k=0;
switch(Msg)
{
case WM_NCLBUTTONDOWN:
if (wParam!=HTCLOSE) // allow clicks on system menu to continue and proceed
{
DefWindowProc(hWnd, Msg, wParam, lParam);
return 0;
}
GetAsyncKeyState(VK_LBUTTON);
break;
case WM_NCLBUTTONUP:
if ((int)wParam ==HTCLOSE && !(GetAsyncKeyState(VK_LBUTTON)))
{
k=MessageBoxA(NULL, "Do u wish to close ", "getasynckeystate", MB_YESNO);
if (k==IDYES)
{
PostMessage(hWnd, WM_CLOSE, 0, 0L);
return 0;
}
else
{
DefWindowProc(hWnd, Msg, wParam, lParam);
}
}
DefWindowProc(hWnd, Msg, wParam, lParam);
break;
case WM_DESTROY:PostQuitMessage(WM_QUIT);// then close it
break;
default : return DefWindowProc(hWnd, Msg, wParam, lParam);// Process the left-over messages
}
return result;
}
Bibhakar Ranjan
|
|
|
|
|
GetAsyncKeyState[^].
Please, read the posting guidelines before posting a message, format your code with the pre or code tag otherwise it is difficult to read.
Furthermore, you shouldn't use MessageBoxA directly, but MessageBox. So that your compile will still compile if you switch UNICODE on or off.
|
|
|
|
|
...you can see also suggest the related GetAsyncHi and GetSynchronousHello functions.
BTW Good morning Cedric.
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
|
|
|
|
|
Hello mister Pallini
Sorry, but I didn't get what you were trying to say. My brain is still not fully operational in the morning
|
|
|
|
|
folks,
I need help on how to write a C/C++ code to compute the Gaussian and Laplacian Pyramids at 5 levels.
Using PGM image format as the input. Please help
|
|
|
|
|
|
Is this is Debug or Release mode?
"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
|
|
|
|
|
|
Usef Marzbani wrote: It's On Release Mode
Enjoy!
"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
|
|
|
|