Hi,
I’m using Hydra 3.0(Spring 2011 edition) with Delphi 7(all updates).
I have an application that is using two plugin architectures (SmartPlugin and Hydra). We are going to gradually migrate all the plugins to Hydra, but for now there are too many plugins to do that for our next release.
The problem that I’m having is with a plugin, created with Hydra, that will be common throughout the application(essentially a patient information banner).
Here’s the scenario:
- Host Application - - Contains a HydraModuleManager on the main form of the application.
- SmartPlugin A(Patient List) - Contains a HydraModuleManager on the main form of the plugin.
- SmartPlugin B(Patient File) - Contains a HydraModuleManager on the main form of the plugin.
- Hydra Plugin C(Patient Information Banner) - Common visual embeddable plugin used by Host Application, SmartPlugin A and SmartPlugin B.
The Host Application loads SmartPlugin A.
SmartPlugin A loads Hydra Plugin C and C is embedded in a panel that shows some patient information for the selected patient in the list. When it comes to open a patient file(SmartPlugin B) from the Patient List(SmartPlugin B), SmartPlugin A sends a message to the Host Application to load a Patient File(SmartPlugin B) for the selected patient(this is done that way so that it is easier to manage multiple opened patient files and since a patient file is not a modal window).
SmartPlugin B loads Hydra Plugin C and C is embedded in a panel that is part of the Patient File main form.
Here’s the steps that I do to reproduce the error:
- I open the Patient List(SmartPlugin A)
- I select a patient to open the Patient File(SmartPlugin B)
- I close the Patient File
- I select a patient to open the Patient File(SmartPlugin B)
- An Access Violation error occurs
Here’s the lines of code in TPatientFileFRM.FormShow:
HYModuleManager1.LoadModule(ExtractFilePath(Application.ExeName)+‘PatientInformationSections.dll’, False);
HYModuleManager1.CreateInstance(‘PatientBanner’, vPatientBanner);
(vPatientBanner as IHYVisualPlugin).ShowParented(bsspPatientBanner);
The error occurs at the LoadModule line. And, I’ve also tried with the parameter InNewAppDomain = True, with no difference.
Here’s the call stack:
exception class : EAccessViolation
exception message : Access violation at address 4003CFA9 in module ‘rtl70.bpl’. Read of address 00000004.
main thread ($25a0):
4003cfa9 rtl70.bpl Classes TComponent._Release
01dd1d3f Hydra_Core_D7.bpl Uhymodulemanager THYModuleManager._Release
40009621 rtl70.bpl System @IntfCopy
01dc9966 Hydra_Core_D7.bpl Uhymodulecontroller THYModuleController.SetHost
01dd14da Hydra_Core_D7.bpl Uhymodulemanager THYModuleManager.LoadUnmanagedModule
01dd176e Hydra_Core_D7.bpl Uhymodulemanager THYModuleManager.LoadModule
11d9c1be SLibPatientFile.spi SLibPatientFile_PatientFileFRM 1053 TPatientFileFRM.FormShow
03ea19bf users_v20.bpl Users TUsersReg.FormShow
00f6e0f1 vcl70.bpl Forms TCustomForm.DoShow
00f71115 vcl70.bpl Forms TCustomForm.CMShowingChanged
00f51a98 vcl70.bpl Controls TControl.WndProc
00f54c97 vcl70.bpl Controls TWinControl.WndProc
00f6e87d vcl70.bpl Forms TCustomForm.WndProc
11cf239f SLibPatientFile.spi BusinessSkinForm 14360 TbsBusinessSkinForm.NewWndProc
00f51868 vcl70.bpl Controls TControl.Perform
00f547eb vcl70.bpl Controls TWinControl.UpdateShowing
00f54856 vcl70.bpl Controls TWinControl.UpdateControlState
00f56716 vcl70.bpl Controls TWinControl.CMVisibleChanged
00f51a98 vcl70.bpl Controls TControl.WndProc
00f54c97 vcl70.bpl Controls TWinControl.WndProc
00f6e87d vcl70.bpl Forms TCustomForm.WndProc
11cf239f SLibPatientFile.spi BusinessSkinForm 14360 TbsBusinessSkinForm.NewWndProc
00f51868 vcl70.bpl Controls TControl.Perform
00f50427 vcl70.bpl Controls TControl.SetVisible
00f6e372 vcl70.bpl Forms TCustomForm.SetVisible
00f71bef vcl70.bpl Forms TCustomForm.Show
11d45a45 SLibPatientFile.spi SLibPatientFile_Pin 118 TspiSLibPatientFile.OnInitialize
03fb64be atsSPI2204rp70.bpl Atsspiru TatsSpi.Initialize
03fa8e04 atsSPI2204rp70.bpl Atsspiru TatsSpiBase.LoadPlugin
03fac22d atsSPI2204rp70.bpl Atsspiru TatsSpiBase.LoadPlugin
0045d165 FiloptoCore.exe fMain 3670 TFiloptoMainForm.ManagerMessage
03fb16a9 atsSPI2204rp70.bpl Atsspiru TatsSpiBase.TakeMessage
03fafac2 atsSPI2204rp70.bpl Atsspiru TatsSpiBase.SendMessageToAll
03fb011c atsSPI2204rp70.bpl Atsspiru TatsSpiBase.SendMessageToAll
0c2bb28a SLibPatientManager.spi SLibPatientManager_PatientManagerFRM 595 TPatientManagerFRM.cxgrdbndtblvwPatientListDBBandedTableView1OpenFilePropertiesButtonClick
0300a0c3 cxEditorsD7.bpl cxEdit 7809 TcxCustomEdit.DoButtonClick
0300ac34 cxEditorsD7.bpl cxEdit 8119 TcxCustomEdit.DoProcessEventsOnViewInfoChanging
0283f29f cxLibraryD7.bpl cxContainer 4480 TcxContainer.ProcessEventsOnViewInfoChanging
0283ed43 cxLibraryD7.bpl cxContainer 4332 TcxContainer.RefreshContainer
0283d505 cxLibraryD7.bpl cxContainer 3682 TcxContainer.MouseUp
0302ea74 cxEditorsD7.bpl cxMaskEdit 2885 TcxCustomMaskEdit.MouseUp
00f52024 vcl70.bpl Controls TControl.DoMouseUp
00f52099 vcl70.bpl Controls TControl.WMLButtonUp
00f51a98 vcl70.bpl Controls TControl.WndProc
00f54c97 vcl70.bpl Controls TWinControl.WndProc
0284b8e8 cxLibraryD7.bpl cxControls 3611 TcxControl.WndProc
0283d962 cxLibraryD7.bpl cxContainer 3811 TcxContainer.WndProc
0301bbda cxEditorsD7.bpl cxTextEdit 5171 TcxCustomTextEdit.WndProc
00f54914 vcl70.bpl Controls TWinControl.MainWndProc
74937bc5 user32.dll DispatchMessageA
00f7568b vcl70.bpl Forms TApplication.ProcessMessage
00f756c2 vcl70.bpl Forms TApplication.HandleMessage
00f758f2 vcl70.bpl Forms TApplication.Run
00465d59 FiloptoCore.exe FiloptoCore 54 initialization
765b3398 kernel32.dll BaseThreadInitThunk
Any help would be appreciated.
Daniel Rail
Senior Software Developer
Accra Solutions Inc. (www.accra.ca)
Accra Med Software Inc. (www.filopto.com)