+ Reply to Thread
Results 1 to 6 of 6

GUID code for 32bit to work with 64bit also

  1. #1
    Registered User
    Join Date
    07-13-2010
    Location
    Barossa SA, Australia
    MS-Off Ver
    Excel 2007
    Posts
    48

    Smile GUID code for 32bit to work with 64bit also

    Hi All,

    I have some code that has been working very well at our work place. The problem is some of the PC's have been upgraded to 64bit and on these PC's the code gets the following Complie error message

    "The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute."

    The code is below and I need it to be able to work on both 32bit and 64bit machine's is this possiable?

    Please Login or Register  to view this content.
    Thanks in advance.BJ
    Last edited by BJ5352; 05-26-2013 at 10:58 PM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: GUID code for 32bit to work with 64bit also

    Hi,

    Try this instead on all machines (32 and 64 bit):

    Please Login or Register  to view this content.
    Some functions that work in 32-bit environment just don't work in 64-bit environment so you will have to test.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    07-13-2010
    Location
    Barossa SA, Australia
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: GUID code for 32bit to work with 64bit also

    Thanks abousetta,

    Sorry but this didn't work. The first section caused an error on a 32bit machine and the second bit caused an error on a 64bit machine.

    Any other thoughts?

    BJ5352

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: GUID code for 32bit to work with 64bit also

    Hello abousetta,

    The Windows 64 bit return value of CoCreateGuid is actually a handle to the error code returned by the RPC function UuidCreate. All handles and pointers for Windows 64 bits systems should be declared as LongPtr instead of Long.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    07-13-2010
    Location
    Barossa SA, Australia
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: GUID code for 32bit to work with 64bit also

    Hi Leith,

    This code was originally yours I got from a forum two years ago, its been great.

    Your suggestion worked on the 32bit machines. The the second line goes red on the 64bit machines but does not create an error. I'll check on another machine on monday.

    Thanks agian for you help.

    BJ5352

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: GUID code for 32bit to work with 64bit also

    Thanks Leith. You're right, syntax is everything. I just spent the night fiddling with Windows API in order to use keybd_event instead of SendKeys. Glad you picked up on this thread. I'll leave the remainder to your capable hands.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1