Microsoft KB Archive/294888

= FIX: Instantiation of ActiveX EXE SingleUse Objects Is Blocked on Windows 2000 =

Article ID: 294888

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition, when used with:
 * Microsoft Windows 2000 Standard Edition

-



This article was previously published under Q294888



SYMPTOMS
If a client instantiates an object from a SingleUse class in an ActiveX EXE server, and another client tries to instantiate the same SingleUse class while the first instance is processing messages (for example, while the first instance is running some code), the second client is blocked. Thus, the second instance of the ActiveX EXE is not started until the first instance has finished processing.

This blocking occurs only in environments that are running Windows 2000 and Windows 2000 Service Pack 1 (SP1). Blocking does not occur on Windows NT 4.0 (in any of its service packs).



RESOLUTION
To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack

Another resolution to this issue is found in the following Microsoft Knowledge Base article:

313582 INFO: Availability of Windows 2000 Post-Service Pack 2 COM+ Hotfix Rollup Package 18.1



STATUS
Microsoft has confirmed that this is a problem in Microsoft Windows 2000. This problem was first corrected in Windows 2000 Service Pack 2.



Create the Server
 Create a new ActiveX EXE project in Visual Basic. Class1 is created by default. From the Properties window, change the Instancing property of Class1 to SingleUse. Rename Class1 as clsServer . Rename the project proServer .  Add the following code to clsServer: Private Declare Sub Sleep Lib &quot;kernel32&quot; (ByVal dwMilliseconds As Long)

Public Sub DoSomething(x As Long) Sleep (x) End Sub  Save the project. From the File menu, click Make proServer.exe to compile the project.</li></ol>

Create the Client
<ol> Create a new Standard EXE project in Visual Basic. Form1 is created by default.</li> From the Project menu, click References, select the proServer.exe check box, and then click OK.</li> Add a CommandButton control to Form1.</li>  Add the following code to Form1: Private obj As proServer.clsServer

Private Sub Command1_Click Set obj = New proServer.clsServer obj.DoSomething (100000) End Sub </li> Save the project. From the File menu, click Make project1.exe to compile the client.</li></ol>

Reproduce the Blocking Behavior

 * 1) On a Windows 2000-based computer, run two instances of the client EXE.
 * 2) On the first client instance, click Command1 to start proServer.exe.
 * 3) On the second client instance, click Command1. Notice that no new instance of proServer.exe is started until the first instance has finished processing the DoSomething call.

Additional query words: kbIISCom launch

Keywords: kbbug kbclient kbclientserver kbfix kblocalsvr kbwin2000sp3fix KB294888

-

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

© Microsoft Corporation. All rights reserved.