Jump to content
The simFlight Network Forums

Question: Writing an internal module with the Java kit


Recommended Posts

I'm writing an FSUIPC module, and I know Java well, and C++ very shakily, so I'm trying to write the module in Java.

I can see how most of it works, but I just have one question. The Open method built into the fsu_wrapper class, does it automatically do the Open2 call for the internal module access?

Can I even write an internal module with Java? I've got a partner on the project whose C++ knowledge is better than mine, but not as good by far as my Java knowledge, so I'm trying to stick to Java, but I can fall back on C++ if necessary.

(Hope this wasn't a really stupid newbie question)

BradenShep

Link to comment
Share on other sites

I can see how most of it works, but I just have one question. The Open method built into the fsu_wrapper class, does it automatically do the Open2 call for the internal module access?

No. All of the separate language packages in the SDK are aimed at external program writers. The only internal stuff is that in the ZIP for it, and it revolves around C, because that was the only support provided by Microsoft. The methods of module writing are derived from Gauge writing, for which MS provided an SDK. Until recently this was C (or C++ just about, with much care I would think) only, though you can also do XML gauges now.

I don't really know how you'd go about making the structures work correctly for a module in another language, but then I don't really know any others than C and ASM.

Either way, you will need to change the innards of whatever "wrapper" you are using, or write your own, to not only use the Open2() call but also, of course, supply the memory it needs for the data exchanges.

Regards,

Pete

Link to comment
Share on other sites

Can I even write an internal module with Java? I've got a partner on the project whose C++ knowledge is better than mine, but not as good by far as my Java knowledge, so I'm trying to stick to Java, but I can fall back on C++ if necessary.

I think you might end up having to write some sort of JNI interface either into FSUIPC, or into a custom DLL of your own that then talks to FSUIPC. To me, anything with JNI is a special and perverse form of masochism, bur your mileage may vary.

Cheers!

Luke

Link to comment
Share on other sites

Everyone, thanks.

Luke, I agree with you completely. I can't think of many more cruel and evil tasks than JNI programming. I'd rather learn enough C to stay afloat and write it in that than delve into JNI. In fact, if I had to learn C while being repeatedly hit around the head, I'd still rather learn the C :p.

hm! Thanks so much for that link. I found a very simple example of his on how to write an internal module. I've got it set up to do a quick test now, all I need is my access code.

Thanks to everyone who helped me out.

Braden

Link to comment
Share on other sites

Really? I never got it. I've sent you another email.

There's something odd going on here -- I saw your new email flash up on my MailWasher program as suspicious (highlighted in Red) and before I could get it it was deleted from my mail server. Seems like someone somewhere does not like your email address!

I am sending the original email containing the Key again. Let me know.

Regards,

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.