lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 26/02/2010 06:16, Kenneth LO wrote:
This code will hang on my XP SP2.

   require "luacom"
   excel = luacom.CreateObject("Excel.Application")

It will exit gracefully either without the second or the third line
(or both). Of course without requiring luacom, os.exit works all the

At first I suspect that it is a compilation problem.  The luacom.dll
is kindly provided by Steve Donovan, which is a msvcr80 build.  Then I
recompile the cvs code by cross compilation on jaunty.  The same
problem still exists.

By calling os.exit, you're bypassing COM uninitialization. That usually has all kind of different symptoms, like the hang you are seeing. Try to do a proper cleanup first. Also, IIRC Excel.Application has a Close method, so you can try if adding 'excel:Close()' before your exit call is of any help. But remember, it is best to exit cleanly.