jcboliveira Posted August 29, 2004 Report Posted August 29, 2004 Hi Pete I have a oprogram that uses FSUIPC that calls a dll (dynamic loaded) that also uses FSUIPC. If I not open FSUIPC connection in the dll I get error 9 however if I try to open I have error 5. What am I missing? Thanks a lot José
jcboliveira Posted August 29, 2004 Author Report Posted August 29, 2004 Found Just had to change the line wsprintf(szName, FS6IPC_MSGNAME1 ":%X:%X:DLL", GetCurrentProcessId(), nTry); in the dll. Pretty obvious solution. Thanks José
Pete Dowson Posted August 29, 2004 Report Posted August 29, 2004 FoundJust 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
jcboliveira Posted August 29, 2004 Author Report Posted August 29, 2004 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é
Pete Dowson Posted August 29, 2004 Report Posted August 29, 2004 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
jcboliveira Posted August 29, 2004 Author Report Posted August 29, 2004 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é
Pete Dowson Posted August 30, 2004 Report Posted August 30, 2004 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
jcboliveira Posted August 30, 2004 Author Report Posted August 30, 2004 "It could be.." but it doesn't work 8) After some more tweaking around found out that updating large number of stations could crash FS when you go to the menu. Regards José
Pete Dowson Posted August 30, 2004 Report Posted August 30, 2004 After some more tweaking around found out that updating large number of stations could crash FS when you go to the menu. So I should make them read-only? Easy enough. Pete
jcboliveira Posted August 30, 2004 Author Report Posted August 30, 2004 So I should make them read-only? Easy enough. I think that is better. José
Pete Dowson Posted August 30, 2004 Report Posted August 30, 2004 So I should make them read-only? Easy enough. I think that is better. José Well, if I get time I may look to see if I can call whatever it is to make them take effect, first. If I can't do that I will make them read-only. Thanks, Pete
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now