My Company have an application build in VB6, which I have been updating for a few years. All new changes are mostly in the way of C# Com Interop Libraries, so eventually porting the main App to .Net will be easier.
We are preparing a big release, which we are out of schedule. The main problem we are experiencing is that the application crashes in testing PCs, but not in my development one, which is a Windows XP Pro SP3.
The crashing happens calling a method of one of the COM Interop libraries, which is written in C# and built for .Net 4.0. The method call is below:
' Create and set preloaded list object
Private Sub LoadPreLoadList(PreloadCategoryID As Integer, NoEnteringOffSiteHours As Boolean)
Dim intI As Integer
Dim lngCharPos As Long
Dim strPreloadName As String
Dim curPreldItemData As Long
Dim blnComboHasBeenCleared As Boolean
Dim PreloadListObj As PreloadedList
Dim RFIDUserObj As RFIDUser
Set PreloadListObj = New PreloadedList
Set PreloadListObj.DBProperties = GetDBPreloadListProperties()
blnComboHasBeenCleared = False
' Retrieve provided preloaded category
' ==> The next line is causing the Access violation
If PreloadListObj.LoadPreloadedNamesList(PreloadCategoryID) Then
==> execution do not pass to this point <==
' Other process ...
The LoadPreLoadList() procedure is called from another procedure while loading the form. Before calling LoadPreLoadList() , other COM interop objects are created and methods are called without problem, which also use an OleDBConnection (open, reading and closing it).
One interesting thing is that if a call LoadPreLoadList(), from a button in the form, the operation is clear, no crash.
I'm attaching the WinDbG files for the crashing system and the one from my developmenten PC, which is working without problems.
We have tested in Windows 7 and Windows XP, with same results.