Article View: comp.os.ms-windows.programmer.misc
Article #2805HELP: passing data between windows
From: hamiltod
Date: Fri, 15 Dec 1995 04:58
Date: Fri, 15 Dec 1995 04:58
97 lines
2755 bytes
2755 bytes
Borland C++ 4.02
I am trying to pass data between the child window its parent.
The parent window will be processing data from the serial port via a VBX module (TVbxsaxComm).
The child window(s) will be displaying the processed data.
The children and parent are constantly updating via the WM_EV_TIMER.
I need an update time of 1 second.
What is the easiest way to accomplish this?
Does anyone have a sample of code?
Any good books with an example?
I have included part of an example that I used from
Mastering Windows Programming with Borland C++4 by Tom Swan.
I would like to get this basic example working before attacking the main project
Thank You
Dennis
// ===========================================================
// The MDI child window class
// ===========================================================
class TDemoChild: public TMDIChild{
public:
TDemoChild(TMDIClient& parent); // Default constructor
TDemoChild(TMDIClient& parent, const char far *name);
void SetupWindow();
private:
string filename;
char sOutput[100];
BOOL bEven;
protected:
void EvPaint();
void EvTimer( UINT TimerId );
DECLARE_RESPONSE_TABLE(TDemoChild);
};
// ===========================================================
// The MDI client window class
// ===========================================================
class TDemoClient: public TMDIClient {
public:
//TDemoClient(): TMDIClient() {} // short hand constructor
TDemoClient();
protected:
virtual TMDIChild* InitChild();
void SetupWindow();
void EvPaint();
void EvTimer( UINT TimerId );
private:
char sOutput[100];
BOOL bEven;
DECLARE_RESPONSE_TABLE(TDemoClient);
};
// ===========================================================
// The MDI application class
// ===========================================================
class TDemoApp: public TApplication {
public:
TDemoApp(const char far* name)
: TApplication(name) {}
void InitMainWindow();
private:
TDemoClient* client;
};
// Initialize the program's main window
void
TDemoApp::InitMainWindow()
{
client = new TDemoClient;
MainWindow = new TMDIFrame("MDI Application Demo",
ID_MENU, *client);
}
#pragma argsused
// Main program
int
OwlMain(int argc, char* argv[])
{
TDemoApp app("MDIDemoApp");
return app.Run();
}
Technical Details
Message-ID:
<4aqva1$u3o@huey.cadvision.com>Path:
arc1-ca.pugleaf.net!huey.cadvision.com!usenetShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!huey.cadvision.com!usenet From: hamiltod@cadvision.com (hamiltod) Newsgroups: comp.os.ms-windows.programmer.misc,comp.lang.c++,comp.os.ms-windows.programmer.tools.owl Subject: HELP: passing data between windows Date: 15 Dec 1995 04:58:41 GMT Organization: CADVision Message-ID: <4aqva1$u3o@huey.cadvision.com> NNTP-Posting-Host: 204.50.229.69 X-Newsreader: WinVN 0.92.6+