Re: VC6 serial port usage in a tabbed dialog application
On Fri, 26 Oct 2012 18:12:13 -0700 (PDT), ScottMcP [MVP] wrote:
Please show me what I need to put into the Web1a.h and Web1a.cpp to use the
pointer to port from the main Dialog?
My reply of Oct 18 in your other thread did exactly that.
Here is what Scott sent me on the 18th.
===========================================================================
You can directly call a function in the child dialog. For example, one of
your child dialogs is m_dWeb1a. If you add a function in that dialog called
SetComPort then this will call it:
m_dWeb1a.SetComPort(port);
===========================================================================
Like I said before, I use SerialCom class for serial port usage.
I include SerialCom.cpp and SerialCom.h in my project.
In the main Dialog I do:
CSerialCom port // and use the port functions afterwards.
I tried creating the function in Web1a
In the .h file I tried different things with compiler errors.
class Web1a : public CDialog
{
// Construction
public:
Web1a(CWnd* pParent = NULL); // standard constructor
bool SetWeb1ComPort(HANDLE pport); //don't know what pport should be
// declared as?
//I also tried bool SetWeb1ComPort(CSerialCom port)
And in Web1a.cpp I added:
bool SetWeb1ComPort(HANDLE pport)
{
port = pport; //not sure what to do here either?
return true;
}
In the main dialog I know I have to add:
m_dWeb1a.SetWeb1ComPort(port); //or something like this?
Please help me out here...