Jump to content
The simFlight Network Forums

FSUIPC Client for C++


 Share

Recommended Posts

I don't use C++ but I had some users in the past using the DLL in a C++ project so it is possible.

Can you say more about what the problem is exactly? Are there error messages? Does your project compile? Did the DLL install OK from NuGet?

I had tried here but I couldn't get it to install from NuGet. That could be because I don't know anything about configuring the options in C++.

Paul 

Link to comment
Share on other sites

2 hours ago, Paul Henty said:

I don't use C++ but I had some users in the past using the DLL in a C++ project so it is possible.

Can you say more about what the problem is exactly? Are there error messages? Does your project compile? Did the DLL install OK from NuGet?

I had tried here but I couldn't get it to install from NuGet. That could be because I don't know anything about configuring the options in C++.

Paul 

Hi Paul,

As now, i am having problem trying to get the IsPlayerAtGate. Reason why i dont use C# to code is because of reverse engineering that is why im using C++ CLR WinForm. Anyway, the issue i am having right now is the getting gate id to be displayed in the drop downlist.

I can't seem to get Select to be working because there is not such extension. I believe Select is using Linq? Im not to sure.

this->gatedropdwn->Items->AddRange(selectedAirport->Gates->ToArray());

This code below will always give & print out NULL. The code below in at the Timer so it will check.
 

FsGate ^gate = this->selectedAirport->Gates[this->gatedropdwn->Text];
	if (gate != nullptr)
	{
		if (gate->IsPlayerAtGate)
		{
			atgatestatuslbl->Text = "At Gate";
		}
		else
		{
			atgatestatuslbl->Text = "Not at gate!";
		}
	}
	else
	{
		cout << "Null";
	}

Hope to get your help here.

Link to comment
Share on other sites

2 hours ago, Thomas Richter said:

Hi Paul,

I got that work years ago just for testing but never used it later with C++ CLR.

C++ CLR is the C++ fully based on .Net, not native C++, that's why you use still the .Net framework like WinForm.

Thomas

Hi Thomas,

 

i have give a sample code about the problem im having.

Link to comment
Share on other sites

Looking at this line of code:

FsGate ^gate = this->selectedAirport->Gates[this->gatedropdwn->Text];

What is the Text property returning? The Gates[] collection requires you specify the ID of the Gate. Is that what the dropdown is showing? If the dropdown is displaying the ToString() result then that will also contain the Gate Type in (). This will not work with the Gates collection indexer.

However, getting the gate like this seems unnecessary. Looking at this line:

this->gatedropdwn->Items->AddRange(selectedAirport->Gates->ToArray());

It looks like your dropdown has an array of Gates at the data source. So you should be able to get the SelectedItem from the dropdown. That will be the FsGate object:

FsGate ^gate = (FsGate)this->gatedropdwn->SelectedItem;

 

LINQ is used internally, but that's part of the System.Core DLL so it should work fine.

If you can't use LINQ then you can just search through the collections manually with a for..next or do..while type of loop.

Paul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.