473,396 Members | 2,140 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,396 software developers and data experts.

about com and interopability

i first want to apologize for some silly things i might write, cause
all this c++, com and c# is new to me.
i'm currently writing a project that his aim is to load some general
com object in runtime, when this com object is not in registry(don't
ask why...), and his name and path is unknown till runtime. i want to
be able to invoke his methods and to advise to it's events, and to do
it in an easy elgant dot net style way. so what i did so far was to
write a com object (in c++)which loads an other com object in runtime
using Loadlibrary, and i simulate invoke calling.
this com object aim is to get rid of all the dirty uneasy to be done in
c# job. using tlbimport i'm going to warp me com object with c# class.
now comes my questions:
a. reason why i didn't write directly a c# class is that i found that
in this dynamic load of completely mysterious com object i have to use
meny c++ macros, structures, interfaces etc and it was very
inconvenient. was i wrong? is there an easyer way?
b. i want my c# class to pass an object[] to my com so that it could
use them as DISPARAMS, also meaning that some of this objects should
return values to my c# class.
what type should my com class recive and what type should my c# class
pass to do that?
c. i want my c# class to catch the mysterious com object events using
delegates. how can i implement thet feature?
d. and a general one: is it true that there is a diffrence between com
object that was built under vs6 or one that was built under .Net?
something to do with lake of manifast? could it be that some .net
classes don't support the first type?

thanks a lot!
henit

Dec 19 '05 #1
1 1408
Henit,

I think you are going about this the wrong way. Windows XP supports
registration-free COM, meaning that you can place the DLL in the same
directory as your application and it will work just fine.

What you are doing with LoadLibrary is downright wrong. You should
always register a COM object on the system. If you don't, then you are
simply asking for trouble, and going down a path which is not recommended or
supported.

Check out this article in MSDN magazine for more information about
reg-free COM and how to use it with .NET. You can use it with your C++ COM
dll, as it is a matter of creating a manifest file:

http://msdn.microsoft.com/msdnmag/is...04/RegFreeCOM/

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
<he***@gteko.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
i first want to apologize for some silly things i might write, cause
all this c++, com and c# is new to me.
i'm currently writing a project that his aim is to load some general
com object in runtime, when this com object is not in registry(don't
ask why...), and his name and path is unknown till runtime. i want to
be able to invoke his methods and to advise to it's events, and to do
it in an easy elgant dot net style way. so what i did so far was to
write a com object (in c++)which loads an other com object in runtime
using Loadlibrary, and i simulate invoke calling.
this com object aim is to get rid of all the dirty uneasy to be done in
c# job. using tlbimport i'm going to warp me com object with c# class.
now comes my questions:
a. reason why i didn't write directly a c# class is that i found that
in this dynamic load of completely mysterious com object i have to use
meny c++ macros, structures, interfaces etc and it was very
inconvenient. was i wrong? is there an easyer way?
b. i want my c# class to pass an object[] to my com so that it could
use them as DISPARAMS, also meaning that some of this objects should
return values to my c# class.
what type should my com class recive and what type should my c# class
pass to do that?
c. i want my c# class to catch the mysterious com object events using
delegates. how can i implement thet feature?
d. and a general one: is it true that there is a diffrence between com
object that was built under vs6 or one that was built under .Net?
something to do with lake of manifast? could it be that some .net
classes don't support the first type?

thanks a lot!
henit

Dec 19 '05 #2

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

Similar topics

1
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
8
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
77
by: nospam | last post by:
Reasons for a 3-tier achitecture for the WEB? (NOTE: I said, WEB, NOT WINDOWS. DON'T shoot your mouth off if you don't understand the difference.) I hear only one reason and that's to switch a...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
5
by: eScrewDotCom | last post by:
www.eScrew.com eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is...
0
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
1
by: Max2006 | last post by:
Hi, Do I need to be worry about WS-Profiling or it already had been taken care in ASP.NET asmx web services platform? Thank you, Max
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.