Thread View: comp.os.ms-windows.programmer.misc
1 messages
1 total messages
Started by hamiltod
Fri, 15 Dec 1995 04:58
HELP: passing data between windows
Author: 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();
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads