Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi, i would like to ask, is the FSUIPC Client DLL usable in C++ CLR ? Im currently developing it using C++ CLR Winform to develop a software and i am looking to find gate number and if user is at the airport or gate etc. I tried importing to reference but cant seem to use it.

 

Posted

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 

Posted

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

Posted
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.

Posted
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.

Posted

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

Posted

Hi paul,

Thanks for the advice. I am testing this on MSFS and it works. I used the MAkeRwy from P3D and try it on MSFS and it seems to work. IT detects if player is at gate or not at gate.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.