473,396 Members | 1,894 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.

using c++ developed dll in .net

Hi All,

i wanted to know how can i use c++ developed in my c# code.

I want to use crypto++ library in my c# code. Any pointer would be helpful.

Regards,
Y Iguchi
Jun 12 '07 #1
7 4056
YIguchi wrote:
i wanted to know how can i use c++ developed in my c# code.

I want to use crypto++ library in my c# code. Any pointer would be helpful.
DllImport exist to use Win32 DLL's in .NET programs.

Arne
Jun 12 '07 #2

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
YIguchi wrote:
>i wanted to know how can i use c++ developed in my c# code.

I want to use crypto++ library in my c# code. Any pointer would be
helpful.
Use C++/CLI to call crypto++. Make a library wrapping just the crypto
functionality you need, make it into a "ref class", and add it as a project
reference from your C# project, and you'll be able to use it just like the
Microsoft classes.
>
DllImport exist to use Win32 DLL's in .NET programs.
And you need a C API to do so, not C++. When C++ is exposed as COM/ActiveX,
then .NET supports the API that way. But I don't think crypto++ is.
>
Arne
Jun 12 '07 #3
Ben Voigt [C++ MVP] wrote:
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
>YIguchi wrote:
>>i wanted to know how can i use c++ developed in my c# code.

I want to use crypto++ library in my c# code. Any pointer would be
helpful.

Use C++/CLI to call crypto++. Make a library wrapping just the crypto
functionality you need, make it into a "ref class", and add it as a
project reference from your C# project, and you'll be able to use it
just like the Microsoft classes.
>DllImport exist to use Win32 DLL's in .NET programs.

And you need a C API to do so, not C++. When C++ is exposed as
COM/ActiveX, then .NET supports the API that way. But I don't think
crypto++ is.
Why write a C++ wrapper instead of simply calling the code
you want to call ?

Arne
Jun 13 '07 #4

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
Ben Voigt [C++ MVP] wrote:
>"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk. ..
>>YIguchi wrote:
i wanted to know how can i use c++ developed in my c# code.

I want to use crypto++ library in my c# code. Any pointer would be
helpful.

Use C++/CLI to call crypto++. Make a library wrapping just the crypto
functionality you need, make it into a "ref class", and add it as a
project reference from your C# project, and you'll be able to use it just
like the Microsoft classes.
>>DllImport exist to use Win32 DLL's in .NET programs.

And you need a C API to do so, not C++. When C++ is exposed as
COM/ActiveX, then .NET supports the API that way. But I don't think
crypto++ is.

Why write a C++ wrapper instead of simply calling the code
you want to call ?
I meant to suggest that the wrapper should be at a higher level of
abstraction, providing application-relevant functions. But I can definitely
see why you interpreted my suggestion as a thin one-to-one forwarder.
>
Arne
Jun 14 '07 #5
Hi,

That is great .
I will be using crypto++ with that. I hope i will be use the same with c#.

Crypto++ compiles with /Mtd . I hope it will not cause any problem.

Are there any limitation in using the existing c++ Code with C# .net

Regards,
Y Iguchi

"Ben Voigt [C++ MVP]" wrote:
>
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
Ben Voigt [C++ MVP] wrote:
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
YIguchi wrote:
i wanted to know how can i use c++ developed in my c# code.

I want to use crypto++ library in my c# code. Any pointer would be
helpful.

Use C++/CLI to call crypto++. Make a library wrapping just the crypto
functionality you need, make it into a "ref class", and add it as a
project reference from your C# project, and you'll be able to use it just
like the Microsoft classes.

DllImport exist to use Win32 DLL's in .NET programs.

And you need a C API to do so, not C++. When C++ is exposed as
COM/ActiveX, then .NET supports the API that way. But I don't think
crypto++ is.
Why write a C++ wrapper instead of simply calling the code
you want to call ?

I meant to suggest that the wrapper should be at a higher level of
abstraction, providing application-relevant functions. But I can definitely
see why you interpreted my suggestion as a thin one-to-one forwarder.

Arne
Jun 17 '07 #6
Hi Ben,

I will be using crypto++ with the c#. I just wanted to confirm one thing
1. Does this method works with /Mtd too.
2. Is this approach has some limitations too. i just wanted to ensure before
using this approach.

Regards.
Y Iguchi

"Ben Voigt [C++ MVP]" wrote:
>
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
Ben Voigt [C++ MVP] wrote:
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
YIguchi wrote:
i wanted to know how can i use c++ developed in my c# code.

I want to use crypto++ library in my c# code. Any pointer would be
helpful.

Use C++/CLI to call crypto++. Make a library wrapping just the crypto
functionality you need, make it into a "ref class", and add it as a
project reference from your C# project, and you'll be able to use it just
like the Microsoft classes.

DllImport exist to use Win32 DLL's in .NET programs.

And you need a C API to do so, not C++. When C++ is exposed as
COM/ActiveX, then .NET supports the API that way. But I don't think
crypto++ is.
Why write a C++ wrapper instead of simply calling the code
you want to call ?

I meant to suggest that the wrapper should be at a higher level of
abstraction, providing application-relevant functions. But I can definitely
see why you interpreted my suggestion as a thin one-to-one forwarder.

Arne
Jun 17 '07 #7

"YIguchi" <YI*****@discussions.microsoft.comwrote in message
news:26**********************************@microsof t.com...
Hi Ben,

I will be using crypto++ with the c#. I just wanted to confirm one thing
1. Does this method works with /Mtd too.
No, I think /MD or /MDd is required for C++/CLI to create a .NET assembly.
I doubt that will break crypto++.
2. Is this approach has some limitations too. i just wanted to ensure
before
using this approach.
The only limitation is that the code you write using the C++/CLI syntax is
only usable in a .NET program, so your customers need .NET installed. And
of course not just .NET Framework, but also the updated VC++ runtime
(vcredist_x86).

Native C++ classes can be used in a .NET program via C++/CLI (not directly
from C# or VB) or from native code. This feature is called "C++ interop" or
"It Just Works" and is much better than p/invoke for working with native C++
code or any library with C headers.
>
Regards.
Y Iguchi

"Ben Voigt [C++ MVP]" wrote:
>>
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk. ..
Ben Voigt [C++ MVP] wrote:
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk. ..
YIguchi wrote:
i wanted to know how can i use c++ developed in my c# code.

I want to use crypto++ library in my c# code. Any pointer would be
helpful.

Use C++/CLI to call crypto++. Make a library wrapping just the crypto
functionality you need, make it into a "ref class", and add it as a
project reference from your C# project, and you'll be able to use it
just
like the Microsoft classes.

DllImport exist to use Win32 DLL's in .NET programs.

And you need a C API to do so, not C++. When C++ is exposed as
COM/ActiveX, then .NET supports the API that way. But I don't think
crypto++ is.

Why write a C++ wrapper instead of simply calling the code
you want to call ?

I meant to suggest that the wrapper should be at a higher level of
abstraction, providing application-relevant functions. But I can
definitely
see why you interpreted my suggestion as a thin one-to-one forwarder.
>
Arne
Jun 17 '07 #8

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

Similar topics

0
by: MooMaster | last post by:
This is more of a wxPython centric question, but not seeing reference to this on the wx group I thought I'd try here since many here also use wxPython toolkit. I started learning GUI development...
1
by: Srihari | last post by:
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels. I developed...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
0
by: Neil Sargent | last post by:
I have a generic code library, developed as an MDA and distributed as an MDE. It is developed using my system workgroup file. I have a number of applications which use the code library. One of...
47
by: Bonj | last post by:
I downloaded the gzlib library from zlib in order to do compression. (http://www.gzip.org/zlib) The prototype of the compression function seems to be int compress (Bytef *dest, uLongf *destLen,...
6
by: Guest | last post by:
Hi, I unerstand that if you choose IIS to host your .Net Remotingcomponents with HTTP channel and SOAP formatter, you get thebuilt-in security and configuraion features of IIS. Also we canexpose it...
4
by: Praveen Chandra | last post by:
Hi, I just wanted to put down the issue with more detailed information so that you can help us get to the right Microsoft resource for a solution! Here is the problem description... Our...
0
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi All, Problem in deploying my WebService developed using Asp.net WebServices 2005. I have designed simple WebService using Asp.net Webservices 2.0 , The webservice look this , using System;...
1
by: mark4asp | last post by:
How do I connect to my application via http://localhost/..., using IIS. I've developed an application via the File System (using the VS Web server). When I deploy it I change the...
10
by: teddysnips | last post by:
My clients have asked me to maintain a database that was developed in- house. It's pretty good, considering the developer isn't a "programmer". The first thing they want me to do is to split it...
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: 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
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
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.