Invalid Pointer Operation with UDF, Excel

Add-in Express™ Support Service
That's what is more important than anything else

Invalid Pointer Operation with UDF, Excel
 
Michał Głębowski




Posts: 42
Joined: 2015-06-08
Dear Sirs,

I wrote simple UDF according to docs provided with Add-in express.
I found, that when I use them in Excel, and then close Excel I get "Invalid Pointer Operation" error.
Could you direct me where to find a bug? (W7 64bit, Excel 2007 32bit, XE2).
Or at last how to effectively debug code.

Michal
Posted 09 Jun, 2015 15:40:20 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hello Michal,

Could you please send me a project reproducing this issue to the support email address? You can find that address in {Add-in Express installation folder}\readme.txt. Please make sure your email contains a link to this topic.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Jun, 2015 02:31:29 Top
Michał Głębowski




Posts: 42
Joined: 2015-06-08
Dear Andrei, thank you for your will to help.
I tried to cut down project to send you as small part as possible and found that problem occurs when I destroy my object using "Free" method.

procedure TAddInModule.adxCOMAddInModuleCreate(Sender: TObject);
begin
UndoXLS := TUndoXLS.Create;
end;

procedure TAddInModule.adxCOMAddInModuleDestroy(Sender: TObject);
begin
UndoXLS.Free; // (1) this solution makes program to show Invalid Pointer...
FreeAndNil(UndoXLS); // (2) this solution works ok
end;

Can you tell me if this was real problem or it accidentally happend at this place?

Michal.
Posted 10 Jun, 2015 14:04:08 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hello Michal,

I can't tell you because I don't know what TUndoXLS is. Can you send me a project? You can also try to replicate the issue using sample project Your First Excel Automation add-in; download the archive file labelled Add-in Express for Office and VCL sample projects at https://www.add-in-express.com/downloads/adxvcl.php.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Jun, 2015 04:43:47 Top
Michał Głębowski




Posts: 42
Joined: 2015-06-08
Dear Andrei,
I've just sent you (to support mail which I found in readme.txt) my very simple Unit for TUndoXLS.
Posted 11 Jun, 2015 06:24:57 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hello Michał,

I've cannot reproduce the issue if I comment out one of the code lines. I get an Invalid Pointer exception when I register/unregister the add-in and both code lines aren't commented.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Jun, 2015 08:49:34 Top