Jump to content
The simFlight Network Forums

FSUIPC and MFC with VS 2008 (C++)


Recommended Posts

Hi,

after a long absence I am playing around again a bit with FSUIPC and FS9. In former times using VC 6 C++ I didn't have any problems implementing the required header (FSUIPC_User.h) and library files into my project. But with the newest version of VC++ I cannot get the compiler to succesfully compile my project. It always complains about LIBC.lib, which cannot be opened. I' ve already found out, that this library isn't longer used in the newer versions of VC++ but then how do I compile my project? Thanks in advance... .

Greets, Benny

Link to comment
Share on other sites

But with the newest version of VC++ I cannot get the compiler to succesfully compile my project. It always complains about LIBC.lib, which cannot be opened. I' ve already found out, that this library isn't longer used in the newer versions of VC++ but then how do I compile my project? Thanks in advance... .

Since the complete C source for the FSUIPC interface is supplied in the SDK, you can simply adapt it or recompile it to suit whatever compiler environment you have. This is why the whole thing is supplied. It has been used successfully with many other compilers, and translated into other computer languages, as some of the additional contributions in the SDK attest. If you still want to use the LIB, recompile it with your compiler. Or just incorporate the source into your program.

There's also a DLL version, if you prefer, kindly contributed by another user. See this thread:

viewtopic.php?f=54&t=75706

You'll find the DLL in an attachment near the end. I've not had a chance to try it yet, so if you do please let me know how you get on.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

I finally managed to get around this LIBC.lib mess by including the library routines into my code, improving the code to match the VC++2008 compiler and thus making it possible to compile my file...but: I cannot make contact to FSUIPC! It always returns error code 13 which means "IPC request contains bad data". Could you give me a little heads up as what is basically meant by that? Does it mean that someone in my code is wrong? Man...I'd love to have VC++ 6 back :D !

Thanks in advance!

Greets, Benny

Link to comment
Share on other sites

I cannot make contact to FSUIPC! It always returns error code 13 which means "IPC request contains bad data". Could you give me a little heads up as what is basically meant by that?

It means that the data in the memory-mapped file is not in the correct format, the one defined in the fs6ipc.h header. There's one format for reads and another for writes. Use your debugger to break into your program during the assembly of data by FSUIPC_Read and FSUIPC_Write to make sure it is building the data correctly. There also needs to be a zero DWORD at the end of the list of requests.

Make sure you set the options for structures to have single byte alignment.

Regards

Pete

Link to comment
Share on other sites

Thanks very much for your description! I've found what was wrong rather fast. During my trys to implement the library functions directly into my code it seems I've cut something within the creation of the file mapping object. Now, I can succesfully connect. Hopefully I can now start with what I am willing to do :D !

Thanks again for your fast help!

Greets, Benny

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.