|
Will not compile, too many erros to mention.
|
|
|
|
|
Post your declarations using 'no HTML' option. Without that, the > and < are missing.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
If it were me, I would typedef the things I wanted to use as such
typedef vector <bool> GridVect;
typedef struct tagGridRow
{
UINT time;
GridVect gv;
} GridRow, *pGridRow;
typedef deque <gridrow> GridRowList;
and then instantiate these objects as you need them.
i.e.
GridRow gr;
GridRowList grl;
grl.push_front(gr);
In your first code, I do not see where you declare what you are putting in your vector.
|
|
|
|
|
I want to implement a control in my app similar to the Workspace in Visual Studio. In the Workspace, although your project (source files etc) are presented in a tree, you can select more than 1 node at a time. I don't think I can base my control on the TreeView control since it doesn't support multi-select. Any ideas? Thanks in advance. DEM.
|
|
|
|
|
Oct'96 issue of MSJ, C++ QA column by Paul DiLascia contains the code you need. The article may be in the MSDN installed on your disk. If it's not there, go to msdn.microsoft.com and search for CMultiTreeCtrl.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi.
I have programmed a Dialog box with a progress bar.
But I want the progress bar to run a soon as the dialog opens with no prompt from the user, how do i do this. InitDialog is too early if you get my drift.
I am using VC++ 6.0
Regards
Mark
|
|
|
|
|
How are you going to increment the progress bar value? Is it related to some background task?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
It is surprising to me that you consider OnInitDialog too early to initiate your progress bar. This handler is on the very brink of the moment when the dialog is shown up!
Anyway you can handle WM_WINDOWPOSCHANGED , which is (if I'm not wrong) the very first message sent right after the dialog appears on the screen.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Put a timer in the Dialog box. Start it in the OnInitDialog....
In the OnTimer, Test if the Dialog is Visible and Ready....
Regards.
Carlos Antollini.
Sonork ID 100.10529 cantollini
There are two ways to write error-free programs; only the third one works.
|
|
|
|
|
I'm still fairly new to VC++
So do I create a member for a timer, is it a CTimer??
What function(s) do I need in my cpp??
Mark
|
|
|
|
|
Yes you need to Use the CWnd::SetTimer function and add the message CWnd::OnTimer
Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
Beta. Software undergoes beta testing shortly before it's released. Beta is Latin for "still doesn't work."
|
|
|
|
|
Carlos Antollini wrote:
Beta is Latin for "still doesn't work."
Its actually greek if I'm not mistaken. Nice joke anyway.
.NET or not .NET? MFC is the question......
|
|
|
|
|
You should be able to access any control in a dialog box from the OnInitDialog method. All controls have been created at this point. UNLESS you have subclassed any of the controls (i.e. you created member variables for them with Class Wizard). They do not get connected until the first call to DoDataExchange. But this gets called by CDialog::OnInitDialog(). Use the code snippet below as a reference:
BOOL CCreateReportDlg::OnInitDialog()
{
CDialog::OnInitDialog();
} Hope this helps.
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
For modeless dialogs, subclassed controls get created after your overridden OnInitDialog() has finished executing.
When I want to initialize subclassed controls in a modeless dialog, I post a custom WM_COMMAND (like IDC_INIT_GUI) from OnInitDialog() and handle the initialization in the handler OnInitGui() .
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
If you are manually subclassing controls then it is completely up to the programer to determine when to subclass and init controls. But if they are done through the Class Wizard they can be accessed from the OnInitDialog method after the base class call CDialog::OnInitDialog for modal or modeless dialogs. Here is some currently working code that works as modal or modeless.
void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_PROG_BAR, m_progBar);
}
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_progBar.ShowWindow(SW_HIDE);
CenterWindow();
return TRUE;
} This code works fine if you are displaying your dialogs the normal way.
CMyDlg dlg;
dlg.DoModal(); or
CMyDlg *pdlg = new CMyDlg;
pDlg->Create(IDD, pParent); No need to do any custom messages if they are not needed.
Of course, from the original message it hard to know what the author means by “I want the progress bar to run a soon as the dialog opens.” Writing code to updated a progress bar is a whole other discussion.
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
Hi Mark
Try to use WM_SHOWWINDOW , Add a Message Handler to WM_SHOWWINDOW It will Create the Member Function OnShowWindow(BOOL bShow, UINT nStatus)
Start the Progress bar in here..
Gaurika Wijeratne
www.gaurika.com // gaurika@sltnet.lk
|
|
|
|
|
I want to monitor per process CPU usage on Windows 9x. Now most answers point to writing a device driver (VXD). But what I really want to know is what code has to be written to monitor the per process CPU usage on Windows 9x only.
Wilfred
|
|
|
|
|
You don't need vxd to access the performance data under 9x. Check the KB article Q174631 HOWTO: Access the Performance Registry Under Windows 95.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Sir,
I have noticed that the resitry entries in win95/95 systems only provide the total CPUUsage and not CPUUSAGE PER PROCESS.In WinNT it is done through NtQuery Information function in Kernel.dll. I am not able to find any path to do it in Win95/98 systems.
I require dynamically for some interval of time(say for every 1 minute), the CPU used by every process currently running in the system.
Could you please help as it is very urgent.
Regards
Shankar
Wilfred
|
|
|
|
|
We have a lot of VC6 legacy code using MFC's CStringList. I've been charged with creating a COM interface for CStringList so that it can be used from within VB. Also the interface needs to support the for each ... VB syntax.
It seems to me that ATL's CComEnum/IEnumVARIANT is the answer, but I can't figure out the implementation. I accept that I should probably be using the STL, but that's not an option at the moment. I've seen a lot of examples of using CComEnum but they all seem to use STL containers or safearrays to hold the data. Does anyone have an example that uses CStringList or any other MFC list/array?
Gavin
|
|
|
|
|
Hi
I have some code that contains a linked list of pointers to a class that itself contains a list of items. These are declared as follows:
class CROI : public CObject
{
DECLARE_DYNCREATE(CROI)
.
.
.
CTypedPtrList<cptrlist, coutline*=""> m_lpOutlines;
CTypedPtrList<cptrlist, cvertexlist*=""> m_lpVertexLists;
.
.
.
};
class CVertexList
{
public:
CVertexList();
virtual ~CVertexList();
CList<cpoint, cpoint&=""> m_lVertices;
};
When I need to recreate this list I try and clear the existing list as
follows:
while(!m_lpVertexLists.IsEmpty()){
pVertexList = m_lpVertexLists.RemoveHead();
delete pVertexList;
}
Now this crashes sometime either because the pVertexList that it gets is not pointing to valid memory or because the list of objects at the next level down is corrupted at some point (ie a pNext is incorrect).
So some how something is corruptting the memory that is used for these lists and I can't figure it out.
Does anyone know how I can debug it to find out what is fiddling with the memory.
I am using VC++ 6.0 purchased back in 1998 and haven't downloaded any updates that I can remember. Is anyone aware whether they might have been problems with this particular area of VC++.
Any help would be much appreciated.
Puzzled
Andrew
|
|
|
|
|
I don't believe your problem will disappear when you install latest service pack (SP5).
It seems that you're corrupting the heap somewhere. I'd try to reduce the problem - create the sample MFC app with wizard, copy CROI and CVertexList, instantiate one CROI and fill it with multiple lists of vertices. If program will crash, you'll be sure that CROI the source of problems.
To automate this kind of debugging you may consider a special tool, like BoundsChecker or Rational Purify. I'm not sure if you can download demo version of BoundsChecker today; evaluation version of Purify can be downloaded from www.rational.com
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
I have editing of sub items enabled in a tree control. Is there any way that I can restrict the users input to numbers as you can with a normal CEdit control?
Thanks
Matthew
also, if anyone knows this it would be great. If I activate the IME during editing an item, the input isn't displayed very well at all as the bounding box for the text when editing begins isn't sufficient. Is there are fix for this?
cheers
Matthew
|
|
|
|
|
You'll probably have to subclass the tree edit control and catch the keystrokes.
Easier, slightly different way is to handle TVN_ENDLABELEDIT notification. In the handler, you can verify the text typed into edit control. If verification fails, you'd display msgbox with appropriate text, then call CTreeCtrl::EditLabel.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|