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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an object from COM+ using CreateObject

Status
Not open for further replies.

challer

Programmer
Jan 9, 2001
30
US
In my VB app, when I create an object from COM+, I use the CreateObject function. In the books that I've read for examples, all from Wrox, they don't use the servername parameter of the CreateObject when they create their objects. However, my application won't work unless I use this parameter.

Example:
Set objMyObject = CreateObject("svrPersist.MyObject", PERSIST_SERVER)

Is this something I should worry about? Am I doing something wrong?

Thanks
Clay Haller
 
Dear Clay Haller
well the second parameter of CreateObject is optional,i mean server name is optional,u need to tell the second parameter as The name of the network server where the object will be created. If servername is an empty string (""), the local machine is used.
so it depends upon where u want to instatiate the components
now as far as COM+ is concerned you are doing some thing which is required to do
As u said
"However, my application won't work unless I use this parameter. "
as you are now clear that the second parameter is optional so your application should run so now the problem is what do to remedy the error,i can tell you startight away the possible cause of the problem but let me first ask some question why can give me more sight of the problem
first tell me are your development machine hosting the MTS services means are u using Win2k Prof and installed the COM+ componnets in the Component Services? if no then you have to installed COM+ components in the component service from where u can tell whether to use the current machine for it or remote server for it..
okay let me know i will be here for ur response
Regards
Nouman


 
Hi Nouman,

My development machine is running Win2k Prof. I've installed my COM+ components onto a Win2k Server. According to the books I've read for MTS 2.0, you export the package which creates a clients folder. This clients folder has a setup.exe that you can run on the client machine so that it can access the components on the server.

With COM+, how do you tell the client machine(s) where to find the components? It doesn't create that clients folder with the setup utility.

Thanks,
Clay
 
Nouman,

I think I figured it out. I exported the components from the Component Services as an Application Proxy instead of a server application. After installing the MSI file on my client, I didn't have to use the second parameter in the CreateObject function.

Regards,
Clay
 
Hii
i use win2k Server to deploy my com components, how could i access these components from my win98 clients

regards
Shoj
 
Shoj, if you put compontents into MTS the easiest way to access them is export the package that you put them in and run the client setup on the 98 machine. This will create a directory under
C:\Program Files\ComPlus Applications
with the GUID of your library.
The DLL, which will only be used for the public interface and networking code (called the Proxy) will go in there. The registry will be set up to launch that DLL and connect to what ever server you exported from (I won't go into packages exported for other servers).


Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top