1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

P3D v4 HIDMacros rebuild or new build.

Discussion in 'Project recruiting' started by js6033, 13 Jun 2017.

  1. js6033

    js6033

    Joined:
    16 Feb 2011
    Messages:
    24
    Country:
    sweden
    I would like to get in touch with a programmer who knows how to rebuild or build a new HIDMacros.

    Some years ago I found HIDMacros at the web. A freeware made by Petr Medek and available
    at his website http://www.hidmacros.eu/.
    HIDMacros made it possible to have more than one keybord connected to a computer and have every
    key unique. This by programming every key in HIDMacros. A very handsome program to build a simple cockpit.

    But Petr Medek doesn't do any upgrade of HIDMacros any more. He has released the program and
    the source code as freware.
    Look at http://www.hidmacros.eu/forum/viewtopic.php?f=10&t=241#p794
    and http://www.hidmacros.eu/forum/viewtopic.php?f=3&t=221

    I have used HIDMacros to FS2004, FSX and P3Dv3 at both Windows7 32 bit and Windows10 64 bit.
    It has worked perfectly all the time. Look at me site http://snell.se/flightsim/?Mina_projekt___Simple_Cockpit
    unfortunately most in Swedish.

    But now I bought P3DV4 64 bit from Lockheed Martin. And (of course) HIDMacros doesn't work in P3DV4!
    To me it looks like the SimConnect does not connect to P3DV4.

    A rebuild of the macro would be required. But I do not have required knowledge.

    Will you do the job for me and every other flysimmer I will be very grateful.
    Tell me and I will give you more information as much as I can.

    Jonny
     
  2. ctroncy

    ctroncy

    Joined:
    14 Jun 2017
    Messages:
    13
    Country:
    france
    Bonjou Jonny,

    As I have told you on the HIDMacos Forum, I have the same problem than yours with P3DV4.
    HIDMacros use FSX-SP1 Simconnect to dialog with P3D, it was working with V3.

    As HIDMacros is a 32 bits exec application running outside P3D, there no reason why it is not working with V4.

    To test, I wrote a little program wich use the SimConnect_Open function with the FSX-SP1 SDK environnment and I got the same problem than HIDMacros. It is working in V3 but not in V4.

    I can say that when I compile and link it with the FSK-SP2 environnement, it works in both case V3 and V4.

    I posted on the P3D SimConnect subforum, but I did not get any answer.
    http://www.prepar3d.com/forum/viewtopic.php?f=6310&t=125245

    May be you can make a post yoursef on the subject, it will show them I am not alone, and who knows, they may be find where is the problem.

    Thanks Cheers
    Claude
     
  3. ronh

    ronh

    Joined:
    2 Nov 2006
    Messages:
    879
    Country:
    canada
    Have you tried his Luamacros - I know it's only beta. I'm looking at why hidmacros does not work, but changing over to lazarus from turbo delphi is a real pain.

    Using luamacros, it does not have the GUI to help with script setup - so you have to work a little harder.
     
  4. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,803
    Country:
    unitedstates
    Just a wild guess, but did you install the legacy versions of SimConnect to P3Dv4?
     
  5. ctroncy

    ctroncy

    Joined:
    14 Jun 2017
    Messages:
    13
    Country:
    france
    Hi N4gix,
    What do you mean by
    In my case, I have reinstalled all the legacy versions, from the V4 redist directory with no hope as this redist directory is exacly the same than the one in P3DV3, which for me is logic.
    Cheers
    Claude
     
  6. js6033

    js6033

    Joined:
    16 Feb 2011
    Messages:
    24
    Country:
    sweden
    Hi all and thanks for the answers,

    I have looked a little at LUA but I am not able to do any advance programming with LUA. As I understand from Prepar3d forum 'SimConnect Interface Questions' there are many more having troubble with Simconnect. Maybee we have to wait until Prepar3D do something to Simconnect.

    Regards
    Jonny
     
  7. ronh

    ronh

    Joined:
    2 Nov 2006
    Messages:
    879
    Country:
    canada
    Just a little update on this. I have been using lazarus (delphi clone) to get delphi/pascal simconnect.pas to talk to P3D v4. So far I made minor changes and have recompiled the example code, basically the the C++ examples that have been converted to delphi/pascal code, and got them to work with P3D v4.

    Now hidmacros uses some delphi code that is not directly compatible with lazarus, so it will not compile .... yet.

    I only had to change the manifest file in the SimConnect1A folder, and recompile the resource using VS2015 rc. So here is my new SimConnect.Pas.embed.manifest file.

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
          <requestedPrivileges>
            <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
          </requestedPrivileges>
        </security>
      </trustInfo>
      <dependency optional= "yes">
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.6195" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
      <dependency optional= "yes">
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.FlightSimulator.SimConnect" version="10.0.61259.0" processorArchitecture="x86" publicKeyToken="67c7c14424d61b5b"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
    </assembly>
    I don't really know yet if you need the VC80 file, but I changed the version to the one I had in my WinSXS.

    This is a text file you run rc on. The Simconnect.rc file basically contains one line.

    Code:
    1 24  "SimConnect.Pas.embed.manifest"
    You use the VS cmd box to run rc

    Code:
    rc SimConnect.rc
    It creates the SimConnect.res file.

    I use 10.0.61259.0 version of simconnect from redist in P3D v4.

    P.S.

    OpenTrack has some manifest files too. I think they have their files mixed up (not sure). So I'm sure OpenTrack can be modified for P3D v4 too.
     
  8. ctroncy

    ctroncy

    Joined:
    14 Jun 2017
    Messages:
    13
    Country:
    france
    Hi Ron,

    That's good news.
    I noticed that is the only one which works with P3D V4, except of course when the simconnect is the P3D one embedded in the application code.

    Thank you very much for your work.
    Cheers
    Claude
     
  9. js6033

    js6033

    Joined:
    16 Feb 2011
    Messages:
    24
    Country:
    sweden
    Hi Ron and Claude

    Good to see you are working on the problem. I would be very happy if I get a HIDMacros working in P3DV4.

    Regards,
    Jonny
     
  10. ctroncy

    ctroncy

    Joined:
    14 Jun 2017
    Messages:
    13
    Country:
    france
    Hi,
    While Ron was working on the recompilation of HIDMacros with Lazarus, I decided to try with Delphi 10.2 as the application was made with turbo Delphi I thought it should be easier. It was not, and I only get tons of errors related to the String and ANSI String and a lot of other errors... After trying to fix them for 3 days I gave up.

    Then I tried to replace the manifest inside the application using the MT.exec tools provided with the Microsoft SDK to force HIDMAcros to use SP2 SImConnect. But no chance.

    I noticed that there was a difference between SP1 and SP2. A new parameter exists in the Open function for SP2 which forces the local connection. I decided to try my test SP1 program in a network environment..... Bingo it was working.

    To resume if you want HIDMacros to work with P3DV4, just let believe it that you are in a network connection, with a Simconnect.XML in the P3D V4 AppData folder and a Simconnect.cfg in the HIDMacros folder.

    For me it works now.
    Cheers
    Claude
     
  11. ronh

    ronh

    Joined:
    2 Nov 2006
    Messages:
    879
    Country:
    canada
    Claude,

    Good find. I was still working on HidMacros with lazarus. Made some progress. However, the killer is that delphi/turbo pascal is different in XML read/write parse and the MS Scripting code. I was able to get a blank HidMacros form to show and connect to P3D v4, but then crashes. There are way too many changes needed to make this work. It can be done, but I just don't have the time. I see that LuaMacros may be a better option. Since this is already being written in lazarus all that is needed is the simconnect.pas to be created. BUT, that is already done. Luamacros can probably use the existing simconnect.pas, but just link to the proper SP2 version rather than the SP1.

    So I am going to abandon HidMacros and do some tinkering in LuaMacros. Stay tuned.
     
  12. js6033

    js6033

    Joined:
    16 Feb 2011
    Messages:
    24
    Country:
    sweden
    Hi Ron and Claude

    Thank's for your try, I will test later on. I am on holidays for now.

    Regards,
    Jonny
     

Share This Page