Re: libXLL (and its QuantLib usage)

Posted by Jerome Lecomte-2 on
URL: http://quantlib.414.s1.nabble.com/libXLL-and-its-QuantLib-usage-tp2428p2431.html

I will look at the issue 1) this week end. I can't remember why I
commented it out.

JL

Ferdinando Ametrano wrote:

> Hi all
>
> I've added Jen's libXLL project code to the current xlw repository, in
> a branch called libXLL-branch
> libXll does add support for exposing the functions also to VBA, and to
> develop COM objects.
> Everybody can check out the code from sourceforge using:
> cvs -z3 -q update -P -d -r libXLL-branch
>
> There are a couple of problems that need to be solved, and then I'll
> merge the libXLL branch into the trunk.
> 1) in XlfExcel.h Jérôme removed:
>
>> ///////////////////
>> HINSTANCE hInst_;
>> public:
>> void DllHandle( HANDLE hDLL);
>> HINSTANCE DllHandle() const;
>> ///////////////////
>
>
> which was needed by Jens' code in the xllExample:
>
>> BOOL APIENTRY DllMain( HANDLE hModule, DWORD dwReason, LPVOID)
>> {
>> if( dwReason == DLL_PROCESS_ATTACH)
>> XlfExcel::Instance().DllHandle(hModule);
>> return TRUE;
>> }
>
>
> I just commented out the DllHandle lines (as per Jens' suggestion),
> but I would appreciate any help to fix this.
>
> 2) I tried to follow the guidelines on how to setup a project based on
> xlw/libXLL (see "Docs/Setting up a project with libXLL.pdf" in the xlw
> cvs). I tried with a COM/ATL project called QuantLibXL2. The Debug
> configuration does compile and link, but with the "Debug Unicode"
> configuration I have the following error:
>
>> Linking...
>>    Creating library build\DebugU/QuantLibXL2.lib and object
>> build\DebugU/QuantLibXL2.exp
>> QuantLibXL2.obj : error LNK2001: unresolved external symbol "public:
>> void __thiscall XlfExcel::SendMessageW(char const *)"
>> (?SendMessageW@XlfExcel@@QAEXPBD@Z)
>> build\DebugU/QuantLibXL2.dll : fatal error LNK1120: 1 unresolved
>> externals
>> Error executing link.exe.
>>
>> QuantLibXL2.dll - 2 error(s), 0 warning(s)
>
> and I connot find SendMessageW anywhere.
>
> With all other configurations I have linking problems. I suspect this
> might be because of linking with incompatible libraries. QuantLib (and
> its cppunit test-suite) uses multithreaded DLL libraries. Is this the
> problem? I could change QuantLib settings, but I should also recompile
> cppunit. It's completely obscure to me the real difference between
> multithreaded and multithreaded DLL, I just happily found out the the
> cppunit choice matched the QuantLib one.
> I attach here the QuantLibXL" code. Any help greatly appreciated
>
>
> -------------
>
> ciao -- Nando
>
> PS the current version of QuantLibXL is in synch with QuantLib and the
> libXLL branch. Also the spreadsheets do wo
> rk



_____________________________________________________________________
GRAND JEU SMS : Pour gagner un NOKIA 7650, envoyez le mot IF au 61321
(prix d'un SMS + 0.35 euro). Un SMS vous dira si vous avez gagné.
Règlement : http://www.ifrance.com/_reloc/sign.sms