Microsoft KB Archive/186270

= BUG: SSTab Control Containing OLE Control May Crash =

Article ID: 186270

Article Last Modified on 3/3/2005

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Studio 97 Service Pack 3

-



This article was previously published under Q186270



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

VB5 caused an invalid page fault in module TABCTL32.OCX at 0137:212f8b26.

-or-

 executed an invalid instruction in module OLE32.DLL at 0137:65fa93ae.

-or-

Exception: Access violation (0xc0000005), Address: 0x212f8b26



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 using the CreateEmbed method.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a new Standard EXE project. Form1 is created by default. Choose Components from the Project menu and add a reference to the "Microsoft Tabbed Dialog Control 5.0." Add an SSTab control to Form1. By default, there will be three tabs named Tab0, Tab1 and Tab2. Add a CommandButton to Form1. Add an OLE control to the first tab, Tab0, of the SSTab control. Choose Cancel when prompted to insert an object.  Paste the following code into the code window of Form1: Private Sub Command1_Click 'Set the current tab to the second tab SSTab1.Tab = 1

'Embed a bitmap into the OLE control OLE1.CreateEmbed "C:\VB5\Graphics\Bitmaps\Assorted\Envelope.bmp" End Sub  Change the path in the code above to a valid BMP file on your system.</li> Save and run the project.</li> Click Command1. Click Tab0 and note that the OLE control displays the bitmap file.</li> Click Command1 and then click Tab0. Note that Visual Basic terminates with one of the errors mentioned above. If no problem occurs, repeat steps 7 and 8. If the problem still does not occur, try restarting Visual Basic and repeat the steps beginning at step 6. This problem also occurs when running the project as a compiled .exe file.</li></ol>

Workaround
To work around this problem, put a Frame control on Tab0 and then put the OLE control inside the Frame control. Size the Frame control so it is large enough to accommodate the OLE control and set the Borderstyle property of the Frame control to 0 if you wish to hide the Frame's border and caption.

Additional query words: ipf OLE container

Keywords: kbbug kbctrl kbpending kbusage KB186270

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.