Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-threaded class "failed to create object"

Status
Not open for further replies.

enuss

MIS
Mar 16, 2004
37
0
0
US
Hey all,

I have an application that is running on a server using a Citrix solution to distribute to users. The app is a VB application that runs the engine for a data transformation program called Business Integrator. It has a function in it that is activated by a button push, which allows for multiple calls to the same class so that multiple data transformations can be run at the same time by the same user. What we are seeing on rare ocassions is the "Failed to create object" error when attempting to create a new object of the class that I am referring to. This will also close the current object that is open for the user, sometimes causing them to have to restart a data transformation that was almost complete. Here is the class:

Sub NewFormThread(Optr As Long, MainFormHandle As Long)
'The interesting part is here
'We store the WindowHandle of the MainWindow and a pointer
'to the Main Window Form by using the SetProp function against
'The Hwnd of the New Form as a virtual property
Dim Frm As New frmMain
Frm.Show
SetProp Frm.hwnd, "MAINHWND", MainFormHandle
SetProp Frm.hwnd, "OBJPTR", Optr
Set Frm = Nothing
End Sub

I have it setup with DataBindingBehavior to 0, Instancing to 5, and Persistable to 0. I am unsure if maybe one of these might be causing the issue. I am wondering if it has something to do with two users attempting to create an instance of the object at the same time? If this is the case, any tips on how to eliminate this?

Thanks so much!

Erich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top