Hi!
I've done my first little COM component (using the clr) and after signing,
regasm and gacutil I can call it from vbscript.
set X = createobject("ComComponent.Class1")
msgBox X.Testfunktion(2)
But the problem we're facing is that for a real development of several
components (currently existing as scripting components) we need to be able
to call them by their path names. The situation is this:
We want to use those components to extend a PCB CAD tool.
At any time several users work with several projects, each CAD-Tool session
works with one project only. We typically release our components first for one
project/user combination only and after this "beta" test for all projects.
So, we have the following directory structure:
....\BETA.ComponentName.PCBName.Username
....\FINAL.ComponentName.ALL.ALL
Those directories sit in a shared network drive and we really can't afford
to register and "install" each component on each client PC. We will release
very often, on average daily.
I'm looking for a way that lets me instantiate a component in VBScript
like this:
Dirname = figurOutDirName(ComponentName, PCBName,Username)
set X = createobject(Dirname&"\whatever.something")
X.myMethod(...)
Is this possible?
Lots of Greetings!
Volker
--
For email replies, please substitute the obvious. 5 1604
"Volker Hetzer" <fi****************@ieee.orgwrote in message
news:ep**********@nntp.fujitsu-siemens.com...
Hi!
I've done my first little COM component (using the clr) and after signing,
regasm and gacutil I can call it from vbscript.
set X = createobject("ComComponent.Class1")
msgBox X.Testfunktion(2)
Well, you haven't really created a COM object. What you have done is create
a .NET object and wrapped it inside a COM interop. (Maybe I'm nitpicking).
But the problem we're facing is that for a real development of several
components (currently existing as scripting components) we need to be able
to call them by their path names. The situation is this:
We want to use those components to extend a PCB CAD tool.
At any time several users work with several projects, each CAD-Tool
session
works with one project only. We typically release our components first for
one project/user combination only and after this "beta" test for all
projects.
So, we have the following directory structure:
...\BETA.ComponentName.PCBName.Username
...\FINAL.ComponentName.ALL.ALL
Those directories sit in a shared network drive and we really can't afford
to register and "install" each component on each client PC. We will
release
very often, on average daily.
I'm looking for a way that lets me instantiate a component in VBScript
like this:
Dirname = figurOutDirName(ComponentName, PCBName,Username)
set X = createobject(Dirname&"\whatever.something")
X.myMethod(...)
Why not do it this way. Create two "COM objects", one that is beta and one
that is final. Each have different ProgID's and different GUID's
Then...
ProgId = figureOutProgId(ComponentName, PCBName, Username)
Set X = CreateObject (ProgId)
Brian Muth schrieb:
"Volker Hetzer" <fi****************@ieee.orgwrote in message
news:ep**********@nntp.fujitsu-siemens.com...
>Hi! I've done my first little COM component (using the clr) and after signing, regasm and gacutil I can call it from vbscript. set X = createobject("ComComponent.Class1") msgBox X.Testfunktion(2)
Well, you haven't really created a COM object. What you have done is create
a .NET object and wrapped it inside a COM interop. (Maybe I'm nitpicking).
I know, but you re correct nevertheless. :-)
>
>But the problem we're facing is that for a real development of several components (currently existing as scripting components) we need to be able to call them by their path names. The situation is this: We want to use those components to extend a PCB CAD tool. At any time several users work with several projects, each CAD-Tool session works with one project only. We typically release our components first for one project/user combination only and after this "beta" test for all projects. So, we have the following directory structure: ...\BETA.ComponentName.PCBName.Username ...\FINAL.ComponentName.ALL.ALL Those directories sit in a shared network drive and we really can't afford to register and "install" each component on each client PC. We will release very often, on average daily.
I'm looking for a way that lets me instantiate a component in VBScript like this: Dirname = figurOutDirName(ComponentName, PCBName,Username) set X = createobject(Dirname&"\whatever.something") X.myMethod(...)
Why not do it this way. Create two "COM objects", one that is beta and one
that is final. Each have different ProgID's and different GUID's
Then...
ProgId = figureOutProgId(ComponentName, PCBName, Username)
Set X = CreateObject (ProgId)
And in the directory structure I find a description file with the correct ProgID?
Sounds good.
Now there remain two issues.
1) Do I have to "install" the assemblies on each client machine? I'd very much
like to avoid this.
2) Can I utilize the manifest or config file and record some properties
("ForProjectOnly=PCBName") there? And can then the "figureOutProgId" function
or component somehow browse the available shared assemblies?
Lots of Greetings and Thanks!
Volker
--
For email replies, please substitute the obvious.
"Volker Hetzer" <fi****************@ieee.orgwrote in message
news:ep**********@nntp.fujitsu-siemens.com...
Hi!
I've done my first little COM component (using the clr) and after signing,
regasm and gacutil I can call it from vbscript.
set X = createobject("ComComponent.Class1")
msgBox X.Testfunktion(2)
But the problem we're facing is that for a real development of several
components (currently existing as scripting components) we need to be able
to call them by their path names. The situation is this:
We want to use those components to extend a PCB CAD tool.
At any time several users work with several projects, each CAD-Tool
session
works with one project only. We typically release our components first for
one project/user combination only and after this "beta" test for all
projects.
So, we have the following directory structure:
...\BETA.ComponentName.PCBName.Username
...\FINAL.ComponentName.ALL.ALL
Those directories sit in a shared network drive and we really can't afford
to register and "install" each component on each client PC. We will
release
very often, on average daily.
I'm looking for a way that lets me instantiate a component in VBScript
like this:
Dirname = figurOutDirName(ComponentName, PCBName,Username)
set X = createobject(Dirname&"\whatever.something")
X.myMethod(...)
Is this possible?
No it's not, but you can get the same effect.
Create a factory class in .NET which is exposed via COM, and contains a
CreateComponent(ComponentName, PcbName, UserName) method. Then your VB will
do:
set X = createobject(factoryClsid).CreateComponent(Compone ntName,
PCBName,Username)
X.myMethod(...)
Your Factory object will use Assembly.Load(fileName) and Activator class,
which does not require any additional registration. If you're using early
binding, then the COM interfaces used by the consumer will need to be in a
registered typelib, however.
>
Lots of Greetings!
Volker
--
For email replies, please substitute the obvious.
To be honest, I like Ben's solution better than mine because it gets around
the registration problem. In other words, it is easier to deploy and
register an "object factory" once. Subsequent .NET objects can be simply
copied.
Brian
Ben Voigt schrieb:
"Volker Hetzer" <fi****************@ieee.orgwrote in message
news:ep**********@nntp.fujitsu-siemens.com...
>Hi! I've done my first little COM component (using the clr) and after signing, regasm and gacutil I can call it from vbscript. set X = createobject("ComComponent.Class1") msgBox X.Testfunktion(2)
But the problem we're facing is that for a real development of several components (currently existing as scripting components) we need to be able to call them by their path names. The situation is this: We want to use those components to extend a PCB CAD tool. At any time several users work with several projects, each CAD-Tool session works with one project only. We typically release our components first for one project/user combination only and after this "beta" test for all projects. So, we have the following directory structure: ...\BETA.ComponentName.PCBName.Username ...\FINAL.ComponentName.ALL.ALL Those directories sit in a shared network drive and we really can't afford to register and "install" each component on each client PC. We will release very often, on average daily.
I'm looking for a way that lets me instantiate a component in VBScript like this: Dirname = figurOutDirName(ComponentName, PCBName,Username) set X = createobject(Dirname&"\whatever.something") X.myMethod(...)
Is this possible?
No it's not, but you can get the same effect.
Create a factory class in .NET which is exposed via COM, and contains a
CreateComponent(ComponentName, PcbName, UserName) method. Then your VB will
do:
>set X = createobject(factoryClsid).CreateComponent(Compone ntName, PCBName,Username) X.myMethod(...)
Your Factory object will use Assembly.Load(fileName) and Activator class,
which does not require any additional registration. If you're using early
binding, then the COM interfaces used by the consumer will need to be in a
registered typelib, however.
Sounds perfect!
Thanks a lot!
Volker
--
For email replies, please substitute the obvious. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: kathy |
last post by:
I used the VB.NET build a COM component. My com has two
files: .dll, .tlb. If I just copy these two files to
user, how there register the com.
If I create a set up program. How I register?
...
|
by: Pieter |
last post by:
Hi,
When using clickOnce for a VB.NET 2.0 application it installs fine on every
computer, except one (a new one...). Every is isstalled, Framework, Mdac,
....
The error in the log file is:...
|
by: Pieter |
last post by:
Hi,
When using clickOnce for a VB.NET 2.0 application it installs fine on every
computer, except one (a new one...). Every is isstalled, Framework, Mdac,
....
The error in the log file is:...
|
by: bharathreddy |
last post by:
In .Net COM+ components are referred to as serviced components,
Namespace: System.EnterpriseServices;
Advantage of Serviced Components:
object pooling,
database connection pooling,
|
by: Geoff Blood |
last post by:
Using Visual Studio 2005 I have VB project that produces a program that is
to be deployed using a VS2005 deployment project. There are some legacy COM
components that need to be registered with...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |