sdk error:Module not found 是什么原因?

OOo 3.1.0 , SDK 3.1.0 , WinXP , vc2005 Express

cmd测试sdk例子,运行良好!

现在希望能在.net下测试开发sdk例子,如何设置.net


首先、按照 Prepare the OOo SDK (http://www.codeproject.com/KB/wtl/Wtl_OOo.aspx)产生c++头文件(生成后弹"Error[object error]“-这个是否有影响?解决办法:重装WSH   http://www.microsoft.com/downloads/details.aspx?FamilyID=47809025-d896-482e-a0d6-524e7e844d81&displaylang=en[^]
     scripten.exe,仍然抛出该错误 )和项目属性单OOo.vsprops,在.net下创建控制台项目,并将OOo.vsprops添加进去。

具体如下:

To use the Uno API and access the OOo capabilities in your applications, you should go through the following steps:

  • Download and install the OOo 3.0 SDK from OpenOffice.org to a <OOoSdkDir> on your development station. On Vista systems, avoid installing in C:\Program Files or any other UAC protected folder.
  • Generate the OOo SDK C++ code matching your OOo installation:
    • Extract OOoCpp.js and OOo.vsprops from OOo.zip to <OOoSdkDir>\sdk.
    • Run OOoCpp.js. This script will create a <OOoSdkDir>\includecpp folder, run the SDK cppumaker tool with the correct parameters to populate this folder with the C++ headers matching the uno type libraries types.rdb and offapi.rdb; cppumaker is located in <OOoSdkDir>\bin and needs the OOo DLLs located in <OOoInstallDir>\URE\bin. The source type libraries are in different folders under <OOoInstallDir>, so this script is the way to avoid many frustrations.

      OOoCpp.js will also update in OOo.vsprops, the OOoSdkDir variable to your <OOoSdkDir> installation folder.

Adding this updated OOo.vsprops property set to any Win32 project in Visual Studio/VCExpress 2005/2008 is enough to use the OOo SDK in your C++ projects.

OOo.vsprops defines the preprocessor macro WNT, sets the correct search paths and names for headers and libraries, and sets delayed loading of sal3.dll, cppu3.dll, and cppuhelper3MSC.dll. Thus, the application can add to its runtime path the OOo DLLs located in <OOoInstallDir>\URE\bin and found in the Registry, before actually calling them.

 

其次、按照LarsB的Guide for develop OpenOffice apps with VC++ .net

 

继续设置.net。

具体如下:

4. Open Visual Studio and create a new Win32 Console Application.
Applay the following changes to your project.
4.1. Tools ->Options->Projects->VC++ Directories -> Include Files
Add \include directory and <oo_sdk_path>\includecpp
4.2. Tools ->Options->Projects->VC++ Directories -> Library files
Add <oo_sdk_path>\windows\lib directory
4.3. Tools ->Options->Projects->VC++ Directories -> Executable files
Add <office_programm_dir>\program directory (location where you installed the version of the OpenOffice)
4.4 Open the Project Settings
4.4.1 Change Configuration to all All Configuartions (the combobox in the left corner of the window)
4.4.2 Add the additional libaries
Properties->Linker->ComandLine in the Additional Options tab the library files
isal.lib icppu.lib icppuhelper.lib isal.lib isalhelper.lib ireg.lib irmcxt.lib stlport_vc71.lib

 

第三、运行例子,报错:

First-chance exception at 0x7c81eb33 in mySDKprj.exe: 0xC06D007E: Module not found.
Unhandled exception at 0x7c81eb33 in mySDKprj.exe: 0xC06D007E: Module not found.

尽管有No symbols loaded但可知不是错误。

网上有类似错误,但找了很多天,未找到错误的原因和解决办法 :(

有说原因是:it Is very likely that you did not set the application path to the OOo dlls.

但这个OOo.vsprops已经设置了

。。。。。。

posted @ 2010-02-01 16:08  MayFirst  阅读(4856)  评论(0编辑  收藏  举报