Crystal Reports ActiveX Viewer throws memory exception in VB6 / .NET App Windows 7

Here is a link to an example application that reproduces the error : http://sdrv.ms/17j2Ale

I have three projects. One of them is the Windows Forms.NET 2.0 application (.NET application), one is the VB6 Standard EXE application (VB application), and the other is the VB6 ActiveX DLL (VB DLL). The .NET application refers to a VB DLL that is already registered. This VB DLL runs Crystal Reports. A VB application launches a .NET application through the Shell () command. Here's what happens:

If I run the .NET application directly, I can open the Crystal Reports document without any problems. However, when the VB application starts the .NET application through the Shell () command, when the .NET application tries to open the Crystal Reports document, I get an "Out of memory" error message.

Now here's the kicker - it worked on Windows XP, but when we try to run it on the 64-bit version of Windows 7, we run into this problem. I am sure there is a simple solution for this. Any members?

You can go to update 5, where I narrowed down the problem.

Update . I also tried to create a second Windows Forms.NET.NET (.NET Launcher) application and run the .NET application from it through:

Process.Start(@"C:\Path\OtherApp.exe"); 

and when I tried to open the Crystal Reports document in a .NET application, it still gave me the same error from memory.

Update 2: removed due to update 4

Update 3: So, today I discovered that the reason that the .NET application was open when it was launched directly was because I was running it in Visual Studio. When I tried the executable file outside of Visual Studio, the error is returned. I noticed that Visual Studio started using vshost.exe in 2005 to launch Windows applications to speed up debugging: http://blogs.msdn.com/b/dtemp/archive/2004/08/17/215764.aspx When I disabled the vshost function, a memory error is returned. So I guess the question is, what does this vshost process do that allows it to work with Windows 7?

Update 4: I was able to compile the VB6 DLL with debug information and load the source and debug information in Visual Studio and execute it when the .NET application executes the VB6 code. The Out of Memory exception comes from this line:

 Dim myForm As frmTheForm Set myForm = New frmTheForm 'OOM Error right here 

Therefore, inside vshost.exe this form can be initialized, but not without it.

Update 5: I narrowed down the issue in Crystal Reports ActiveX Viewer. I started the new VB ActiveX DLL project from scratch and only started with the form. It worked every way. Then I added the Crystal View Viewer 11.5 library - and the resulting error! This is definitely a Report Viewer. I was told that this problem can be fixed with a simple registry setting.

Update 6: I used Procmon.exe from Sysinternals and created a log file that can be found here:

http://sdrv.ms/194aO7A

+4
source share
3 answers

I found a workaround for an out-of-memory error; however, this is not an acceptable solution. Apparently, this question is resolved in future versions of crviewer.dll, but Mr. Uer very clearly explains in his answer to my question here: http://scn.sap.com/thread/3405856 that we are not allowed to use versions after 11.5 from due to licensing restrictions. It would seem that this is a general question that he receives. Unfortunately, we are forced to accept the answer that we must upgrade our applications to .NET. If someone else feels adventurous enough to try to eliminate the exception from memory, I would be happy to leave my sample project above accessible to anyone who wants to risk it. Good luck to everyone who feels my pain in supporting CR 11.5 support.

0
source

Not sure if this information will help, but in the past I have run into similar issues with crystals and Web Forms applications. I solved this by making sure that the “Enable 32-bit applications” option is in the application pool? You can find it in advanced settings → General ....

+1
source

I have such problems when I use 32Bit C / C ++ - Dll with .NET code running on 64-bit Windows. If your .NET project has “any platform” as the target, then the runtime compiles the code in 64Bit on 64-bit Windows, on 32-bit Windows, I think you will have no problems.

You must configure your target platform to "x86", you wrote that you did it. Make sure that all your .NET projects in your .NET solution are set as the x86 target.

Crystal Reports * .dll should be 32Bit COM * .dll and VB6 * .dll too.

+1
source

Source: https://habr.com/ru/post/1493541/


All Articles