|
It doesn't work
You can see my app here, if seeing the edit control in action might help: http://www.lancersreactor.com/t/download/download.asp?id=123
|
|
|
|
|
Which product is the better of the two?
Jon Sagara
You know the world is off tilt, when the best rapper is a white guy, the best golfer is a black guy, the tallest basketball player is Chinese, and Germany doesn't want to go to war.
-- Charles Barkley
|
|
|
|
|
I am currently using BoundsChecker, though I have used Purify in the past (about 4 years ago on VC++ and SGI). Both are good products, though I think BoundsChecker is easier to use. If you are getting this for a company and getting multiply copies, I would think about getting one of each. Each has their strengths, one may find something the other may miss.
Dave Hickerson
david.a.hickerson@boeing.com
|
|
|
|
|
|
I tried both of them recently and BoundsChecker worked much better for me. I have a project with 120,000 lines of code and Purify generally was not able to operate correctly. It generally stops execution on some API calls, which are valid calls. Even if it works fine, the resource and error leak analysis of Purify was not as good as BoundsCheckers analysis (it was not even close to it).
Currently I am using BoundsChecker and it works like a charm. It has more features than Purify and its integration to Visual C++ is much better.
You can request a trial for both of the products. Just try and see both of them...
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
I created a new class based on CButton -- CMyButton. I add a message notification handler in CMyButton.cpp for =BN_CLICKED to change an protected member variable of CMyButton.
void CMyButton::OnClicked()
{
m_nState += 1;
}
Using resource editor, I put an instance of CMyButton to my dialog template. I want my dialog to handle the BN_CLICKED also, do some other stuff.
void CMyDlg::OnMyBtn()
{
MessageBox("Button pressed.");
}
The problem is: CMyDlg::OnMyBtn is never called, even though I add the style of "Notify" to the button instance in the resource editor. What am I missing here?
TIA!
|
|
|
|
|
You need an entry in the message map for CMyDlg that 'connects' your button to the handler.
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
ON_BN_CLICKED(IDC_Control_ID, OnMyBtn)
END_MESSAGE_MAP() IDC_Control_ID is the resource ID for the button that you assigned when you created it.
To get a feel for this, use the wizard to create a simple dialog application. In the resource editor, drop a button on the dialog. In VC6, right-click on the button you just added and select Events. In VS.NET, right-click and select Add Event Handler. This lets you add code to the dialog class to handle events from the button. Take a look at the code generated by the wizard. It adds code in the following places:
- A declaration is added to
MyDlg.h for the button handler. This will be a line of the form afx_msg void OnMyButton(); - An entry is added to the message map like the example above.
- A definition of the handler is added to
MyDlg.cpp , similar to the following:
void MyDlg::OnMyButton()
{
}
Software Zen: delete this;
|
|
|
|
|
yes, I already had it. It seemed to me that the BN_CLICKED is processed by the button itself and the message never get to the dialog.
I add the following to CMyButton::OnClicked:
GetParent()->PostMessage(WM_COMMAND,
MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED),
LPARAM(this->m_hWnd));
but it didn't help. Any hint?
|
|
|
|
|
May be this was discussed earlier, but is there way to have Maximized and Restored children of MDI, or prevent Restore from affecting other windows. Something like Opera & dialog popup.
Thanks,
Brian
|
|
|
|
|
Here are two code fragments.
I would like to understand what is the problem with the second one?
It is almost identical to the first one, except I wanted to use
a "pointer access". (e.g: CDlg* p_dlg; p_dlg-> . . .)
// The following code fragment works OK:
//=================================================
// this is in MainFrm.h:
#include "Dlg.h"
public:
CDlg dlg;
//----------------------------------------------------
// this is in MainFrm.cpp:
void CMainFrame::OnShowDlg()
{
dlg.Create(IDD_DLG,this);
dlg.SetWindowPos(&wndTop,10,10,20,10,SWP_SHOWWINDOW);
dlg.ShowWindow(SW_SHOW);
}
*********************
//The following code fragment compiles OK
//but the modeless window does not show:
//===========================================
// this is in MainFrm.h:
#include "Dlg.h"
public:
CDlg* p_dlg; //pointer !!
//----------------------------------------------------
// this is in MainFrm.cpp:
void CMainFrame::OnShowDlg()
{
p_dlg->Create(IDD_DLG,this);
p_dlg_SetWindowPos(&wndTop,10,10,20,10,SWP_SHOWWINDOW);
p_dlg->ShowWindow(SW_SHOW); //will NOT show!!!
Thank you:
Gabor Kalman
Kalman_G@MSN.COM
|
|
|
|
|
You need to create the C++ object before you use it:
void CMainFrame::OnShowDlg()
{
if ( NULL == p_dlg )
p_dlg = new CDlg();
p_dlg->Create( IDD_DLG, this );
// etc.
}
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
I have some views defined in the resource file.
I display these in a splitterwnd. I like to know the size of the dialog in the resource file so that I can resize the splitters according to this size.
How to?
yours sincerly
Jørgen Granborg
|
|
|
|
|
The simplest way would be to create the dialogs modeless and not visible, and then get the size of their window. You can then destroy them and recreate them within your splitter, knowing the size.
Software Zen: delete this;
|
|
|
|
|
Im working on a program that luanches programs, please dont laugh... Im workin on make the program more customizeable. To do this im going to use a file that holds all the programs to be launched in it. Each line contains a path to a program. The program then reads the file and adds each string to a dynamic array. The problem is i dont know how to add each program to the array with out overwriteing previous ones. And, when i go to loop back and execute each program, i dont know how many elements are in the array so i dont end up in an endless loop. Please help
~~~~~~~~~~~~
~~NICHOLAS~~
~~~~~~~~~~~~
|
|
|
|
|
use std::vector for your 'dynamic array'. you can insert anywhere in the array (no 'overwriting'); you can get the size of the array with myvector.size(); it will handle cleanup and will generally make your life better.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Okay where is the inlcude file for vectors and also how do i add an item to it? thanks
~~~~~~~~~~~~
~~NICHOLAS~~
~~~~~~~~~~~~
|
|
|
|
|
#include <vector>
using namespace std;
vector<CString> myVect;
myVect.push_back(_T("Nick"));
myVect.push_back(_T("Parker"));
-Nick Parker
|
|
|
|
|
Okay now how do i iterate through the elements and get their value??
~~~~~~~~~~~~
~~NICHOLAS~~
~~~~~~~~~~~~
|
|
|
|
|
Use an iterator:
vector<CString>::iterator myIter;
-Nick Parker
|
|
|
|
|
|
If you are using MFC (you did not say) then just use class CStringArray.
Trust in the code Luke. Yea right!
|
|
|
|
|
I have a program which read the serial port. I have it running okay on Windows 2000, but when I tried on Windows95, this is the error message I got:
"Linked to missing export KERNEL32.DLL:Cancello"
"A device attached to the program is not functioning"
What can be wrong? TIA!
|
|
|
|
|
|
thank you!
I will let my partner know that I am not supporting Windows95 then.
|
|
|
|
|
If you want, you can try to use Rational Purify Plus in order to check which functions are used by your application that are usupported for Win95, you can download the demo version and check it.
Else you can check it by yourself by checking all the functions used in MSDN in order to know the OS required for that function...
There are a lot of ways to know which OS you are using (where your app has been installed) and you could write an application that work in different ways depending on the OS.
Hope this helps.
|
|
|
|