Doug Moldenhauer Posted January 11, 2009 Report Posted January 11, 2009 I have a question regarding implementing FSUIPC SDK Code. I have been implementing the code with Visual C++ 6.0 and using MFC, and I have a fairly large program that I'm using and I tried to convert it to 2008 Express however I get alot of compile errors. I'd really like to use the Express 2008 version as it has a much better toolbox for developing nice looking Dialogs or Forms. I tried to create a new project using CLR and windows forms but it won't compile the FSUIPC.CPP and the FSUIPC.h without a bunch of errors. I noticed a .NET module in a pinned post above and tried to implement that. I did have success at adding the reference to the dll, and it does compile and run. I just put together a simple program to open a connection to fsuipc. #pragma once namespace test { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace FSUIPC; public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); } protected: ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::Button^ button1; protected: private: System::Windows::Forms::Button^ button2; private: System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code void InitializeComponent(void) { this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->SuspendLayout(); // // button1 // this->button1->Location = System::Drawing::Point(48, 209); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(75, 23); this->button1->TabIndex = 0; this->button1->Text = L"button1"; this->button1->UseVisualStyleBackColor = true; // // button2 // this->button2->Location = System::Drawing::Point(163, 209); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(75, 23); this->button2->TabIndex = 1; this->button2->Text = L"button2"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click); // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(292, 266); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Name = L"Form1"; this->Text = L"Form1"; this->ResumeLayout(false); } #pragma endregion private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { FSUIPCConnection::Open(); } }; } I havn't used 2008 express much and it is quite a bit different to Visual C++ 6.0. The above compiles and runs, however in my application I need 3 different connections, and I'm unable to figure out how to do that using the FSUIPCClient.dll reference method. My old program just creates 3 instances of the FSUIPC Object, and then opens it up for communications. I was wondering if someone might give me a idea as to how to create 3 instances of the FSUIPCConnection? I think I'll be able to figure the rest of it out once I'm able to do that. Or give me a Idea on another method as to how I might implement FSUIPC using 2008 Express? I would like to use CLR Windows forms to create my Forms for data display and input. Thanks in advance.
Recommended Posts