Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can CreateObject access remote ActiveX DLL?

Posted on 1999-07-19
15
Medium Priority
?
662 Views
Last Modified: 2008-02-26
not ActiveX EXE.
Fact list:
1. I have registered this remote ActiveX DLL. (I can use it on that remote PC locally)
2. I have generated TLB and VBR files. and I registered that ActiveX DLL on the client PC by using clireg32.exe
3. but CreateObject("class.name","remote_pc_name") on client PC doesn't work.

thanks for any input.
0
Comment
Question by:dian98
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
  • +3
15 Comments
 

Expert Comment

by:pankajss
ID: 1525985
- When you use clireg32, it asks for the remote computer name. There, you should specify the remote computer name.
- Then, if you just use CreateObject("class.name"), this should work. This works for me.


0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1525986
use dcomcnfg.exe on the server machine to set the access rights
0
 
LVL 6

Expert Comment

by:VBGuru
ID: 1525987
dian98,
you use docm when your project is ActiveX EXE not an activex DLL.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 10

Expert Comment

by:caraf_g
ID: 1525988
Exactly!
0
 
LVL 6

Expert Comment

by:VBGuru
ID: 1525989
On a single computer, an ActiveX component runs either in-process or out-of-process with respect to its client. An in-process ActiveX component is implemented as a dynamic-link library (.dll file), and therefore runs in the same process as the consumer of its objects. An out-of-process ActiveX component is an executable (.exe file), such as Microsoft Excel, that runs in its own address space.
An in-process ActiveX component shares the same address space as its client, so calls to the methods of an in-process ActiveX component can use the client’s stack. When you pass a parameter by reference within the address space of the client process — which includes passing it to an in-process server — the procedure you pass it to can access the data directly.
---------

so if you want to call a dll in remote machine
just use createobject("projectname.classname") not as createobject("classname",computername"). Make sure you register the dll before calling it like this
regsvr32 "computername\directoryname\dllname.dll" and you should reference that dll in the referenves in your application.

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1525990
Sorry but MTS supports DCOM only with DLL's.
0
 
LVL 6

Expert Comment

by:VBGuru
ID: 1525991
MTS uses DCOM to communicate between the client and server.
0
 

Author Comment

by:dian98
ID: 1525992
Dcomcnfg.exe cannot even show the name of my DLL (already registered) while I have no problem using it locally by CreateObject.

Fact List:
* I can use that ActiveX DLL remotely by putting it to MTS. but without MTS it doesn't work.

* I changed that ActiveX DLL to ActiveX EXE once. It works perfect with or without MTS.

thanks for the input.

0
 
LVL 6

Expert Comment

by:VBGuru
ID: 1525993
dian98, didn't you try what i told you?
0
 

Author Comment

by:dian98
ID: 1525994
thanks VBGuru, but I don't want to use MTS.

0
 
LVL 6

Expert Comment

by:VBGuru
ID: 1525995
You don't need MTS to do this
>>>("classname",computername"). Make sure you register the dll before calling it like this
regsvr32 "computername\directoryname\dllname.dll" and you should reference that dll in the referenves in your application.

Only thing is that the computer should be available in your network neighbourhood and "directoryname" is sghared with and that dll is placed in that directory. then try registering using the syntax given
regsvr32 "\\computername\directoryname\dllname.dll"
0
 

Author Comment

by:dian98
ID: 1525996
thanks VBGuru, I know how to use regsvr32, but isn't "regsvr32 \\xx\xx.dll" local? at least it acts as local.
The question is how to use ActiveX DLL remotely.  

CASE:
I have ActiveX DLL installed(of coz registered) on ABCD.COM.
Now I want to access this DLL from DEFG.COM by using CreateObject.

QUESTION:
Is it possible?  if so, how?

HINT:
I have no problem accessing ActiveX EXE remotely.

0
 

Author Comment

by:dian98
ID: 1525997
more hint:

are there some sort of proxy-stub support programs I can use beside MTS?

0
 
LVL 6

Expert Comment

by:VBGuru
ID: 1525998
dian98
Its not possible. you can only use Activex EXE for this kind.
>>thanks VBGuru, I know how to use regsvr32, but isn't "regsvr32 \\xx\xx.dll" local? at least it acts as local.

Yes it is local only thing is that it gets the dll from that place.
0
 
LVL 1

Accepted Solution

by:
danchr earned 420 total points
ID: 1525999
It is my understanding of dcom that the object itself is instansiated and run on its local server machine, and passes a ole proxy type interface to the calling process on the client machine.  This makes sence, as the point of dcom is to allow distributed applications, where various processes are run on the server and not the client.  This works just fine for an activex exe, as the exe runs in its own process space.  An activex dll however, cannot produce its own process space to run in.  This means that for you to call a dll on a server machine, you would have to provide it some kind of process space to run in.  You could use MTS to do this, but as you do not want to use MTS, I can only suggest you encapsilate the dll in an activex exe.  Just build an exe with classes that implement the various interfaces of the dll, and pass the function calls through to the dll.  As far as I can see, your only other choice for using the dll, is to distribute it with the client and have it run on the local machine.  From your question and comments, it looks like your trying to do this in a very complex way, that would load the dll into the client process, accross the network, every time the application needs to reference a new copy of the dll.  
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question