How to create a new DLL for Window CE using MS Visual Studio.NET 2

G

Guest

Hi,

I would like to create a "dll" using 'C' language and
MS Visual Studio.NET 2003( .NET Compact Framework ).
I want to use this dll in my C# apllication.

As a novice in using MS Visual Studio.NET 2003 and
.NET Compact Framework, I have no clue how this can be done.

Could you please suggest me a good starting point for my task.

What is the procedure I need to follow.

Kindly let me know.

Cheers,

Naveen.
 
P

Peter Foot [MVP]

If you want a native code device dll you should use eMbedded Visual C++.
Either Version 3.0 for Pocket PC 2000/2002 devices or Version 4.0 for Pocket
PC 2003 and all other CE 4.x based devices.

Visual Studio doesn't current support writing native code for devices,
although this will be available in the next version (Visual Studio 2005 -
http://lab.msdn.microsoft.com/vs2005)

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 
C

Christian Bruccoleri

I am using indeed eVC4.0, I know that Visual Studio can not generate code
for the Pocket PC.

Thanks anyway,
Christian
 
C

Christian Bruccoleri

I was just doing the same thing and succeded after some help by people in
this newsgroup, so I hope I can help you as well.

First of all the bad you can not write the C dll using V.S. .NET 2003.
The good news are that you can download Embedded VC4.0 (or 3.0) from
Microsoft, and use it for free.

Download the various Pocket PC 2003 sdk and emulator, and install it
(following the instruction carefully). Try to write an elementary
application with C# and deploy it on the emulator just to test if everything
works.

Write the DLL in C, pretty much as you would do for the Win32 platform (you
can find topics on it in MSDN). Compile the DLL using eVC and then add it to
your C# project (the compiled dll, not the source).
Then when you build (and deploy) your application the dll will be copied in
the same folder as your managed application.

If you need more detailed information let me know.
Christian
 
G

Guest

Hi Christian,

Thank you for your response.
I have downloaded eC++4. I already have Pocket PC 2003 emulator.

But I neither used eVC before nor have experience in writing dlls in Win32
plotform.

Could you suggest me where I can get good tutorials for writing
Dlls using eVC and C language.

I have little experience in using Dlls in C#. But, if I have any problems
I will let you know.
 
C

Christian Bruccoleri

Writing a DLL is not different from writing a normal program except that you
don't have a main (but an optional dllmain for startup code). It is, in its
simplest and most popular form, just a collection of functions.
The only thing that you must be worried about is what functions you want to
make visible to the calling application. You take care of this prefixing the
declaration of your functions with a statement that tells to the compiler
that you want to export that function (symbol, in dll-ish). Of course, you
can do a lot more than this, but that's an advanced topic and I won't
venture that far, since my experience in this field is limited.

I've found a number of links that were useful to me (in order of
usefulness):
http://msdn.microsoft.com/library/d...n-us/dnnetcomp/html/netcfmarshallingtypes.asp

http://msdn.microsoft.com/library/d.../en-us/dnnetcomp/html/netcfdumpbinpinvoke.asp

http://support.microsoft.com/default.aspx?scid=kb;en-us;241531

Have fun,
Christian
 

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