![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, i have a rather simple question with a large background. We have a huge existing VB6 application consisting of 100+ VB6 com components. We are rewriting this app in .NET. Since there is more than 30 man years in the existing aplication, we are doing this step by step. In the meantime, the old components are hosted in the new .NET Winforms application. They all behave in a similar way : they show a list of items and have a toolbar on top of it. The grid and the toolbar are activeX controls, hosted on the main screen of the .NET application. All components expose a COM class with a common interface. These classes are instantiated by the .NET application and passed to the grid. The grid displays fine and behaves as planned. However, when the popup menu of the grid is invoked to display a modal (COM) form. Here however things go wrong. On Windows XP the application occasionally hangs. On Windows Vista the application crashes 95% of the time with the exception : ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageA(MSG& msg) at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.Uns afeNativeMethods.IMsoComponentManager.FPushMessage Loop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() I can explain for 3 more pages but that's not the idea. We have tried everything. *any* idea is welcome. __________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4794 (20100121) __________ Het bericht is gecontroleerd door ESET NOD32 Antivirus. http://www.eset.com |
#3
| |||
| |||
|
|
Hi Willy, Well, I've got this message when my parameters weren't decorated (atributes, out, in modifiers) correctly. "Willy Van den Driessche" wrote: Hi, i have a rather simple question with a large background. We have a huge existing VB6 application consisting of 100+ VB6 com components. We are rewriting this app in .NET. Since there is more than 30 man years in the existing aplication, we are doing this step by step. In the meantime, the old components are hosted in the new .NET Winforms application. They all behave in a similar way : they show a list of items and have a toolbar on top of it. The grid and the toolbar are activeX controls, hosted on the main screen of the .NET application. All components expose a COM class with a common interface. These classes are instantiated by the .NET application and passed to the grid. The grid displays fine and behaves as planned. However, when the popup menu of the grid is invoked to display a modal (COM) form. Here however things go wrong. On Windows XP the application occasionally hangs. On Windows Vista the application crashes 95% of the time with the exception : ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageA(MSG& msg) at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.Uns afeNativeMethods.IMsoComponentManager.FPushMessage Loop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() I can explain for 3 more pages but that's not the idea. We have tried everything. *any* idea is welcome. __________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4794 (20100121) __________ Het bericht is gecontroleerd door ESET NOD32 Antivirus. http://www.eset.com __________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4794 (20100121) __________ Het bericht is gecontroleerd door ESET NOD32 Antivirus. http://www.eset.com |
#4
| |||
| |||
|
|
Hi, i have a rather simple question with a large background. We have a huge existing VB6 application consisting of 100+ VB6 com components. We are rewriting this app in .NET. Since there is more than 30 man years in the existing aplication, we are doing this step by step. In the meantime, the old components are hosted in the new .NET Winforms application. They all behave in a similar way : they show a list of items and have a toolbar on top of it. The grid and the toolbar are activeX controls, hosted on the main screen of the .NET application. All components expose a COM class with a common interface. These classes are instantiated by the .NET application and passed to the grid. The grid displays fine and behaves as planned. However, when the popup menu of the grid is invoked to display a modal (COM) form. Here however things go wrong. On Windows XP the application occasionally hangs. On Windows Vista the application crashes 95% of the time with the exception : ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageA(MSG& msg) at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() I can explain for 3 more pages but that's not the idea. We have tried everything. *any* idea is welcome. __________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4794 (20100121) __________ Het bericht is gecontroleerd door ESET NOD32 Antivirus. http://www.eset.com |
#5
| |||
| |||
|
|
On 1/21/2010 4:36 PM, Willy Van den Driessche wrote: Hi, i have a rather simple question with a large background. We have a huge existing VB6 application consisting of 100+ VB6 com components. We are rewriting this app in .NET. Since there is more than 30 man years in the existing aplication, we are doing this step by step. In the meantime, the old components are hosted in the new .NET Winforms application. They all behave in a similar way : they show a list of items and have a toolbar on top of it. The grid and the toolbar are activeX controls, hosted on the main screen of the .NET application. All components expose a COM class with a common interface. These classes are instantiated by the .NET application and passed to the grid. The grid displays fine and behaves as planned. However, when the popup menu of the grid is invoked to display a modal (COM) form. Here however things go wrong. On Windows XP the application occasionally hangs. On Windows Vista the application crashes 95% of the time with the exception : ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageA(MSG& msg) at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() I can explain for 3 more pages but that's not the idea. We have tried everything. *any* idea is welcome. __________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4794 (20100121) __________ Het bericht is gecontroleerd door ESET NOD32 Antivirus. http://www.eset.com I always suspect one of two things in these types of errors: 1. The COM components are built for 32 bit, and you are running 64 bit. 2. Permissions somewhere in the registry finding the components. You don't say whether the errors happen occasionally/90% on single machines, or those ratios are "of machines tested". I would build for x86 (32 bit) first, and retest, since that is the easiest diagnosis. For the permissions issue, setup a test account with elevated settings to diagnose. -- Mike __________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4795 (20100121) __________ Het bericht is gecontroleerd door ESET NOD32 Antivirus. http://www.eset.com |
#6
| |||
| |||
|
|
Thanks for your reply. Unfortunately, I cannot see why this would be the case 1) The components are built and run on 32 bit 2) The same components run fine on the exact same machine when run from the original COM-only host application |
#7
| |||
| |||
|
|
On 1/21/2010 7:49 PM, Willy Van den Driessche wrote: Thanks for your reply. Unfortunately, I cannot see why this would be the case 1) The components are built and run on 32 bit 2) The same components run fine on the exact same machine when run from the original COM-only host application Sorry, but I may not have explained my point well. If the .Net container app is built with "Any CPU", and run on a 64 bit OS, then the COM components are running in 64 bit mode. This can cause problems such as what you have reported. I suspect your COM-only host is built for 32 bit mode. -- Mike __________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4795 (20100121) __________ Het bericht is gecontroleerd door ESET NOD32 Antivirus. http://www.eset.com |
#8
| |||
| |||
|
|
grid. The grid displays fine and behaves as planned. However, when the popup menu of the grid is invoked to display a modal (COM) form. Here however things go wrong. |
#9
| |||
| |||
|
|
Willy Van den Driessche wrote: grid. The grid displays fine and behaves as planned. However, when the popup menu of the grid is invoked to display a modal (COM) form. Here however things go wrong. Do you have access to the source code for the grid and modal form? If so I'd try to narrow down the problem by removing controls and code from the form to see if and when the issue goes away. __________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4796 (20100122) __________ Het bericht is gecontroleerd door ESET NOD32 Antivirus. http://www.eset.com |
#10
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |