Jump to content
The simFlight Network Forums

Program using FSUIPC calling a dll using FSUIPC


Recommended Posts

Found

Just had to change the line

wsprintf(szName, FS6IPC_MSGNAME1 ":%X:%X:DLL", GetCurrentProcessId(), nTry);

in the dll. Pretty obvious solution.

Sorry. I'm a little lost. I like the fact that you have solved a problem, but is this something I should deal with in the SDK?

Best Regards,

Pete

Link to comment
Share on other sites

I have a program called FSAcars. This program uses FSUIPC. In this version it accepts plugins (dll that the program calls). This dll can also use FSUIPC.

1- Since the dll aren't made by me and not my responsability if they use FSUIPC then they should manage FSUIPC calls if they want to use it.

2 - The FSUIPC open function uses a file with the name given by the process name (to ensure that is unique) plus the retry name. The problem is that the dll and the program bellong to the same process so the name is the same. To ensure that there isn't any problem this name must be changed.

The original file name in the DLL = program file name:

wsprintf(szName, FS6IPC_MSGNAME1 ":%X:%X", GetCurrentProcessId(), nTry);

The new name in the DLL

wsprintf(szName, FS6IPC_MSGNAME1 ":%X:%X:DLL", GetCurrentProcessId(), nTry);

A different problem: offset 1400 payload changes.

Noticed that it only changes the aircraft weight reported by FSUIPC if you go in to "Change Payload menu" and press ok . Without pressing the ok the plane weight reported by FSUIPC stays the same as before the offset 1400 write.

Thanks

José

Link to comment
Share on other sites

The problem is that the dll and the program bellong to the same process so the name is the same. To ensure that there isn't any problem this name must be changed.

Oh, I see! You actually have two distinct memory-mapped files for transferring the data between the same two processes! Ugh. How inefficient.

But, yes, the specific filename doesn't matter, provided it contains the process ID in the right place. I think that even that doesn't matter if it's only ever used with a user registered version of FSUIPC.

A different problem: offset 1400 payload changes.

Noticed that it only changes the aircraft weight reported by FSUIPC if you go in to "Change Payload menu" and press ok . Without pressing the ok the plane weight reported by FSUIPC stays the same as before the offset 1400 write.

Ah. There's some routine that needs calling, then, to get the change distributed to the right places in FS. Does this apply to all three weights (30C0, 30C8 and 3BFC)? Does the balance (trim) of the aircraft change? (CG% at 2EF8)?

Sorry, I just mapped offsets to things I found, or found by others and notified to me. If some extra processing is then necessary I would need to trace through what happens after you "ok" the dialogue.

Regards,

Pete

Link to comment
Share on other sites

Hi

I know that is inefficient and I could pass the FSUIPC class address to the DLL as I did in the loader plug-in that I was trying to do, avoiding the double open, the only thing is that I don't have control over the dll code. Let's see if someone starts to do plug-ins.

Tested the positions and didn’t detect any change. It could be a good method to change the plane weight, since it avoids the aircraft reloads that the loaders need. As far I saw it preserves the distances specidfed in the aircraft.cfg wich is good also.

Thanks again

José

Link to comment
Share on other sites

Tested the positions and didn’t detect any change. It could be a good method to change the plane weight, since it avoids the aircraft reloads that the loaders need. As far I saw it preserves the distances specidfed in the aircraft.cfg wich is good also.

Sorry, I'm confused (again! :wink: ). "Good method to change the plane weight"? How? I thought this was the problem, that changing these things has no effect?

Pete

Link to comment
Share on other sites

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.