473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C++/CLI COM component deployment

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.
Jan 25 '07 #1
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)


Jan 26 '07 #2
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.
Jan 26 '07 #3

"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.

Jan 26 '07 #4
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

Jan 26 '07 #5
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.
Jan 29 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
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? ...
0
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:...
0
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:...
0
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,
5
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
marktang
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,...
0
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...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.