Re: In process/Out of process question
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Fri, 17 Mar 2006 18:03:31 -0800
"Robin" <me@xxxxxxxxxxx> wrote in message
news:rask1218k6ifvte4u073q7qv3hvrg9ledm@xxxxxxxxxx
Below I give my understanding of various cases.. Please feel free
to make comments/corrections.
1) A class inside my own app
This of course runs in process. I have always used New to
instantiate, but can you use CreateObject in this?
And which is more efficient?
To use CreateObject, the class must be registered in the registry, with a path
to the providing app (identified in the registry as the InProcServer32), and a
class name of the form app.class, i.e. Excel.Sheet.8. So it won't really work
with a class defined in a standard exe, although it could if you made and
registered an ActiveX exe.
2) A component external to my app but residing on the same
computer.
a) An ActiveX DLL
Does this run in or out of process?
I can use both New (if reference is set) and CreateObject.
Which is more efficient in this case?
b) An ActiveX EXE
This has to be running out of process.
Does using New or CreateObject make any difference in
this case?
An ActiveX dll runs in process, while the ActiveX exe runs out of process. There
is little else to differentiate the two, except that an ActiveX exe can also be
run on its own (Excel is an ActiveX exe).
To load the reference, VB will end up looking in the registry anyway, so it
probably doesn't make much difference, except that it might have to look in the
registry only once to load a referenced component, but multiple times if you use
CreateObject for each object instance.
3) A component runnimg on a different computer, whether
a DLL or EXE
This also has to be out of process.
I think in this you have to use CreateObject, because you
have to specify the name of the computer where the
component resides.
Is it possible to use New in this?
And even if you could, does it make any difference?
I don't think you could use New anyway, and for a remote computer, the network
latency will vastly exceed any timing difference between New and CreateObject.
.
- Prev by Date: Re: Early and late binding question
- Next by Date: Re: image vb 6
- Previous by thread: vbScript Help.
- Next by thread: Re: Help: Why don't SUBs execute instantly?
- Index(es):
Relevant Pages
|