|
Hi,
I've a function in CMainFrame class which shows a progress bar in the status bar.
<br />
void CMainFrame::showProgress()<br />
{<br />
<br />
RECT MyRect;<br />
m_wndStatusBar.GetItemRect(1, &MyRect); <br />
m_ctrlProgress.Create(WS_VISIBLE|WS_CHILD, MyRect, <br />
&m_wndStatusBar, 1); <br />
<br />
m_ctrlProgress.SetRange(0,100); <br />
m_ctrlProgress.SetStep(1);
<br />
<br />
for (int I = 0; I < 100; I++)<br />
{<br />
Sleep(10);<br />
m_ctrlProgress.StepIt();<br />
}<br />
}<br />
Now, I wish to access this progress bar from my CView class.
This application uses sockets and whenever I receive a new message I wish to show the some activity in the progress bar.
|
|
|
|
|
AfxGetMainWnd() returns the main window, you just need to cast it to be a CMainFrame.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
(Newbie-Warning!)
Hi,
Is there anyone that got a short sample code on how to edit/modify the contents of an external binary file at an exact position?
I've read some articles on how to modify ASCII files, but when it comes to binary files and modifying data in an exact offset location (like a hexeditor)... I'm stuck...
Regards,
Johan
|
|
|
|
|
fopen(filename, "wb");
fseek(pos, offset);
fwrite(data, size, count, filePointer);
fclose(filePointer);
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
Thanks for your quick help!
I'm now heading for my keyboard to try it out!!
/Johan
|
|
|
|
|
If I have a class A, I can also create a class within it called B. Is there any practical use for this? To illustrate my question I will give an example.
<br />
class A<br />
{<br />
int m_nMemberOfA;<br />
<br />
class B<br />
{<br />
public:<br />
void MethodOfB();<br />
};<br />
};<br />
<br />
...<br />
<br />
void A::B::MethodOfB()<br />
{<br />
...<br />
}<br />
Can B gain access to the member variables of A or anything like that without having to pass the "this" pointer?
Thanks in advance,
Clint
|
|
|
|
|
clintsinger wrote:
Can B gain access to the member variables of A or anything like that without having to pass the "this" pointer?
No, of course not. What would happen if they both had an int called a ?
You'd encapsulate one class within another if it existed solely as a helper for that class, if only class A had a need to create instances of class B. Then you could make it private or protected in class A, and control the fact that only class A could make them.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I think your question is, are nested classes in C++ like inner classes in Java? The answer is no. Offhand, I'd say they are much like static nested classes in Java.
The purpose of nested classes is to express scoping of names.
|
|
|
|
|
Does anyone know how to write data to cd-r drives using IoControl codes in the platform sdk??
|
|
|
|
|
The fact that several expensive SDK's exist to do this suggests to me that it is not an easy task.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Check out the Image Mastering API (IMAPI)
available now under WinXP.
|
|
|
|
|
Was going to use that but it only works on XP not 2000/me/98 etc..
Thanks
|
|
|
|
|
Why have you asked this question three times ?
I'm fairly sure there is an example on the site. The app wizard also creates an app with one splitter, it should not be hard to increase the count to support four views, I would think.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I also try to find this on the site, but I can't got it. Could you mind tell me where can i find it?
|
|
|
|
|
I dunno, I thought I'd seen it. Maybe it was in MSDN.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
hello Everybody,
I am working on a project involving PCs as peer sensors on a network. The sensor can use ccd cameras (microscops), can process acquired images, can replicate data on an overlay network (P2P), can distribute processing (actually start, control and stop them remotely).
I'd like to create a object-oriented, component-oriented "generic" framework in C++... for sensors in general and for my application in particular. Also, I'd like to have some functionalities (Input, Processing, Networking...), as independent components, i.e. that can be used without the others (separate DLLs?).
Sensor Component
|
|- Input Component
|
|- Processing Component
|
|- Networking Component
|
|- Coordinator Component
MySensor Component : inherited from Sensor Component
|
|- Vision Component : inherited from Input Component
|
|- MyProcessing : inherited from Processing Component
|
|- P2P : inherited from Networking Component
|
|- MyCoordinator : inherited from Coordinator Component
How do I make such a framework? What tools are the easiest?
Where should I start?
Should I buy a book "creating our own framework for dummies"?
Any comments are welcome!!
Thanks a lot!
Bertrand Boichon
Research Assistant
Electrical & Computer Engr.
Oregon State University
|
|
|
|
|
Anonymous wrote:
I'd like to create a object-oriented, component-oriented "generic" framework in C++...
Your description suggests a class library, not the framework. What exactly do you mean by 'generic'? 'Generic' as in 'generic programming'?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I want to ask how to display four view at the same time(i.e. splitting), each views are come from different class?? (e.g view1, view2 view 3, view4)
|
|
|
|
|
You want to display in 2x2 or 4x1 or 1x4??
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
i WANT TO DISPLAY 2X2
THX!!!
|
|
|
|
|
Then you can try this
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT ,<br />
CCreateContext* pContext)<br />
{<br />
if (m_wndSplitter.CreateStatic(this, 2, 2) == FALSE)<br />
return FALSE;<br />
<br />
if (m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView1), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CView2), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CView3), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(1, 1, RUNTIME_CLASS(CView4), CSize(100, 100), pContext) == FALSE)<br />
return FALSE;<br />
<br />
return TRUE;<br />
}
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Thx you very much!!!
But when I execute it
it tell me
CView1 is not a class or namespace name
classCView1: undeclared identifier
CView2 is not a class or namespace name
classCView2: undeclared identifier
CView3 is not a class or namespace name
classCView3: undeclared identifier
CView4 is not a class or namespace name
classCView4: undeclared identifier
How can I solve it?
Sorry for I have many question!!!
|
|
|
|
|
CView1, CView2, ... CView4 are your 4 different views that you need to create. You need to replace them with the actual names of those view classes you created.
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
OK
Thx you very much!!!
I know how to do it right now^V^
|
|
|
|
|
How to add a scroll bar in CView? (MDI APP)
|
|
|
|