Form object (containing ActiveX) creation not getting past .EndInit()
Hi,
I am trying to add PDF viewing features to a program (written in C# Visual Studio 2017). It needs to allow multiple PDFs open simultaneously. And repeatedly.
For this purpose I created a form and added the AcroPDFLib into it. I display it (and later hide it) in a separate thread from the main thread, because
my main thread needs to remain interactive (and AcroPDFLib needs to run in Single Thread Apartment mode). When I need to show a
PDF, I create and start a new thread. (I do notice that memory use gradually increases). I use fairly various sizes of PDFs for testing ( 60K up to 50 MB).
In my tests I use several PDFs to verify reliability.
This works fairly well, but from time to time creation of a form fails.Repeating the attempt also fails.
I added logging and found that it is at the line below (in the InitializeComponent() method of the form creation) that it 'blocks':
((System.ComponentModel.ISupportInitialize)(this.axAcroPDF1)).EndInit();
I also notice that if I do this test with only a single PDF type (repeatedly showing and hiding), the issue does not occur.
I use Acrobat Reader DC (2019.012.20035). The operating system I develop on is Windows 7, but I also have this issue on Windows 10.
Has anyone in this forum noticed this? (I have googled the issue and found 1 other user who encountered this; sadly with no further information).
Can anyone suggest a way to fix this?
