Problem using .dll file in CE4.1-Emulator in VS2003

Y

yan.bright962

Hello!
I have a problem when I'm trying to use the Microsoft CE-Emulator in
Visual Studio2003. I get an exception, such as MissingMethodException.
It doesn't matter what method out of the dll I try to call. I checked
the typing several times and compared it to the dumpbin-output, but
without success. When I start my application in .NET FullFramework it
works just fine. I also copied the dll to the folder with the exe-file,
the windows-folder and all other folders that refered to .NET in any
way. It is simply the same exception that is thrown as when the dll
doesn't exist in any way on the emulator.

The .dll was compiled from Fortran source. And use dumpbin /headers, it
shows 14C(x86).

Thanks!
 
G

Guest

1. If this is a native DLL, then it must be compiled for the correct
processor (x86 in this case).
2. Show us the dumpbin output
3. Show us the P/Invoke declaration
4. Show us the native function declaration

-Chris
 
Y

yan.bright962

Hello <ctacke/>

thanks for your fast answer.

the dumpbin output :

Dump of file stcalc.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
14C machine (x86)
5 number of sections
43BB3B5E time date stamp Wed Jan 04 11:05:02 2006
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
210E characteristics
Executable
Line numbers stripped
Symbols stripped
32 bit word machine
DLL

OPTIONAL HEADER VALUES
10B magic # (PE32)
7.10 linker version
9000 size of code
D000 size of initialized data
0 size of uninitialized data
9154 entry point (10009154)
1000 base of code
A000 base of data
10000000 image base (10000000 to 10016FFF)
1000 section alignment
1000 file alignment
4.00 operating system version
0.00 image version
4.00 subsystem version
0 Win32 version
17000 size of image
1000 size of headers
0 checksum
2 subsystem (Windows GUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
B450 [ 44] RVA [size] of Export Directory
B1AC [ 64] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
0 [ 0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
16000 [ C58] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
0 [ 0] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
A000 [ 78] RVA [size] of Import Address Table
Directory
0 [ 0] RVA [size] of Delay Import Directory
0 [ 0] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory


SECTION HEADER #1
.text name
837C virtual size
1000 virtual address (10001000 to 1000937B)
9000 size of raw data
1000 file pointer to raw data (00001000 to 00009FFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

SECTION HEADER #2
.rdata name
1494 virtual size
A000 virtual address (1000A000 to 1000B493)
2000 size of raw data
A000 file pointer to raw data (0000A000 to 0000BFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only

SECTION HEADER #3
.data name
7970 virtual size
C000 virtual address (1000C000 to 1001396F)
1000 size of raw data
C000 file pointer to raw data (0000C000 to 0000CFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

SECTION HEADER #4
.data1 name
1C08 virtual size
14000 virtual address (10014000 to 10015C07)
2000 size of raw data
D000 file pointer to raw data (0000D000 to 0000EFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

SECTION HEADER #5
.reloc name
CD6 virtual size
16000 virtual address (10016000 to 10016CD5)
1000 size of raw data
F000 file pointer to raw data (0000F000 to 0000FFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42000040 flags
Initialized Data
Discardable
Read Only

Summary

8000 .data
2000 .data1
2000 .rdata
1000 .reloc
9000 .text
the P/Invoke declaration :
[DllImport("stcalc.dll", CallingConvention =
CallingConvention.Winapi,CharSet = CharSet.Unicode)]
public static extern void STCALC();

the native function declaration :
! stcalc.f90
!
! FUNCTIONS/SUBROUTINES exported from stcalc.dll:
! stcalc - subroutine
!
subroutine stcalc

! Expose subroutine stcalc to users of this DLL
!
!DEC$ ATTRIBUTES DLLEXPORT::stcalc

The Fortran compiler is Intel Visual Fortran 9.0.
 
G

Guest

This DLL is not build for Windows CE.

-Chris


Hello <ctacke/>

thanks for your fast answer.

the dumpbin output :

Dump of file stcalc.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
14C machine (x86)
5 number of sections
43BB3B5E time date stamp Wed Jan 04 11:05:02 2006
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
210E characteristics
Executable
Line numbers stripped
Symbols stripped
32 bit word machine
DLL

OPTIONAL HEADER VALUES
10B magic # (PE32)
7.10 linker version
9000 size of code
D000 size of initialized data
0 size of uninitialized data
9154 entry point (10009154)
1000 base of code
A000 base of data
10000000 image base (10000000 to 10016FFF)
1000 section alignment
1000 file alignment
4.00 operating system version
0.00 image version
4.00 subsystem version
0 Win32 version
17000 size of image
1000 size of headers
0 checksum
2 subsystem (Windows GUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
B450 [ 44] RVA [size] of Export Directory
B1AC [ 64] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
0 [ 0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
16000 [ C58] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
0 [ 0] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
A000 [ 78] RVA [size] of Import Address Table
Directory
0 [ 0] RVA [size] of Delay Import Directory
0 [ 0] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory


SECTION HEADER #1
.text name
837C virtual size
1000 virtual address (10001000 to 1000937B)
9000 size of raw data
1000 file pointer to raw data (00001000 to 00009FFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

SECTION HEADER #2
.rdata name
1494 virtual size
A000 virtual address (1000A000 to 1000B493)
2000 size of raw data
A000 file pointer to raw data (0000A000 to 0000BFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only

SECTION HEADER #3
.data name
7970 virtual size
C000 virtual address (1000C000 to 1001396F)
1000 size of raw data
C000 file pointer to raw data (0000C000 to 0000CFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

SECTION HEADER #4
.data1 name
1C08 virtual size
14000 virtual address (10014000 to 10015C07)
2000 size of raw data
D000 file pointer to raw data (0000D000 to 0000EFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

SECTION HEADER #5
.reloc name
CD6 virtual size
16000 virtual address (10016000 to 10016CD5)
1000 size of raw data
F000 file pointer to raw data (0000F000 to 0000FFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42000040 flags
Initialized Data
Discardable
Read Only

Summary

8000 .data
2000 .data1
2000 .rdata
1000 .reloc
9000 .text
the P/Invoke declaration :
[DllImport("stcalc.dll", CallingConvention =
CallingConvention.Winapi,CharSet = CharSet.Unicode)]
public static extern void STCALC();

the native function declaration :
! stcalc.f90
!
! FUNCTIONS/SUBROUTINES exported from stcalc.dll:
! stcalc - subroutine
!
subroutine stcalc

! Expose subroutine stcalc to users of this DLL
!
!DEC$ ATTRIBUTES DLLEXPORT::stcalc

The Fortran compiler is Intel Visual Fortran 9.0.
 
Y

yan.bright962

I kown it. I'm afraid I have to change the Fortran Source codes to C#.
Bad luck!


Thanks for your help!
Best Regards,

Yan
 

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