Integrating VB 2005 module.

R

RP

I have a module written using VB 2005 which contains many ready to use
functions. For some specific reasons, I cannot make it a DLL. Can I
integrate this module in my C# project? If yes, how.
 
N

Nicholas Paldino [.NET/C# MVP]

Assuming you know where the netmodule is at compile time, you should be
able to tweak the csc task to add the /addmodule command line switch and
then point to your VB module.

This is assuming you are talking about a netmodule, not a VB module
file. If you are talking about a module file, then you will have to compile
it to a netmodule (you can use the command line VB compiler to do this) and
then proceed with the instructions above to integrate it into your C#
project.

However, you will not be able to reference the functions while you code
your project, which I am pretty sure is what you don't want.

If you want to integrate those functions into your C# project, then you
either have to compile it into an assembly (which I am curious why you can't
do that) or convert the code to C# and include that in your project.
 
R

RP

I have some Database Connection objects in that module. So if I make
it a DLL, how the Database Objects will work?
 
N

Nicholas Paldino [.NET/C# MVP]

RP,

How are they set in the first place? Are they set explicitly in the
module? A module in VB is nothing more than a static class in C#. You have
to set the database connection and whatnot the same way you would any other
class.

Basically, in whatever code calls your module, you would have to
initialize the database connections in the same manner you would do it from
VB code.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

RP said:
I have some Database Connection objects in that module. So if I make
it a DLL, how the Database Objects will work?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top