Jump to content
The simFlight Network Forums
Doc

FSUIPC and Airport Design Editor (ADE)

Recommended Posts

Hi everybody,

I've got a little problem between FSUIPC and ADE (Airport Design Editor).

I already posted this issue on the ADE forum and the developpers of ADE don't know how to resolve this.

ADE is a well known tool for Flight Simulator intended to build airports.

Connection between ADE and FSX is made through FSUIPC.

I'm a registered owner of FSUIPC and WIDEFS and I use version 4.60a with FSX Acceleration.

When I try to connect ADE and FSX, I get an error message concerning FSUIPC, and the author of ADE doesn't know what it means.

Instead of trying to explain what it says, I give you the link of my post on the ADE forum, it will be clearer,because I posted screenshots of the problems.

Hoping you can help ADE developpers and I to resolve this issue.

Thanks :smile:

Share this post


Link to post
Share on other sites

When I try to connect ADE and FSX, I get an error message concerning FSUIPC, and the author of ADE doesn't know what it means.

Odd, because the error message comes from his program, reporting an error detected in the application part of the interface, for which he can easily check because the source is available. In fact if it is reproducible it is debuggable because of that.

Instead of trying to explain what it says, I give you the link of my post on the ADE forum, it will be clearer,because I posted screenshots of the problems.

Just the messages would have been as good, if not better.

The "already open" one has go to be because of two or more attempts to open. The original error, however, would need debugging. The only problem I know which is not always obvious is when someone is running FSX at one privilege level and the Application at another. In other words, running FSX "as administrator" but ADE not, or vice versa. Windows then prevents the two exchanging data. I did try to program a way around that in later versions, but I see you are still on the main 4.60a release. You could try 4.669 (see Download Links subforum), but really first make sure you are running everything at the same privilege level.

Regards

Pete

Share this post


Link to post
Share on other sites

Thank you Pete,

I'm using FSX with admin privileges, so I will check for ADE, I'm not sure.

I've just downloaded your latest version of FSUIPC and Wideclient and I will try this at home after my job.

It seems you changed the title of the FSX window when used with widefs. I think it's a good thing, because I already had connection problem with fencebuilderpro utility which check the fsx window title to connect. Mine was "Microsoft Flight Simulator X waiting for wideserver client" and it didn't match with the FencebuilderPro request. FBP developper kindly made a special launcher for me and now it works well.

Thank you

Share this post


Link to post
Share on other sites

Odd, because the error message comes from his program, reporting an error detected in the application part of the interface, for which he can easily check because the source is available. In fact if it is reproducible it is debuggable because of that.

Well I might debug it if I could reproduce it. I have never seen this error while working here with ADE and FSUIPC so I was hoping for an explanation of what the error means. ADE catches exception messages coming back when it tries to connect. It is using the Managed Wrapper for FSUIPC that was originally posted here - so perhaps the error message comes from there. I have checked to see if it is possible to get this error via a double click on the connection button in ADE but it is not.

Share this post


Link to post
Share on other sites

I'm using FSX with admin privileges, so I will check for ADE, I'm not sure.

Unless you installed FSX in its default "Program Files" place you shouldn't need to run it "as administrator". That's really only needed when you are running other programs which have to be able to access its folders -- folders in "Program Files" being write protected. And then the have to run everything "as administrator".

It seems you changed the title of the FSX window when used with widefs.

If WideFS is enabled it ALWAYS adds details to the FS title bar. That's been the case, with no change in the display, since WideFS was first published in its current form, in FS2000 days.

Pete

Share this post


Link to post
Share on other sites

Well I might debug it if I could reproduce it.

Yes, i understand that. When I get such situations I have to insert extra logging to get more information.

I have never seen this error while working here with ADE and FSUIPC so I was hoping for an explanation of what the error means. ADE catches exception messages coming back when it tries to connect.

Yes, but the check which results in the error is in your process, your part of the code, not in FSUIPC. The source for it is provided in the SDK. Error #12 is defined, in the IPCuser.h header file as folows:

#define FSUIPC_ERR_SENDMSG	12	// IPC sendmessage failed all retries

and is detected here:

	// send the request (allow up to 9 tries)
	while ((++i < 10) && !SendMessageTimeout(
			m_hWnd,   	// FS6 window handle
			m_msg,    	// our registered message id
			m_atom,   	// wParam: name of file-mapping object
			0,        	// lParam: offset of request into file-mapping obj
			SMTO_BLOCK,   // halt this thread until we get a response
			2000,		  	// time out interval
			&dwError))	// return value
	{	Sleep(100); // Allow for things to happen
	}

	if (i >= 10) // Failed all tries?
	{	*pdwResult = GetLastError() == 0 ? FSUIPC_ERR_TIMEOUT : [color="#ff0000"][b]FSUIPC_ERR_SENDMSG[/b][/color];
		return FALSE;
	}

So it occurs not due to timeouts (which can happen if something causes FS to stop FSUIPC getting any messages for long enough), but because the call actually fails. I suppose better information would be obtained if my code did something with the error number returned by GetLastError, but it really never happened (before the days of Vista and Win7 and privilege levels).

You seem to have described it as "error sending message" which is a little vaguer. Is this why you don't understand what it means?

The other one, the "already open", shouldn't arise normally -- on the first failure, the failed exit from the FSUIPC_Process call in the FSUIPC_Open should have closed the Memory Mapping stuff via FSUIPC_Close. Maybe the Managed code (which I don't know) is missing something?

The other odd thing reading a bit more of the thread is that someone said the connection must have been made because the aircraft position is shown ...? If that's true, then possibly the failure somehow occurred during a successful connection, and your program or the managed code attempted to re-do the link without closing the current one. But if this is indeed the truth of the matter, I really have no idea why the SendMessageTimeout would have failed -- unless possibly Windows failed it because FS had hung or was closing, so the addressed Window was inaccessible.

Regards

Pete

Share this post


Link to post
Share on other sites

I think the program is using my .NET DLL. It's looks like my error message.

The first error (#12) is thrown under the same circumstances as the C source; that is, the GetLastError() being other than 0. So it's the same error, just my wording "Error sending message" along side the original C SDK enum value.

The "Already Open" message is almost certainly because my DLL thinks the connection is still open after it failed. In other words, when the application caught the first "Error sending message" exception it didn't call FSUIPCConnection.Close() to close the now bad connection. Therefore any attempt to open the connection again will result in the "Already open" error you are seeing.

I could add some extra information to that first exception to return the result of GetLastError(). This may help identify what the underlying problem is. Let me know if you want me to do that, or if there is any other way I can help.

Paul

Share this post


Link to post
Share on other sites

Ok I'm at home now.

I tried ADE with admin rights and the problem is solved, I can connect FSX to ADE!

My FSX isn't in program files directory, it is apart on another HDD.

I'm going to install your last version of FSUIPC and wideclient now.

Thanks for all, I can go on working on LFRC.:-P

Share this post


Link to post
Share on other sites

I tried ADE with admin rights and the problem is solved, I can connect FSX to ADE!

My FSX isn't in program files directory, it is apart on another HDD.

In that case why are you running FSX with admin rights? It really isn't needed. I've never done so on any system.

Pete

Share this post


Link to post
Share on other sites

I don't really know. I thought I could avoid rights problems this way. I'm going to set FSX (and ADE) with user rights and see if it works !

Thanks again for your help Pete

Share this post


Link to post
Share on other sites

I think the program is using my .NET DLL. It's looks like my error message.

The first error (#12) is thrown under the same circumstances as the C source; that is, the GetLastError() being other than 0. So it's the same error, just my wording "Error sending message" along side the original C SDK enum value.

The "Already Open" message is almost certainly because my DLL thinks the connection is still open after it failed. In other words, when the application caught the first "Error sending message" exception it didn't call FSUIPCConnection.Close() to close the now bad connection. Therefore any attempt to open the connection again will result in the "Already open" error you are seeing.

I could add some extra information to that first exception to return the result of GetLastError(). This may help identify what the underlying problem is. Let me know if you want me to do that, or if there is any other way I can help.

Paul

Paul

You are correct that I am using your .NET dll so I guess I am reporting your exception message. I guess I also need to add some more code?

Share this post


Link to post
Share on other sites

I guess I also need to add some more code?

All I would suggest is to make sure that all your calls to Process() are wrapped in a Try..Catch block. In the Catch for the FSUIPCException type, make sure you call the FSUIPCConnection.Close() method after reporting the failure. This will enable your application to re-open the connection again.

Paul

Share this post


Link to post
Share on other sites

All I would suggest is to make sure that all your calls to Process() are wrapped in a Try..Catch block. In the Catch for the FSUIPCException type, make sure you call the FSUIPCConnection.Close() method after reporting the failure. This will enable your application to re-open the connection again.

Paul

Checking my code - as far as I can see that is what is happening. The call to Process() occurs only in two places throughout my code. Each is wrapped in a try..catch block. Where an exception is raised I carry out house keeping to close the connection including calling FSUIPCConnection.Close().

Share this post


Link to post
Share on other sites

Checking my code - as far as I can see that is what is happening. The call to Process() occurs only in two places throughout my code. Each is wrapped in a try..catch block. Where an exception is raised I carry out house keeping to close the connection including calling FSUIPCConnection.Close().

OK, that sounds fine then. It was just something to check as the most likely cause of the 'already open' error.

Paul

Share this post


Link to post
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...

×
×
  • 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.