This article was previously published under Q294888
This article has been archived. It is offered "as is" and will no longer be updated.
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).
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 theMicrosoft 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
Microsoft has confirmed that this is a problem in Microsoft Windows 2000. This problem was first corrected in Windows 2000 Service Pack 2.
Steps to Reproduce Behavior
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 "kernel32" (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.
Create the Client
Create a new Standard EXE project in Visual Basic. Form1 is created by default.
From the Project menu, click References, select the proServer.exe check box, and then click OK.
Add a CommandButton control to Form1.
Add the following code to Form1:
Private obj As proServer.clsServerPrivate Sub Command1_Click() Set obj = New proServer.clsServer obj.DoSomething (100000)End Sub
Save the project. From the File menu, click Make project1.exe to compile the client.
Reproduce the Blocking Behavior
On a Windows 2000-based computer, run two instances of the client EXE.
On the first client instance, click Command1 to start proServer.exe.
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.