Results 1 to 7 of 7

Thread: Compile error in hidden module: ISource5_h

  1. #1
    Join Date
    Dec 1969
    Location
    .
    Posts
    67

    Default Compile error in hidden module: ISource5_h

    I have created an Excel add-in using ImageSource that decompiles images into their component R,G,B pixel values, each component on a separate worksheet.
    I have used this now in teaching mathematical image processing to students for several years, however this year, for the first time, I have a student reporting the error:

    "Compile error in hidden module: ISource5_h"

    This student subsequently told me they had 64-bit Windows, so I thought this was the problem.
    I downloaded the 64-bit version of the dll and told them to replace the previous dll with it.
    Unfortunately they report the error still occurs.

    Do I need to do more than to replace the DLL in converting a 32-bit application to 64-bit?
    Do you know of any other way in which this error might occur?

    Many thanks
    Jeff

  2. #2
    Join Date
    Mar 2006
    Posts
    945

    Default Re: Compile error in hidden module: ISource5_h

    ISource_h is not part of ImgSource itself (there are no files, class or functions with that name). Is that your Excel wrapper ?

    Can you get any specific info about the error ?

  3. #3
    Join Date
    Dec 1969
    Location
    .
    Posts
    67

    Default Re: Compile error in hidden module: ISource5_h

    My first thought was that this message in some way referred to the c header file - especially since the error message (http://maths.shu.ac.uk/error.jpg) suggested version/platform/architecture and the student is using 64 bit windows.
    Now you have pointed this out, I realise it's my own definitions file, that I've used to let Excel VBA know about the ImageSource functions, that the error is referring to (sorry!) http://maths.shu.ac.uk/ISource5_h.txt

    Still, I've no idea what may have led to this error, especially when I have been using the add-in for some years without a problem. It is likely to be connected to the 64-bit windows issue, but I would have no idea how this might specifically lead to a problem.
    I hesitate to ask but .. do you have any idea?

    I should add that the error message apparently appears as soon as Excel (with the add-in installed) is loaded, so it is unlikely to be caused by any of the function calls.
    Last edited by jeff; 03-29-2012 at 01:21 PM.

  4. #4
    Join Date
    Mar 2006
    Posts
    945

    Default Re: Compile error in hidden module: ISource5_h

    The biggest change when going from 32 to 64 bits (in this context) is that the size of the pointers (and handles) changes from 32 to 64 bits. So, all of your function definitions need to account for that. So, what's the size of a "Long" in the Excel add-on language?

  5. #5
    Join Date
    Dec 1969
    Location
    .
    Posts
    67

    Default Re: Compile error in hidden module: ISource5_h

    According to the manual:
    "Long (long integer) variables are stored as signed 32-bit (4-byte) numbers ranging in value from -2,147,483,648 to 2,147,483,647"
    I wonder if the 64-bit version of MS Office would operate diferently?

  6. #6
    Join Date
    Dec 1969
    Location
    .
    Posts
    67

    Default Re: Compile error in hidden module: ISource5_h

    I think I've found the source of the problem:
    from http://msdn.microsoft.com/en-us/library/gg264421.aspx:

    "Running VBA code that was written before the Office 2010 release (VBA version 6 and earlier) on a 64-bit platform can result in errors if the code is not modified to run in 64-bit versions of Office. Errors will result because VBA version 6 and earlier implicitly targets 32-bit platforms and typically contains Declare Statements that call into the Windows API using 32-bit data types for pointers and handles. Because VBA version 6 and earlier does not have a specific data type for pointers or handles, it uses the Long data type, which is a 32-bit 4-byte data type, to reference pointers and handles. Pointers and handles in 64-bit environments are 8-byte 64-bit quantities. These 64-bit quantities cannot be held in 32-bit data types."

    Thanks for your help, but I think I've got some work to do ...

  7. #7
    Join Date
    Mar 2006
    Posts
    945

    Default Re: Compile error in hidden module: ISource5_h

    yep.

    looks like "LongPtr" is what you need for all those pointers and handles.

Posting Permissions

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