473,779 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++ DLL used in C# project

Hi,

We developped many Dll in C++ to use in a project developped with VC++ 6.0.

Now we have another project for Pocket PC that I have to develop with C#,
can I use the same DLL, and what I have to do ?

Thanks
Nov 17 '05 #1
6 1577
Since PPC is based on Windows CE, a fair number of the API declarations,
const values, etc. are the same as the desktop. You may need to make some
modifications to the source depending on what you're actually doing in the
dlls, however, you'll need to recompile the dlls using either eVC++ 3.0 or
eVC++ 4.0. Which version you need to use depends on the PPC version that
you're targeting. PPC 2002 and down - eVC++ 3.0, PPC 2003 and up - eVC++
4.0.

See the link below for some more information on p/invoking through the
compact framework.
http://wiki.opennetcf.org/ow.asp?Com...ativeFunctions

--
Tim Wilson
..Net Compact Framework MVP

"Hermione" <He******@discu ssions.microsof t.com> wrote in message
news:F1******** *************** ***********@mic rosoft.com...
Hi,

We developped many Dll in C++ to use in a project developped with VC++ 6.0.
Now we have another project for Pocket PC that I have to develop with C#,
can I use the same DLL, and what I have to do ?

Thanks

Nov 17 '05 #2
Hermione,

You have two options.

The first is to take the C++ dll and expose the types in it through COM.
Once you do that, you can access it in .NET through COM interop.

The second way is to create managed wrappers for your types (which could
be much more difficult, depending on how your classes are laid out and how
they interact with each other). If you do that, then you would be able to
re-compile your DLL as a managed DLL and then add a reference to it from VS.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Hermione" <He******@discu ssions.microsof t.com> wrote in message
news:F1******** *************** ***********@mic rosoft.com...
Hi,

We developped many Dll in C++ to use in a project developped with VC++
6.0.

Now we have another project for Pocket PC that I have to develop with C#,
can I use the same DLL, and what I have to do ?

Thanks

Nov 17 '05 #3
I should have mentioned that the official compact framework newsgroup is
located here (microsoft.publ ic.dotnet.frame work.compactfra mework). So if you
run into any issues then you may want to post them over there as you'll
usually get a pretty quick and accurate response.

--
Tim Wilson
..Net Compact Framework MVP

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in message
news:ua******** ******@TK2MSFTN GP10.phx.gbl...
Since PPC is based on Windows CE, a fair number of the API declarations,
const values, etc. are the same as the desktop. You may need to make some
modifications to the source depending on what you're actually doing in the
dlls, however, you'll need to recompile the dlls using either eVC++ 3.0 or
eVC++ 4.0. Which version you need to use depends on the PPC version that
you're targeting. PPC 2002 and down - eVC++ 3.0, PPC 2003 and up - eVC++
4.0.

See the link below for some more information on p/invoking through the
compact framework.
http://wiki.opennetcf.org/ow.asp?Com...ativeFunctions
--
Tim Wilson
.Net Compact Framework MVP

"Hermione" <He******@discu ssions.microsof t.com> wrote in message
news:F1******** *************** ***********@mic rosoft.com...
Hi,

We developped many Dll in C++ to use in a project developped with VC++

6.0.

Now we have another project for Pocket PC that I have to develop with C#, can I use the same DLL, and what I have to do ?

Thanks


Nov 17 '05 #4
Thnks Tim

But can I compile the DLL with the Visual C++ which came in the package of
VisualStudio 2003

Thanks

"Tim Wilson" wrote:
Since PPC is based on Windows CE, a fair number of the API declarations,
const values, etc. are the same as the desktop. You may need to make some
modifications to the source depending on what you're actually doing in the
dlls, however, you'll need to recompile the dlls using either eVC++ 3.0 or
eVC++ 4.0. Which version you need to use depends on the PPC version that
you're targeting. PPC 2002 and down - eVC++ 3.0, PPC 2003 and up - eVC++
4.0.

See the link below for some more information on p/invoking through the
compact framework.
http://wiki.opennetcf.org/ow.asp?Com...ativeFunctions

--
Tim Wilson
..Net Compact Framework MVP

"Hermione" <He******@discu ssions.microsof t.com> wrote in message
news:F1******** *************** ***********@mic rosoft.com...
Hi,

We developped many Dll in C++ to use in a project developped with VC++

6.0.

Now we have another project for Pocket PC that I have to develop with C#,
can I use the same DLL, and what I have to do ?

Thanks


Nov 17 '05 #5
Thanks Nicolas, I'll will look at your suggestions

"Nicholas Paldino [.NET/C# MVP]" wrote:
Hermione,

You have two options.

The first is to take the C++ dll and expose the types in it through COM.
Once you do that, you can access it in .NET through COM interop.

The second way is to create managed wrappers for your types (which could
be much more difficult, depending on how your classes are laid out and how
they interact with each other). If you do that, then you would be able to
re-compile your DLL as a managed DLL and then add a reference to it from VS.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Hermione" <He******@discu ssions.microsof t.com> wrote in message
news:F1******** *************** ***********@mic rosoft.com...
Hi,

We developped many Dll in C++ to use in a project developped with VC++
6.0.

Now we have another project for Pocket PC that I have to develop with C#,
can I use the same DLL, and what I have to do ?

Thanks


Nov 17 '05 #6
You cannot compile native dlls targeting Pocket PCs through VS.Net 2003. You
will need either eVC++ 3.0 or 4.0 (they're both free downloads from
Microsoft). However, you will be able to compile native code for PPCs in
Visual Studio 2005.

--
Tim Wilson
..Net Compact Framework MVP

"Hermione" <He******@discu ssions.microsof t.com> wrote in message
news:86******** *************** ***********@mic rosoft.com...
Thnks Tim

But can I compile the DLL with the Visual C++ which came in the package of
VisualStudio 2003

Thanks

"Tim Wilson" wrote:
Since PPC is based on Windows CE, a fair number of the API declarations,
const values, etc. are the same as the desktop. You may need to make some modifications to the source depending on what you're actually doing in the dlls, however, you'll need to recompile the dlls using either eVC++ 3.0 or eVC++ 4.0. Which version you need to use depends on the PPC version that
you're targeting. PPC 2002 and down - eVC++ 3.0, PPC 2003 and up - eVC++
4.0.

See the link below for some more information on p/invoking through the
compact framework.
http://wiki.opennetcf.org/ow.asp?Com...ativeFunctions
--
Tim Wilson
..Net Compact Framework MVP

"Hermione" <He******@discu ssions.microsof t.com> wrote in message
news:F1******** *************** ***********@mic rosoft.com...
Hi,

We developped many Dll in C++ to use in a project developped with VC++

6.0.

Now we have another project for Pocket PC that I have to develop with C#, can I use the same DLL, and what I have to do ?

Thanks


Nov 17 '05 #7

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

Similar topics

3
3466
by: fabio de francesco | last post by:
Hello, I have a couple of years of experience with C++. I started studying C++ syntax, then I read the B.Stroustrup's book, and eventually I went through the N.Josuttis' book on how to program with the C++ Standard Library. I am not a professional programmer however I would like to gain more knowledge of the language to get what could be considered the skills you'd expect from a professional developer ( I also know Unix
1
1055
by: kartoffelsack | last post by:
Hi, I'm trying to hunt down an memory-leak for days now. For this I'm using operated new- /delete-ops (based on provided code in 'thinking c++'). Principally they are working fine, but when I compile my project (as in reality) as a DLL, my user-defined new/delete-ops are not used. I have a exe-Project, that uses mostly the same code as the DLL-project, where it works. In a small test-DLL it workes also. So I don't thing it's a
4
8330
by: Mountain Bikn' Guy | last post by:
I am having serious problems with the following IDE bug: Could not write to output file 'x.dll' -- 'The process cannot access the file because it is being used by another process. ' and BUG: "Could Not Copy Temporary Files to the Output Directory" Error Message When You Build a Solution That Contains Multiple Projects I have tried all the solutions in Microsoft Knowledge Base Article - 313512.
12
25300
by: Bill Moran | last post by:
Hey all. I've hit an SQL problem that I'm a bit mystified by. I have two different questions regarding this problem: why? and how do I work around it? The following query: SELECT GCP.id, GCP.Name FROM Gov_Capital_Project GCP,
6
2226
by: Joe Befumo | last post by:
I just created the default personal site project in Visual Studio 2005, and it worked perfectly -- very nice. Next, I'd like to import some stat-capture code that I have working in a Visual Studio 2003 asp,net project. The first think I noticed is that in the 2003 project, there's a global.asax and a global.asax.vb file, with the code being in the latter. Since the 2005 project had a routine directly in the global.asax file, I moved it to...
0
1755
by: tony | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. In this user control we have a class called B One project that build a class library dll. In this class library we have a class called C In the user control project I have a project reference to the class library.
30
4122
by: Pep | last post by:
Is it best to include the code "using namespace std;" in the source or should each keyword in the std namespace be qualified by the namespace tag, such as std::cout << "using std namespace" << std::endl; Myself I am not sure which I prefer, it is certainly easier to specify that the std namespace is being used instead of tagging each member of the namespace?
1
1138
by: VMI | last post by:
I inherited a project that has more classes than what the project uses (i.e. Code generator). Is there any way (or utility) that'll tell me what classes (or files) aren't used? Thanks.
5
1453
by: billsahiker | last post by:
I saw one post here that basically said no way, but not sure which vs version was being discussed. Using vs 2005 I develped a user control in a vb project and would like to use that usercontrol in a web app, also developed with vs2005. I tried using @Reference and put the dll in the bin folder, and when that failed I created a Contols folder and put it there and still no luck. Intuitively it makes sense that this does not work, since vb...
1
1550
by: redjoy | last post by:
I have a Visual Studio 2003 solution with multiple projects (3 C++, 2 C#, and 2 VB). The code has been maintained and upgraded since VC 6.0 by several developers. There are litarally several hundred files in the solution (the majority in the C++ projects.) I want to find out what files are REALLY used by the C++ projects. I know that the project file has a list of all files included in the specific project but I also know that I do not need...
0
9632
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9471
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10071
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8958
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.