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!

How do I Create an Activex exe ?????

Status
Not open for further replies.

Sun

Programmer
Aug 13, 1999
37
0
0
IN
Visit site
Hi

I am developing a Activex Exe.
That exe is going to be an MDI application, with child windows in it, the problem that I am facing is that I want the client to create only one instance of that Activex Exe, so how do I do that, I guess there is a concept of Singleton Objects, in which only one instance of that exe is created.

For eg : When the Client App Clicks on a menu item he will create and instance of the Interface exposed by the Activex Exe and Create the MDI app and the Chuld window in it, now when the user again Clicks on the menu, the same MDI app will display a second Chuild Window, without creating another instance of that Exe, is there a way of doing this.

I am really stuck.
Thank you for all the help.

Regards
SUN [sig][/sig]
 
I have developed several COM servers in C++ with this sort of requirement. I don't know if this will be applicable to you but here goes..

In a C++ COM server application one of the tasks whick you must do during initialization of the server object is to call CoRegisterClassObject (See MSDN for further details). One of the parameters to this (flags) specifies the rules for the number of clients that may connect to the server at one time. The values are as follows ..


REGCLS_SINGLEUSE
REGCLS_MULTIPLEUSE
REGCLS_MULTI_SEPARATE
REGCLS_SUSPENDED
REGCLS_SURROGATE

The one you want is REGCLS_MULTIPLEUSE. This defines that more than one client may connect at a time. If you use REGCLS_SINGLEUSE, then a new instance of the server will be started for each client request. Further details can be found in the MSDN.

I presume there are equivalents of this in other development languages.

Hope this helps
 
You could do this rather easily with atl . Add a new simple atl object to the project. In your main class add the macro DECLARE_CLASSFACTORY_SINGLETON . Build your exe. This should do the trick.

But i need to do the same in VB.. Could you please help me???

mail: binith.t@svw.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top