Hi guys, I'm trying to link a Micro-controller board to my C++ program to control the relays on it. The vendor provided a test software in VB that involved entering the COM port number (4 in my case) and clicking a button to sync up with it, the full software and info on the board is here: [http://www.oceancontrols.com.au/KTA-223.html] under the link 'VB6 test software' link (I've also include .txt attachments of the VB code). I've tried converting the code to C++ along with using namespaces, etc, but I seem to have hit some problems. The code is pretty long so I'll post the relevant things and the errors.
Namespaces being used
Code:
using namespace System;
using namespace System::ComponentModel::Container;
using namespace System::ComponentModel;
using namespace System::Windows;
using namespace System::Windows::Forms;
For the above code, I got the following errors:
error C3083: 'Windows': the symbol to the left of a '::' must be a type
error C3083: 'Forms': the symbol to the left of a '::' must be a type
error C2039: 'Form' : is not a member of 'System'
error C2504: 'Form' : base class undefined
error C2470: 'internal' : looks like a function definition, but there is no parameter list; skipping apparent body
error C3861: 'InitializeComponent': identifier not found
error C2039: 'components' : is not a member of 'zebra'.\zebraDlg.cpp(44) : see declaration of 'zebra'
'ComponentModel': the symbol to the left of a '::' must be a type
and many others. I suspect I may gave failed to include something or that my syntax symbols and function calls are in error.
Lastly, the button that reads the COM port number from a text box to sync with the device (code below).
For the button control, I get errors like
error C2227: left of '->Close' must point to class/struct/union/generic type
error C2227: left of '->PortName' must point to class/struct/union/generic type
and others all dealing with the '->' symbols.
I'm not really sure what the compiler is telling me but I suspect it is just a few lines I may not have. Can anyone help? The VB code I derived it from is from the link above. Thanks a lot in advance!! I'm using MFC to build the GUI.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.