Calling a .NET Dll in C++ / COM

G

Guest

Hi ,

We use a sotware development language called Dexterity, which is propritery of Great Plains, now part of Microsoft. I have a .NET Assembly, Cryption.dll, which has two functions "encrypt" and "Decrypt". This Dll encrypts and decrypts a string using TripleDESAlgorithm. I know the DLL is working okay because I created a simple .NET windows application to accept an input string and call the Encrypt and Decrypt functions of my DLL and it works fine. We want to be able to call this DLL from Dexterity and use its functions.

However recenly we came to know that Dexterity does not have the ability to call a .NET DLL. We were advised by the support team from Microsoft Business Solutions , and below is their response:

"Your best bet is to write a COM interface to your .NET dll and then access these functions via COM in dexterity. Or your other option is to write this in C/C++ as a stdcall exported dll."

I am intersted in writting a wrapper in C++ which just calls my functions in the .NET dll. I see the flow as Dexterity->calls C++ wrapper(which is itself a dll) -> calls .NET assembly.

If so, here is my question.

2. I have Visual Studio .NET with me here. In that I see that I can create a project under the category C++ projects. This category has the following types of projects( names listed below are how they appear in the IDE)
1. Class Library(.NET)
2. Win32 project (.NET)
3. Win32 Console Application.

I am confused if I can use one of these projects or do I need to use the old classic Visual Studio with C++ and create my file there which accesses the .NET dll. Please send me sample code examples if you can, so that I can get an idea where to start.

In general the question boils down to "How to call a .NET dll in C++ and thereby create a C++ DLL or COM Interface". I want to know the difference between writting a COM interface and a C++ DLL.

Thanks,

Meena
 
N

Natalie Van

Hi Meena

I develop in dexterity as well.
I am faced with the exact same task.
I have to encrypt a file from with dexterity and then decrypt it from
Visual Basic later on.

Have you found a solution for this wrapper function?
Can this .net Dll be called from VB6?
If it can be called from VB6 we could perhaps do an exchange - your
.net Dll for our Wrapper?

Regards
 
I

Ioannis Vranos

Natalie said:
Hi Meena

I develop in dexterity as well.
I am faced with the exact same task.
I have to encrypt a file from with dexterity and then decrypt it from
Visual Basic later on.

Have you found a solution for this wrapper function?
Can this .net Dll be called from VB6?
If it can be called from VB6 we could perhaps do an exchange - your
net Dll for our Wrapper?



However I think that you would probably find more help in VB newsgroups
than VC++ ones.
 

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