justhumm
Structural
- May 2, 2003
- 111
Not sure if this is the right forum for this, but like Ol' Jack always says...what the hell?
I am very new to C-plus-plus and trying to use it to create user-defined functions for excel. I wrote a very simple test function in Cpp that just adds two arguments together (Excel cell references).
I compiled a 32-bit DLL & a seperate 64-bit DLL project using the same *.cpp and *.def files in Visual Studio 2013.
When I run the 32-bit DLL in a 32-bit Excel install, the new excel function works fine (eg: 5 + 10 = 15).
When I run the 64-bit DLL in a 64-bit Excel install, I am getting a #VALUE error in the cell.
Can anyone see something blatantly wrong that I am doing with the 64-bit DLL or the VBA declare? Thanks!
Computer 1: Windows 7 (64-bit), Office 2016 (32-bit), Visual Studio 2013
Computer 2: Windows 7 (64-bit), Office 2016 (64-bit)
I am very new to C-plus-plus and trying to use it to create user-defined functions for excel. I wrote a very simple test function in Cpp that just adds two arguments together (Excel cell references).
I compiled a 32-bit DLL & a seperate 64-bit DLL project using the same *.cpp and *.def files in Visual Studio 2013.
When I run the 32-bit DLL in a 32-bit Excel install, the new excel function works fine (eg: 5 + 10 = 15).
When I run the 64-bit DLL in a 64-bit Excel install, I am getting a #VALUE error in the cell.
Can anyone see something blatantly wrong that I am doing with the 64-bit DLL or the VBA declare? Thanks!
Code:
***** VBA (32-bit) *****
Declare Function ExPlus Lib _
"C:\AKH-VSWS\Ex-Plus32\Debug\Ex-Plus32.dll" _
(ByVal a As Double, _
ByVal b As Double) As Double
Computer 1: Windows 7 (64-bit), Office 2016 (32-bit), Visual Studio 2013
Code:
***** VBA (64-bit) *****
Declare PtrSafe Function ExPlus Lib _
"C:\AKH-VSWS\Ex-Plus64\x64\Debug\Ex-Plus64.dll" _
(ByVal a As Double, _
ByVal b As Double) As Double
Computer 2: Windows 7 (64-bit), Office 2016 (64-bit)
Code:
Microsoft (R) COFF/PE Dumper Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file c:\AKH-VSWS\Ex-Plus64\x64\Debug\Ex-Plus64.dll
PE signature found
File Type: DLL
FILE HEADER VALUES
8664 machine (x64)
7 number of sections
5AC930F1 time date stamp Sat Apr 07 16:58:25 2018
0 file pointer to symbol table
0 number of symbols
F0 size of optional header
2022 characteristics
Executable
Application can handle large (>2GB) addresses
DLL