#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2014
    Posts
    6
    Rep Power
    0

    Delphi 2007 verses XE7


    Simple problem.
    CANUSB dongle and support DLL along with project in a folder on the P: drive common to all systems.

    Delphi project created and running on XP with 2007. No problem opening up the CANUSB and accessing the Version #. Code size about 607K bytes.
    ..
    Same project, same folder but compiled on WIN-7 64 bit using XE7 for WIN32 target. Code size 2.4MB. Call to open USB device fails. Behaviour is the same on a laptop running WIN-7 64 bit. Runs but can't open the CANUSB.

    On a VISTA laptop (32 bit) running Delphi 2007 the compiled code also functions and opens up the CANUSB device.

    Now here's the kicker. The Delphi 2007 code created on the WIN-XP system (607K) runs without problems on the WIN-7 systems opens up the CANUSB and can communicate with it.

    Since all systems open the same TailLightMaster.proj in the same folder and put executable there and the Delphi 2007 then runs properly on any system there's clearly a difference.

    But what? It's the same project file. Where do I even start to look?

    Ideally I'd set some other flags in the WIN-XP system that would influence the WIN-7 XE7 version.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    397
    Rep Power
    0
    Do any of the calls into the Support DLL involve parameters of type PChar? The definition of a PChar has changed between Delphi 2007 and XE7.

    The equivalent to a PChar in D2007 in XE7 is PANSIChar. Try changing the declaration of those variables to PANSIChar
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2014
    Posts
    6
    Rep Power
    0
    Thanks. It turned out that the DLL being called was a 32 bit DLL written before characters became 16 bit. Changing references to ansichar and ansistring resulted in the DLL working correctly.
    Now I can't wait until integers are changed to 31.416 bits.

IMN logo majestic logo threadwatch logo seochat tools logo