Hazem Elshabini

Hello,

I am creating a Class Library (dll) and i need to make it 100% pocket pc compatible, as it turns out there are alot of differences between the .net framework and the .net compact framework.

what kind of settings / customizations i can make in my library to make it work perfectly on both desktop and pocket pc

p.s: i use c#




Re: .NET Compact Framework How to make a .net class library pocket pc compatible?

Mario van Zeist

Develop your assembly on the pocket PC, you can then use that assembly also on your desktop. a.k.a. the compact framework uses a subset of the functions from the full framework. Only if you are using p/invoke's you should handle the difference because simulair functions are defined in different dll's.

a small example below;

where the IsWinCE static boolean is defined like with Environment.OSVersion.Platform == PlatformID.WinCE

[DllImport("gdi32.dll", EntryPoint = "DeleteDC")]

static extern bool DeleteDC32(IntPtr hdc);

[DllImport("coredll.dll", EntryPoint = "DeleteDC")]

static extern bool DeleteDCCE(IntPtr hdc);

public static bool DeleteDC(IntPtr hdc)

{

return IsWinCE DeleteDCCE(hdc) : DeleteDC32(hdc);

}





Re: .NET Compact Framework How to make a .net class library pocket pc compatible?

Hazem Elshabini

ahuh Smile

well that is what i have been doing untill now (creating the dll on pocket pc)

it's good to know i am going in the right direction.

i don't use p/invoke ...but if i ever did i think i will need further explanation hehehe...looks complicated.

thanks alot for your help Smile






Re: .NET Compact Framework How to make a .net class library pocket pc compatible?

Peter Nowak (Germany)

Hi,

there are a lot of more problems are going to await you. ;-)

By that most of them can be avoided by a good design and architecture.

Therefore I assume you should read this.

Cheers, Peter






Re: .NET Compact Framework How to make a .net class library pocket pc compatible?

Mario van Zeist

P/Invoke is a term used to call into native dll's (non .net dll's) it's normally used when you want to use functionality not yet supported on the .net (compact) framework.





Re: .NET Compact Framework How to make a .net class library pocket pc compatible?

Hazem Elshabini

Peter Nowak (Germany) wrote:

Hi,

there are a lot of more problems are going to await you. ;-)

By that most of them can be avoided by a good design and architecture.

Therefore I assume you should read this.

Cheers, Peter

woot, well that is what i have been looking for.

thank you so much Smile






Re: .NET Compact Framework How to make a .net class library pocket pc compatible?

Peter Nowak (Germany)

NP

If you have any further questions on this just ask. have already build some real world applications for a customer on this technology, so I think I can help out a bit. ;-)

Cheers, Peter