2

我发现我无法使用我的 Office 2007 版本加载任何 32 位 DLL。我使用的是 64 位 Vista,我假设 Office 也处于 64 位模式。是否可以在 32 位模式下启动 Excel 或者有没有办法使用 VB 声明 DLL 以加载 32 位 DLL?

因为我没有我正在使用的某些 DLL 的源代码,所以我不能简单地为 64 位模式重新编译东西。所以我认为我的选择是强制 Excel 在 32 位模式下运行,或者将我使用的 DLL 声明为 32 位 DLL,即使我的环境是 64 位。

我得到的错误是“找不到 DLL”,即使 DLL 实际上存在。

下面是一个示例声明。此语句是否有 32 位属性?

Private Declare Function ESQMain Lib "ESQuotes2.dll" Alias "_ESQMain@12" _ (ByVal func As Long, ByVal ticker_symbol As String, ByVal Result As String) As Integer

4

2 回答 2

2

You have a bad assumption - Office is not currently available in 64 bit. The next version of office (Office 2010) is rumored to be shipped with 32 & 64 bit.

于 2009-05-05T15:20:01.740 回答
0

You can't "declare" a DLL to be 32 bits. It's either a Win32 binary or a Win64 binary. The first kind of binary can be loaded in Win32 processes, the second in Win64 processes. You can't mix them. Attributes on the Visual Basic import do not help.

So, your only option is to start the 32 bits Excel binary. It has to exist, obviously, since Office is still available for Vista 32, but the question is whether it's installed and where.

于 2009-05-05T15:17:26.643 回答