PRB: Error 406 Accessing an MTS Component in a Library Package (233997)
The information in this article applies to:
- Microsoft Transaction Server 2.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q233997 SYMPTOMS
When attempting to show a form from a Visual Basic client EXE after creating objects in a Microsoft Transaction Server (MTS) Library package, you may get the following error message:
"Run-time error '406': Non-modal forms cannot be displayed in this host application from an ActiveX DLL, ActiveX Control, or Property Page."
This message appears only when the compiled EXE is used. If the client application is run from the Visual Basic IDE, the problem does not manifest itself.
The problem may also be detected as a changing App.NonModalAllowed property in the client EXE project.
In some situations (described in the MORE INFORMATION section) an Application Error can appear as well, which on Windows NT could have the following error message:
OleMainThreadWndName: [ProjectName.exe] - Application Error
The instruction at "[address]" referenced memory at "0x00000010". The memory could not be "read".
CAUSE
The objects in the MTS Library package are created in a Visual Basic 6 project marked as an Apartment Threaded.
RESOLUTION
Change the Threading Model value to "Single Threaded" on the ActiveX DLL project's Properties form, on the General tab. Recompile the ActiveX DLL and redeploy into the MTS package.
STATUS
Microsoft is aware of this problem. We will keep you updated by means of the Knowledge Base, MSDN articles, and other online resources.
REFERENCES
MTS 2.0 Online Help
For information on creating a Visual Basic application which uses components installed under Microsoft Transaction Server, please see the following article in the Microsoft Knowledge Base:
186342: HOWTO: Create a 3-Tier App Using VB, MTS and SQL Server
Modification Type: | Major | Last Reviewed: | 6/18/2001 |
---|
Keywords: | kberrmsg kbprb KB233997 |
---|
|