Sankaman77 Posted February 15, 2009 Report Posted February 15, 2009 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
Pete Dowson Posted February 15, 2009 Report Posted February 15, 2009 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
Sankaman77 Posted February 15, 2009 Author Report Posted February 15, 2009 Hi. Thanks for your answer. But it's before FSUIPC_Read that i dont know. 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. maybe an API or dll ? Thans again. :)
Pete Dowson Posted February 16, 2009 Report Posted February 16, 2009 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 1
Sankaman77 Posted February 16, 2009 Author Report Posted February 16, 2009 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 :)
Pete Dowson Posted February 16, 2009 Report Posted February 16, 2009 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
Sankaman77 Posted February 16, 2009 Author Report Posted February 16, 2009 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 ???
Pete Dowson Posted February 17, 2009 Report Posted February 17, 2009 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
Sankaman77 Posted February 17, 2009 Author Report Posted February 17, 2009 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
Pete Dowson Posted February 17, 2009 Report Posted February 17, 2009 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
Sankaman77 Posted February 17, 2009 Author Report Posted February 17, 2009 Thank you for the info, I'll will try.
Sankaman77 Posted February 21, 2009 Author Report Posted February 21, 2009 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
Pete Dowson Posted February 21, 2009 Report Posted February 21, 2009 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
Sankaman77 Posted February 21, 2009 Author Report Posted February 21, 2009 Thanks for the fast answer. :) Can you tell me please : in debug, what have you got in SzName ?
Pete Dowson Posted February 21, 2009 Report Posted February 21, 2009 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
InfecteD® Posted March 9, 2009 Report Posted March 9, 2009 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 !!!
Alhard Horstmann Posted April 22, 2015 Report Posted April 22, 2015 Hi Pete, in the context of this thread I have a simple question: how can I start a program in FSUIPC (e.g. : XYZ.EXE) by pressing a button? thanks and best regards Alhard
Pete Dowson Posted April 22, 2015 Report Posted April 22, 2015 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
Alhard Horstmann Posted May 2, 2015 Report Posted May 2, 2015 hi Pete, great thanks. I will try. I made some experiments with LUA in the past, but now I did not find this ext.run feature. best regards Alhard
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