Interop with Emulator

B

baronics

I've been writing a Win CE 5.0 app in C# and testing in VS 2003 with the
"Windows CE .NET Emulator" as my target.
As long as I stay within .NET, I'm fine.

I just added code that calls an unmanaged function via
System.Runtime.InteropServices. Even though my unmanaged DLL is loaded along
with my exe in the Emulator's file system, I always get
"MissingMethodException" when calling any function within the DLL. I
downloaded numerous examples from the web and always get the same result.
The unmanaged DLL was built using eMbedded Visual C++ 4.0 with the emulator
target.

Now, I tried running the "STANDARDSDK_500 - SDK Emulator" version
4.1.0.(Build 14) as my target. The first time I deployed my app, it went to
load the .NET Compact framework and popped up 2 separate times a warning
that the environment I was installing on might not allow .NET to run
properly. I let it install anyway. According to cgacutil, I'm running
1.0.2268.00.
Now, all my unmanaged calls work fine.

Can someone explain this to me?
I prefer the CE .NET emulator because it looks to be more full featured with
a DOS shell and other extras that the SDK emulator doesn't have.

baronics.
 
I

Ilya Tumanov [MS]

Please verify the following:

- Native DLL is compiled for correct CPU (emulator is x86).
- Entry point is exported.
- Entry point name is not mangled.

You can use dumpbin.exe utility to do that:

Dumpbin.exe /headers /exports your.dll

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
B

baronics

Thanks.
I ran dumpbin and it all looks fine: i386, exported entry point & name not
mangled.
Like I said, it works in one emulator window but not another.
I imagine it has something to do with the emulator since the system files
inside are very different.

baronics

"Ilya Tumanov [MS]" said:
Please verify the following:

- Native DLL is compiled for correct CPU (emulator is x86).
- Entry point is exported.
- Entry point name is not mangled.

You can use dumpbin.exe utility to do that:

Dumpbin.exe /headers /exports your.dll

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "baronics" <baronics at yahoo dot com>
Subject: Interop with Emulator
Date: Fri, 28 Jan 2005 16:18:04 -0500
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework,microsoft.public.dotnet.f
ramework.interop
NNTP-Posting-Host: pc-24-151-9-024.newt1.ct.charter.com 24.151.9.24
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXS01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.interop:29003
microsoft.public.dotnet.framework.compactframework:70018
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I've been writing a Win CE 5.0 app in C# and testing in VS 2003 with the
"Windows CE .NET Emulator" as my target.
As long as I stay within .NET, I'm fine.

I just added code that calls an unmanaged function via
System.Runtime.InteropServices. Even though my unmanaged DLL is loaded along
with my exe in the Emulator's file system, I always get
"MissingMethodException" when calling any function within the DLL. I
downloaded numerous examples from the web and always get the same result.
The unmanaged DLL was built using eMbedded Visual C++ 4.0 with the emulator
target.

Now, I tried running the "STANDARDSDK_500 - SDK Emulator" version
4.1.0.(Build 14) as my target. The first time I deployed my app, it went to
load the .NET Compact framework and popped up 2 separate times a warning
that the environment I was installing on might not allow .NET to run
properly. I let it install anyway. According to cgacutil, I'm running
1.0.2268.00.
Now, all my unmanaged calls work fine.

Can someone explain this to me?
I prefer the CE .NET emulator because it looks to be more full featured with
a DOS shell and other extras that the SDK emulator doesn't have.

baronics.
 

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