2
我有2個VS項目在單獨的解決方案。首先是一個dll,第二個嘗試從第一個函數調用函數。雖然它編譯沒有錯誤,Excel說使用外部DLL項目到Excel的C++/xll加載項
"The file you are trying to open, 'test.xll', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"
如果我按是,我看到一堆中文字母。如果我不從dll項目調用函數,那麼xll可以正常工作。我究竟做錯了什麼?使用VS2010和Excel 2010 x86。
第一個是一個DLL項目
square.cpp
double _stdcall square (double &x) {
return x * x;
}
square.h
#pragma once
__declspec(dllexport) double _stdcall square (double &x);
第二個項目是一個XLL項目
static AddIn xai_exp(
"?xll_exp", XLL_DOUBLE XLL_DOUBLE,
"XLL.EXP", "Number"
);
double WINAPI xll_exp(double number) {
#pragma XLLEXPORT
return square(number);
}
我也爲什麼時候做了defFile我使用VBA進行測試,但我不認爲它在這裏需要。
我面臨同樣的問題,您是否找到解決方案? – Malick 2015-10-26 17:55:10
是的,但是前一段時間,所以我不記得如何。如果想到什麼,我會讓你知道 – 2015-10-27 08:06:46