TAdvPreviewDialog error

Having purchased and installed the vcl ui pack for Delphi XE2, I find that I cannot run my program because the TAdvStringGrid cant find the TAdvPreviewDialog. The TAdvPreviewDialog component is installed on the Tool Pallete and I can add the TAdvPreviewDialog to the form. However, the program crashes becuase it cannot find this component. I have searched the entire computer file system for any file using the string 'advpreviewdialog' Nothing was found. I dont even want to use this particular component, but I cant use this tool kit without it. I have searched on both Windows 10 and Windows XP. No such file found. My program builds correctly. Its only at run time this error occurs.
Hopefully I can get some assistance with this issue.

This class is in unit AsgPrev.pas
I cannot see any problem with this here. I can add this component TAdvPreviewDialog on the form and compile & run the app or I can also compile & run an app with TAdvStringGrid.
What exact error message do you get for executing what exact code?

Here are all the details
Windows XP. Delphi XE2.. Trying to rescue an old program written in VB6. I created delphi DLLs that work fine in the VB6 program, until I add a form with a AdvStringGrid on it. The DLL immediately crashes when trying to open that form. This has been a serious problem for months, I had no idea what was causing it until now. The DLL contains a call to a form that has a simple AdvStringGrid and a few buttons. It does not have the AdvPreview Dialog on the form as I dont use it. I have used the AdvStringGrid for years. I have never seen anything like this. The error message simply says it cant find TAdvPreviewDialog. This error does not occur when the delphi test app runs alone. However, I need DLLs to interface with the VB app. Adding asgprev to the dll made no difference.

1 Like

I suspect it must be related to using it from a DLL.
Can you try call RegisterClass(TAdvPreviewDialog) in the initalisation section of this DLL code?

Yes that worked. Now its going through each TMS component forcing me to register each one in the same way. However, that was only related to the AdvStringGrid so there was only 4 or 5. Brilliant. It worked. WinXP Win10 and Win11 are all happy. Thanks soo much.