Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘invalid page fault’

BUG: Error in CoolBar Event Can Cause Hanging or Exception

Symptoms
When using a CoolBar control, your compiled application hangs or generatesan exception error or invalid page fault (IPF.)
Resolution
An unhandled error occurred in one of the CoolBar’s Events.

FIX: Visual Basic 5.0 Crashes When Shutting Down Forms

Symptoms
Closing a modal form in the Visual Basic 5.0 design environment may causeone of the following errors:

“Access Violation: Unhandled exception in VB5.EXE 0xC0000005: AccessViolation” (Windows NT4)
-or-

“VB has caused an invalid page fault in module VB5.EXE at 0137:00419f1e”(Windows 95, Windows 98, and Windows Me)
Resolution
Visual Basic is trying to get the thread data from a control after it hasbeen unloaded. The error code that signaled that the control got unloadedis not handled properly.

BUG: SSTab Control Containing OLE Control May Crash

Symptoms
On a Visual Basic form, an OLE control is placed on a Microsoft TabbedDialog control. You write code to embed a file into the OLE control usingthe CreateEmbed method. When the user clicks the tab that contains the OLEcontrol, one of the following errors occur and the application terminates:

VB5 caused an invalid page fault in module TABCTL32.OCX at0137:212f8b26.-or-

<Project Name> executed an invalid instruction in module OLE32.DLL at0137:65fa93ae.-or-

Exception: Access violation (0xc0000005), Address: 0×212f8b26
Resolution
To work around this problem, do one of the following:Place the OLE control inside a Frame control.
-or-Make the Tab that contains the OLE control the active tab before usingthe CreateEmbed method.

BUG: IDE Crash with Compiled GlobalMultiUse

Symptoms
If the Terminate event of a GlobalMultiUse class calls a procedure inanother DLL, and if the same GlobalMultiUse class had previously called thesame DLL, then you receive an error and the IDE may crash.
With Visual Basic 5.0, you may receive one of the following errors:

Exception: privileged instruction (0xc0000096), Address: 0×00186a3a
-or-

VB5 caused an invalid page fault (or general page fault)
With Visual Basic 6.0, the IDE does not crash, but you may receive thefollowing error:

Run-time error ‘-2147418105 (80010007)’:
Automation error
This error translates to:

“The callee (server [not server application]) is not available and
disappeared; all connections are invalid. The call may have executed.”
Resolution
This problem can occur when the ActiveX components are not shut down in thenecessary order when your client application ends. For example, supposeyour client application uses two ActiveX DLLs (DLL1 and DLL2). If theTerminate event of a class in DLL2 calls a procedure in DLL1, but DLL1 hasbeen shut down before DLL2, you can experience this problem because theprocedure in DLL1 is unavailable. The “Steps to Reproduce Behavior” sectionof this article demonstrates this scenario and shows how to work around theproblem by controlling the order in which the two DLLs shut down.

BUG: Crash When Closing Application That Uses ActiveX DLL

Symptoms
Using Visual Basic, you create one or more ActiveX DLLs and a Standard EXE(client) application to use the DLLs. The client application runs asexpected within the Visual Basic (IDE) environment. However, when youcompile and run the client application as an EXE, the application producesone of the following errors upon closing:

<project name> caused an invalid page fault inmodule MSVBVM50.DLL at 0137:0f059b41.
-or-

Exception: access violation (0xc0000005), Address: 0×0f059b41
Resolution
This problem can occur when the objects you create in the DLL are notclosed properly by the client application due to a circular reference. Acircular reference occurs, for instance, in the following scenario:
A client application instantiates an object in the ActiveX DLL: theParent object. The Parent object creates another object in the DLL: theChild object. The Parent object sets a property in the Child object thatallows the Child object to have a reference to the Parent object.
This creates a circular reference between the Parent and Child objects.When the client application that created the Parent object sets its objectvariable to Nothing, the Parent object does not terminate because the Childobject maintains a reference to the Parent object. The MORE INFORMATIONsection below describes a specific case for this problem and provides asolution, which is to remove the Child’s reference to the Parent objectbefore closing the Parent object.