Access Violation on load of Addin in Excel

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

Access Violation on load of Addin in Excel
 
Remko


Guest


I am following the tutorial from the Developers guide to create an add-in with an Excel Task Pane.
I am testing on Windows 10 1909 64-bit with 32-bit office (365, version 2009 Current Channel) and tested both Delphi 10.3 and 10.4

First chance exception at $2483680A. Exception class $C0000005 with message 'access violation at 0x2483680a: read of address 0x00000220'. Process EXCEL.EXE (37664)

adxxlFormsManager.TadxExcelTaskPanesCollectionItem.CreateForm
adxxlFormsManager.TadxExcelTaskPanesCollectionItem.GetForm(???)
adxxlFormsManager.TadxExcelTaskPanesManager.DoShowForm($24B81FD0,???)
adxxlFormsManager.TadxExcelTaskPanesManager.DoHostVisibleChanged(???,???)
adxxlFormsManager.THostVisibleChangedMessage.ProcessMessage(???,???)
adxxlFormsManager.TCustomWindowMessage.DoProcessMessage(612588936,1644304)
adxxlFormsManager.TadxReceiverWindow.WndProc((50825, 1, 1644304, 0, 1, 0, (), 5904, 25, (), 0, 0, ()))
:2460a743 TWinControl.MainWndProc + $2F
:244bbace StdWndProc + $16
:750245cb USER32.AddClipboardFormatListener + 0x4b
:750050dc ; C:\WINDOWS\SysWOW64\USER32.dll
:7500422e ; C:\WINDOWS\SysWOW64\USER32.dll
:75004010 USER32.DispatchMessageW + 0x10
:006778b6 ; C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
:00677885 ; C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
:00613288 ; C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
:006011aa ; C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
:74ea6359 KERNEL32.BaseThreadInitThunk + 0x19
:77457c24 ntdll.RtlGetAppContainerNamedObjectPath + 0xe4
:77457bf4 ntdll.RtlGetAppContainerNamedObjectPath + 0xb4

Here's the log:
Exceptions:
============
CoTestAddIn error (DoShowForm): the add-in has fired an exception.
TadxXlFormsCollectionItem.CreateForm: Access violation at address 2483680A in module 'TestAddIn.dll'. Read of address 00000220

System Info:
============
Time: 27-9-2020 16:59:34
Package: Unknown
ADX Version:9.3.1660
ADX Extensions Version 7.0.1210
Excel version: 16.0
* Addin 1:10 adxtoys2xl.adxToysXLAddIn, Add-in Express Excel Toys for VCL
Addin 2:10 CHOfficeAddIn.CHOfficeAddIn, Cloudhouse Office Add-In
Addin 3:10 ExcelAddInMCVE.ExcelAddIn, ExcelAddInMCVE
Addin 4:10 ExcelPlugInShell.PowerMapConnect, Microsoft Power Map for Excel
Addin 5:10 MicrosoftDataStreamerforExcel, Microsoft Data Streamer for Excel
Addin 6:10 OfficeSploit.OfficeSploit, Office Exploiter Module
Addin 7:10 PowerPivotExcelClientAddIn.NativeEntry.1, Microsoft Power Pivot for Excel
* Addin 8:10 TestAddIn.CoTestAddIn, CoTestAddIn
Addin 9:10 TFCOfficeShim.Connect.15, Team Foundation Add-in
* Addin 10:10 VS15ExcelAdaptor, Visual Studio Tools for Office Design-Time Adaptor for Excel

Log:
============
27-9-2020 17:02:07 37544 Show time: 27-9-2020 17:02:07
27-9-2020 17:02:07 37544 SendMessage Find Windows
27-9-2020 17:02:05 37544 |-------------------------
27-9-2020 17:02:05 37544 |CoTestAddIn error (DoShowForm): the add-in has fired an exception.
TadxXlFormsCollectionItem.CreateForm: Access violation at address 2483680A in module 'TestAddIn.dll'. Read of address 00000220
27-9-2020 17:02:05 37544 |Exception time: 27-9-2020 17:02:05
27-9-2020 17:02:05 37544 |=========================
27-9-2020 16:59:36 37544 GetForm
27-9-2020 16:59:36 37544 TadxXlFormsCollectionItem.SetAppWindowProperty
27-9-2020 16:59:36 37544 DoShowForm
27-9-2020 16:59:35 37544 SendMessage Find Windows
27-9-2020 16:59:35 37544 TadxExcelTaskPanesManager.DoAddInStartupComplete
27-9-2020 16:59:35 37544 Event: OnAddInStartupComplete
27-9-2020 16:59:35 37544 TadxXLHook.CreateEx
27-9-2020 16:59:35 37544 TadxReceiverWindow.AddReceiverCustomMessage(TCustomCommandMessage)3
27-9-2020 16:59:35 37544 TadxReceiverWindow.AddReceiverCustomMessage(THostVisibleChangedMessage)2
27-9-2020 16:59:35 37544 AddHostVisibleChangedMessageToReceiver
27-9-2020 16:59:35 37544 TadxReceiverWindow.AddReceiverCustomMessage(TRegionCloseButtonClickMessage)1
27-9-2020 16:59:35 37544 AddCloseButtonClickMessageToReceiver
27-9-2020 16:59:35 37544 TadxExcelTaskPanesManager.DoAddInInitialize
27-9-2020 16:59:35 37544 Event: OnAddInInitialize
27-9-2020 16:59:34 37544 TadxXlFormsCollectionItem.DeleteAllForms 0
27-9-2020 16:59:34 37544 ADXXlFormsCollectionItem.SetFormClassName
27-9-2020 16:59:34 37544 TadxXlFormsCollectionItem.FormsHideShow
27-9-2020 16:59:34 37544 TadxExcelTaskPanesManager.Create

If I remove the TaskPaneClassName from the adxExcelTaskPanelManager item the AddIn doesn't crash (as it crashes on TadxXlFormsCollectionItem.CreateForm. I have set this value to TadxExcelTaskPanel as per example in the guide.
Posted 28 Sep, 2020 05:24:56 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Hello Remko,

We've received your email and now we look into the issue. I suppose I'll have more info for you later today or tomorrow.


Andrei Smolin
Add-in Express Team Leader
Posted 28 Sep, 2020 05:27:20 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Hello Remko,

We've modified your project and I sent you a download link by email. Check your Inbox.


Andrei Smolin
Add-in Express Team Leader
Posted 28 Sep, 2020 08:12:33 Top