Jump to content
The simFlight Network Forums

FSX, how start program with FSUIPC ???


Recommended Posts

Bonjour à tous. Hi all

Je programme un logiciel pour un simulateur a vérins. et j'ai besoin de récupérer l'assiette des avions dans FSX.

j'utilise le logiciel Windev et je ne sais pas par où commencer.

je voudrais utiliser FSUIPC mais je ne sais pas quelles fonction utilisées avant de faire FSUIPC_Read et FSUIPC_Process.

Que faut-il utiliser comme fonctions pour se connecter à FSUIPC ?

Merci d'avance.

I program software for a simulator actuators. and I need to get aircraft information in FSX.

I use the software "Windev" and I do not know where to start.

I would like to use FSUIPC but I do not know what function to use before FSUIPC_Read and FSUIPC_Process.

witch functions could i use to connect FSUIPC?

sorry for my english, i'm french...

thanks

Link to comment
Share on other sites

I program software for a simulator actuators. and I need to get aircraft information in FSX.

I use the software "Windev" and I do not know where to start.

I would like to use FSUIPC but I do not know what function to use before FSUIPC_Read and FSUIPC_Process.

witch functions could i use to connect FSUIPC?

FSUIPC_Open, as described near wherever you found FSUIPC_Read and FSUIPC_Process. When your program finishes, use FSUIPC_Close.

Pete

Link to comment
Share on other sites

But it's before FSUIPC_Read that i dont know.

You OPEN the link to connect to FSUIPC. You do as many READs and WRITEs as you want for one cycle, with one PROCESS call to process them, per cycle. When your program finishes you do a CLOSE.

That is the sequence. There is no more to it.

I guess it must be one function to connect to FSUIPC before using the functions FSUIPC_OPEN.

because my program dont know where is FSUIPC dll.

Your program does not need to know where FSUIPC.DLL is -- it is running inside the FS process. The Open call connects to it using shared memory. You never call anything in FSUIPC.DLL directly.

maybe an API or dll ?

It sounds as if you haven't even downloaded and looked at the FSUIPC SDK, which contains all you need -- including example programs and LIBraries to link to, if you use C/C++. Please go get the SDK if you want to interface to fSUIPC.

Regards

Pete

  • Upvote 1
Link to comment
Share on other sites

Hi.

I use WINDEV (W-language), it's not in the SDK. http://www.windev.com/

and when i try to use exemples in C or VB, i don't understand.

That is the sequence. There is no more to it... ...The Open call connects to it using shared memory. You never call anything in FSUIPC.DLL directly.

Ok, i understand.

how open the link to FSUIPC ? which fonctions use ? i must connect to shared memory ?

with OpenFileMapping() or MapViewOfFile() for exemple ?

Thanks again :)

Link to comment
Share on other sites

Hi.

I use WINDEV (W-language), it's not in the SDK. http://www.windev.com/

and when i try to use exemples in C or VB, i don't understand.

Sorry, I've never heard of "Windev" nor "W-language".

how open the link to FSUIPC ? which fonctions use ? i must connect to shared memory ?

with OpenFileMapping() or MapViewOfFile() for exemple ?

How are you trying to use FSUIPC_Read and FSUIPC_Write if you cannot use FSUIPC_Open? They are all part of the same library.

Yes, the code for FSUIPC_Open uses the filemapping calls. The sources for the whole interface are provided in several languages in the SDK -- C, VB, Delphi at least. If you understand these calls, check the source. I can't do more that what is shown in the relevant source files!

Regards

Pete

Link to comment
Share on other sites

OK, so, i have to use fonction fileMapping.

like this one with other var of course.

m_hWnd = FindWindowEx(0+, 0+, "UIPCMAIN", Caract(0))

m_hMap = CreateFileMapping(+HFFFFFFFF, 0+, PAGE_READWRITE, 0+, MAX_SIZE + 256, szName)

m_pView& = MapViewOfFile(m_hMap, FILE_MAP_WRITE, 0+, 0+, 0+)

and after , i use FSUIPC_OPEN.....

that's it ???

Link to comment
Share on other sites

OK, so, i have to use fonction fileMapping.

like this one with other var of course.

m_hWnd = FindWindowEx(0+, 0+, "UIPCMAIN", Caract(0))

m_hMap = CreateFileMapping(+HFFFFFFFF, 0+, PAGE_READWRITE, 0+, MAX_SIZE + 256, szName)

m_pView& = MapViewOfFile(m_hMap, FILE_MAP_WRITE, 0+, 0+, 0+)

and after , i use FSUIPC_OPEN.....

that's it ???

No, not at all. FSUIPC_Open does all that for you! All you have to do is use FSUIPC_Open! That's the whole point! :-(

Either YOU have to do all your own code for the interface, OR you use the library facilities provided -- i.e. FSUIPC_Open, FSUIPC_Read, FSUIPC_Write, FSUIPC_Process and FSUIPC_close. The WHOLE of the interface is represented in those functions. YOU do not have to do ANY of it!!!

If you really want to do your own interface code instead, you need to do it all, not pick three Windows API calls out of FSUIPC_Open. All of the FSUIPC functions are interdependent.

If you are just learning to program from scratch here, I think you should be looking for a different project to start with. Otherwise please look at the examples provided in the SDK and stop trying to pull odd bits out to use separately. I cannot help you with that -- if you want to write your own interface library code, do so, but you'll need to do it all, not just bits of it!

Regards

Pete

Link to comment
Share on other sites

Hi.

OK. FSUIPC_OPEN, FSUIPC_READ, FSUIPC_PROCESS are be procedures. (fonction complete)

i can't use this fonction because for my program "Windev", he don't know the language C++ or VB.

I understand, in FSUIPC_OPEN, it contains fonctions of file mapping ! OK

i try to translate fonction FSUIPC_OPEN. VB >>> WINDEV

for Exemple :

In VB :

m_pView& = MapViewOfFile(m_hMap, FILE_MAP_WRITE, 0&, 0&, 0&)

IF m_pView& = 0 THEN

dwResult = FSUIPC_ERR_VIEW

FSUIPC_Close

FSUIPC_Open = False

Exit FUNCTION

END IF

In W_Language (Windev)

m_pView = API("KERNEL32","MapViewOfFile",m_hMap, "FILE_MAP_WRITE", 0,0,0)

SI m_pView = 0 ALORS

dwResult = "FSUIPC_ERR_VIEW"

FSUIPC_Close()

FSUIPC_Open = Faux

RETOUR

FIN

and if i succes, i give you my code for you insert this in your SDK if you want.

thanks

Link to comment
Share on other sites

if i succes, i give you my code for you insert this in your SDK if you want.

Okay. Thank you.

I've had a browse on the WinDev website. It looks quite interesting -- I'd never even heard of it before!

Shame they don't provide compatibility with the standard Microsoft LIB file format, else you could simply link the existing LIB file into your project and call the FSUIPC_ functions direct. They do allow direct links to Microsoft DLLs, so one other way would be to compile a DLL version of the FSUIPC Library.

[LATER]

The brochure on WinDev, on their website, clearly says that it supports C++ as well and that you can call routines in that language from your W-language code. So why not just use the C source from the FSUIPC SDK directly?

Regards

Pete

Link to comment
Share on other sites

Hi all.

I have a problem with SzName :

SzName = FS6IPC_MSGNAME1 + ":" + Val(API("Kernel32","GetCurrentProcessId"))+":" + nTry + Null

for me, SzName = FSASMLIB:IPC:2564:10 it's good or not good?

If not, what is the correct value to find?

Next,

m_hMap = API("KERNEL32","CreateFileMappingA","HFFFFFFFF", 0, "PAGE_READWRITE", 0, "MAX_SIZE" + 256, SzName)

m_hMap = 0

have you got an idea ?

Thanks you verymuch

Link to comment
Share on other sites

I have a problem with SzName

Really? Why do you think that? Looks okay to me. I assume it is in the correct character form for the Windows API you are calling with it (ASCII -- i.e. 8-bit character codes, not the 16bit codes? I can't tell as I don't know your programming language.

m_hMap = API("KERNEL32","CreateFileMappingA","HFFFFFFFF", 0, "PAGE_READWRITE", 0, "MAX_SIZE" + 256, SzName)

m_hMap = 0

have you got an idea ?

I have no idea what that call "API(...)" does, but everything you are passing it seem to be strings of characters! Is that correct? I mean "HFFFFFFFFF" surely isn't the same as the number resulting from hexadecimal FFFFFFFF, is it? (the same as -1 in a 32-bit value).

And those names PAGE_READWRITE and MAX_SIZE are defined as numbers too, via the windows.h C header file, using #define lines. Does your system look those up for you via the names? If so how does it distinguish between what you want to be a real string and what you want to be a number. It really makes no sense at all to me. Sorry.

You need numbers for numerical parameters, strings (in ASCII) for string parameters. I've no idea how your compiler interprets what you have there.

Regards

Pete

Link to comment
Share on other sites

Thanks for the fast answer. :)

Can you tell me please : in debug, what have you got in SzName ?

I doubt if that's the problem, butsimilar to yours, excepting that FSASMLIB:IPC is spelled like FsasmLib:IPC (as in theIPCUser.h header), and of course the process ID and the try number will be different -- the try number changes as you retry in any case if you have the retry loop right.

Pete

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I'm working on WINDEV too !

The solution to establish connection between windev and FSUIPC without using an external language into windev is to use a DLL.

Problem : I try to make a dll from the C example (present in the SDK). Windev open the dll successfully but it can't find function. I'm not an expert in C and DLL so i'm sure i've not made this DLL correctly.

If anyone have made a DLL in C or C++ which use all the function whith FSUIPC, i'm very interesting!

Regards,

Ben.

PS : I'm fench, grieved for the errors !!!

Link to comment
Share on other sites

  • 6 years later...

how can I start a program in FSUIPC (e.g. : XYZ.EXE) by pressing a button?

 

You'd need to use a little Lua plug-in, with just the one line:

 

ext.run("<path of program>\\XYZ.EXE")

 

where the path is, of course, points to where the program resides.

 

Save it to the Modules folder, then, in FSUIPC options, assign you button to that Lua plugin.

 

There are lots of facilities for external programs in the Lua ext library. The Lua documentation is in the FSUIPC Documents subfolder in Modules.

 

Pete

Link to comment
Share on other sites

  • 2 weeks later...

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.