Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialog based application scoping problem

Status
Not open for further replies.

RCJones

Programmer
May 28, 2002
2
NZ
I have a problem that has got me stumped, but I suspect it has a straight-forward solution.

The application is dialog-based, and contains an array of bytes. When the user clicks the "Transmit" button, another dialog opens allowing the user to select some options. Finally, they click the "Send" button of the transmit dialog, and the data is to be output (in this case, serial).

The problem is that the array of bytes is a member of the application dialog, and so is out of scope to the transmit dialog. Thus references to the data array in the transmit dialog won't compile.

In a Document/View based application, the view could obtain a pointer to the document and thereby gain access to the document's data members. Can anyone show me how to achieve similar access in my dialog-based application?

Thanks!

R Jones

 
Send a Message back to the Application Dialog.
see
BUT I got along fine doing this for "PrintME" - I send a message from a child dialog to the main dialog, which knows the CWnd of the child and so can print it. However one day this print routine wouldn't "end page" so I simply cut&paste the 150 lines of code(!) to print a CWnd - now the project has 2 copies of that code, but, hey, whatever works.
In a perfect world that 150 lines would be one line "Print(this...)"
.....Sigh...
abing734@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top