October 16th, 2008, 8:07 am
Hi Jeff,QuoteOriginally posted by: jjyuMy suggestion is to bring up the debugger to see what is going on.There is a very small and very relevant piece of code which we have still yet to see, wouldn't it make sense to have a quick look at that before starting the debugger? Mark tried without success to replicate Stale's error and I suspect it's because Mark's call to XLFunctionRegistrationHelper is correct and Stale's isn't.QuoteI did this in Visual Studio environment:1. bring up Excel and install the add-in;2. Set the break point inside your code, attach to Excel from VS;3. enter the function in excel, it should stop at the break point;Here's an alternative approach which can be more convenient:- Open the addin project in Visual Studio- Under Project | Settings | Debug, under "Executable for debug session", enter the path to Excel- Now when you hit F5, Visual Studio starts Excel, loads the addin, and attaches the debuggerQuoteeehlers, the reason I said DLL is stateless is that the global variables in DLL are on the heap. When you have multiple copies of DLL, the global variables are sharable.In order to achieve the effect of being stateful, you might have to rely on global variable? Correct me if you see it differently.You can call me Eric. ;-)A straightforward way for a DLL to retain state is for it to write that state to a static variable, whose scope need not be global. Under Windows 3.1 multiple copies of a given DLL shared writable memory but for Win32 and later that is no longer the case unless the DLL has been designed to behave that way through the use of a shared section.Regards,Eric