|
|
Thankyou very much. Just what I needed.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
I am writing a class to display a grid in a view. This is not a database grid, but a grid that graphically illutrates which elements of a 35 element laser beam have been triggered over time.
So the width of the grid is 35 elements wide (constant) but the height is variable over time. I need to store the data to represent the state of each block within the grid (triggered = display grid element in blue OR not triggered = display grid element in gray for instance).
My plan is to store the the 35 element grid row in a:
vector<bool> Grid_Row;
since the size is predetermined, and store the collection of vectors in a deque:
deque < vector<bool> > Grid_Deque;
This works fine as it stands, but now I have to attach a time indicator to each row. My first plan was to convert the deque of vectors to a deque of structs (which would contain the vector and a timing variable:
struct GridRow
{
UINT time;
vector <bool> gridRow;
};
GridRow gr;
deque < gr > Grid_Deque;
Unfortunately this is not working to well.
Can someone help with this. Maybe tell me how to get this working(if it is possible) or maybe suggest a better solution.
Thanks
-Merle
|
|
|
|
|
deque < gr > Grid_Deque; Maybe I'm totally obfuscated, but ain't this to be
deque < GridRow > Grid_Deque; ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Merle Pittman wrote:
Unfortunately this is not working to well.
The code doesn't compile? Monitor explodes when program runs? Something else?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
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
|
|
|
|