HP Mobile printing : System.MissingMethodException' exception

  • Thread starter Venkateswara Rao
  • Start date
V

Venkateswara Rao

I am trying to provide printing capability using HP Mobile Printing SDK from
VS.net 2003. This SDK available to people who submit a business case
proposal. Let me explain what is happening. It comes with a dll into which
the code makes P/Invoke calls for providing printing facilities. The dll is
made part of the project and set to content so that it is moved to the PDA
when it is diployed.

When I run the application on the PDA it is raising this
'System.MissingMethodException' exception' when we try to call one of the
methods that they say exists in the dll. In a FAQ on HP's web site, they say
the following:

**********
Q: I've added 'mobile printing' to my application. Now, when I click the
'Print' button, I get a 'Missing Method' exception. How do I fix this?

A: If you have followed the procedure correctly then the way you are
launching the application may be causing the problem. The print application
needs mPrintWrapper.dll in its path. If you are using a shortcut or a
program menu to launch the application then make sure that the path is
correctly set so that mPrintWrapper.dll (and CSMobilePrintClassLibrary.dll
or equivalent library if you are developing VB print solution) is in
application's path.
***********

I am not using a short cut and the dll is copied into the directory where
the exe is installed.

My question is, how and where you set the path so that it can find the dll.
Does any body have any idea about this. Your comments are appreciated.

Regards,
Venkat Polisetti
 
P

Paul G. Tobey [eMVP]

The DLL may not be found in the directory where the application is
installed. Try copying it to the \Windows directory and see if that fixes
the problem.

The 'Path' is set via the registry's [HKEY_LOCAL_MACHINE\Loader] key, which
has a multi-string value, SystemPath, under it.

Paul T.
 
R

Ryan Chapman [MSFT]

Hi Venkat,

One thing to try as a sanity check is to verify that the method you're
trying to call is actually there. Copy the dll onto a PC and run "dumpbin
/exports" to make sure it is actually exported and that spelling, etc., are
correct.

Let me know how this goes...

Thanks,

Ryan Chapman
Software Development Engineer, .NET Compact Framework

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

Venkateswara Rao

Ryan,

I have done several things that did not help me. They are as follows:

1. I have modified the [HKEY_LOCAL_MACHINE\Loader] key and added the
installed directory over there.
2. Copied the dlls to \Windows
3. After that did a soft reset.

Nothing worked so far.

I have also used dumpbin to check for the method call. The method causing
the exception is "CreateJob". It is in the dll. The output of the dumpbin is
included here.
***************
G:\>dumpbin /EXPORTS "H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following exports for mPrintWrapper.dll

00000000 characteristics
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
0.00 version
1 ordinal base
21 number of functions
21 number of names

ordinal hint RVA name

1 0 000010EC AddContent4
2 1 0000111C AddContent6
3 2 00001150 AddContent8
4 3 00001194 CloseJob
5 4 000010B0 CreateJob
6 5 00001078 CreatePrinterContext
7 6 00001094 DeletePrinterContext
8 7 00001040 GetLastError
9 8 0000105C GetVersion
10 9 00001258 NativeCreateFont
11 A 00001220 NativeCreatePen
12 B 0000121C NativeEndDoc
13 C 00001218 NativeEndPage
14 D 0000132C NativeExtTextOut
15 E 000012DC NativeGetTextExtentPoint
16 F 000012C4 NativeSetTextColor
17 10 000011CC NativeStartDoc
18 11 00001214 NativeStartPage
19 12 00001008 PrintJob1
20 13 00001024 PrintJob3
21 14 000011B0 ShowPrintManager

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

G:\>dumpbin /IMPORTS "H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following imports:

COREDLL.dll
103000 Import Address Table
10203C Import Name Table
0 time date stamp
0 Index of first forwarder reference

Ordinal 963
Ordinal 63
Ordinal 964
Ordinal 960
Ordinal 959
Ordinal 930
Ordinal 895
Ordinal 61
Ordinal 924
Ordinal 897
Ordinal 896
Ordinal 36

mPrint.dll
103034 Import Address Table
102070 Import Name Table
0 time date stamp
0 Index of first forwarder reference

25
?CreateJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PAGH_N1PBG22@Z
31 ?GetLastError@mPrint@@SA?AW4MPRINT_RESULT@@XZ
39 ?GetVersion@mPrint@@SAIPAGI@Z
26 ?CreatePrinterContext@mPrintRender@@SAPAUHDC__@@XZ
2A ?DeletePrinterContext@mPrintRender@@SAXPAUHDC__@@@Z
3D ?PrintJob@mPrint@@SA_NPBDIPBG@Z
1D
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGH000@Z
1E
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGHPBDI000@Z
23 ?CloseJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PBG_N@Z
4C
?ShowPrintManager@mPrintControl@@SA?AW4MPRINT_RESULT@@W4MPRINT_PMSHOW@@_N@Z
3E ?PrintJob@mPrint@@SA_NPBG@Z

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text
***************************

Thanks for the quick reply.
Venkat Polisetti
 
A

Alex Feinman [MVP]

Is there any chance you are using a DLL compiled for a wrong platform? An
x86 one?
What does dumpbin /HEADERS <yourdll> say?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Venkateswara Rao said:
Ryan,

I have done several things that did not help me. They are as follows:

1. I have modified the [HKEY_LOCAL_MACHINE\Loader] key and added the
installed directory over there.
2. Copied the dlls to \Windows
3. After that did a soft reset.

Nothing worked so far.

I have also used dumpbin to check for the method call. The method causing
the exception is "CreateJob". It is in the dll. The output of the dumpbin
is included here.
***************
G:\>dumpbin /EXPORTS "H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following exports for mPrintWrapper.dll

00000000 characteristics
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
0.00 version
1 ordinal base
21 number of functions
21 number of names

ordinal hint RVA name

1 0 000010EC AddContent4
2 1 0000111C AddContent6
3 2 00001150 AddContent8
4 3 00001194 CloseJob
5 4 000010B0 CreateJob
6 5 00001078 CreatePrinterContext
7 6 00001094 DeletePrinterContext
8 7 00001040 GetLastError
9 8 0000105C GetVersion
10 9 00001258 NativeCreateFont
11 A 00001220 NativeCreatePen
12 B 0000121C NativeEndDoc
13 C 00001218 NativeEndPage
14 D 0000132C NativeExtTextOut
15 E 000012DC NativeGetTextExtentPoint
16 F 000012C4 NativeSetTextColor
17 10 000011CC NativeStartDoc
18 11 00001214 NativeStartPage
19 12 00001008 PrintJob1
20 13 00001024 PrintJob3
21 14 000011B0 ShowPrintManager

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

G:\>dumpbin /IMPORTS "H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following imports:

COREDLL.dll
103000 Import Address Table
10203C Import Name Table
0 time date stamp
0 Index of first forwarder reference

Ordinal 963
Ordinal 63
Ordinal 964
Ordinal 960
Ordinal 959
Ordinal 930
Ordinal 895
Ordinal 61
Ordinal 924
Ordinal 897
Ordinal 896
Ordinal 36

mPrint.dll
103034 Import Address Table
102070 Import Name Table
0 time date stamp
0 Index of first forwarder reference

25
?CreateJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PAGH_N1PBG22@Z
31 ?GetLastError@mPrint@@SA?AW4MPRINT_RESULT@@XZ
39 ?GetVersion@mPrint@@SAIPAGI@Z
26 ?CreatePrinterContext@mPrintRender@@SAPAUHDC__@@XZ
2A ?DeletePrinterContext@mPrintRender@@SAXPAUHDC__@@@Z
3D ?PrintJob@mPrint@@SA_NPBDIPBG@Z
1D
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGH000@Z
1E
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGHPBDI000@Z
23 ?CloseJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PBG_N@Z
4C
?ShowPrintManager@mPrintControl@@SA?AW4MPRINT_RESULT@@W4MPRINT_PMSHOW@@_N@Z
3E ?PrintJob@mPrint@@SA_NPBG@Z

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text
***************************

Thanks for the quick reply.
Venkat Polisetti

Ryan Chapman said:
Hi Venkat,

One thing to try as a sanity check is to verify that the method you're
trying to call is actually there. Copy the dll onto a PC and run
"dumpbin
/exports" to make sure it is actually exported and that spelling, etc.,
are
correct.

Let me know how this goes...

Thanks,

Ryan Chapman
Software Development Engineer, .NET Compact Framework

This posting is provided "AS IS" with no warranties, and confers no
rights.
Venkateswara Rao said:
I am trying to provide printing capability using HP Mobile Printing SDK
from VS.net 2003. This SDK available to people who submit a business case
proposal. Let me explain what is happening. It comes with a dll into which
the code makes P/Invoke calls for providing printing facilities. The dll
is
made part of the project and set to content so that it is moved to the PDA
when it is diployed.

When I run the application on the PDA it is raising this
'System.MissingMethodException' exception' when we try to call one of the
methods that they say exists in the dll. In a FAQ on HP's web site, they
say the following:

**********
Q: I've added 'mobile printing' to my application. Now, when I click the
'Print' button, I get a 'Missing Method' exception. How do I fix this?

A: If you have followed the procedure correctly then the way you are
launching the application may be causing the problem. The print
application needs mPrintWrapper.dll in its path. If you are using a
shortcut or a program menu to launch the application then make sure that
the path is correctly set so that mPrintWrapper.dll (and
CSMobilePrintClassLibrary.dll or equivalent library if you are developing
VB print solution) is in application's path.
***********

I am not using a short cut and the dll is copied into the directory where
the exe is installed.

My question is, how and where you set the path so that it can find the
dll. Does any body have any idea about this. Your comments are
appreciated.

Regards,
Venkat Polisetti
 
V

Venkateswara Rao

Here is Headers dump.

G:\>dumpbin /HEADERS "H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
1C0 machine (ARM)
6 number of sections
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
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)
6.20 linker version
600 size of code
E00 size of initialized data
0 size of uninitialized data
1400 entry point (00101400)
1000 base of code
2000 base of data
100000 image base (00100000 to 00106FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
3.00 subsystem version
0 Win32 version
7000 size of image
400 size of headers
0 checksum
9 subsystem (Windows CE GUI)
0 DLL characteristics
10000 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
5000 [ 242] RVA [size] of Export Directory
2000 [ 3C] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
4000 [ D8] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
6000 [ 94] 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
3000 [ 64] 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
5F0 virtual size
1000 virtual address (00101000 to 001015EF)
600 size of raw data
400 file pointer to raw data (00000400 to 000009FF)
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
2FE virtual size
2000 virtual address (00102000 to 001022FD)
400 size of raw data
A00 file pointer to raw data (00000A00 to 00000DFF)
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
98 virtual size
3000 virtual address (00103000 to 00103097)
200 size of raw data
E00 file pointer to raw data (00000E00 to 00000FFF)
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
.pdata name
D8 virtual size
4000 virtual address (00104000 to 001040D7)
200 size of raw data
1000 file pointer to raw data (00001000 to 000011FF)
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 #5
.edata name
242 virtual size
5000 virtual address (00105000 to 00105241)
400 size of raw data
1200 file pointer to raw data (00001200 to 000015FF)
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 #6
.reloc name
CE virtual size
6000 virtual address (00106000 to 001060CD)
200 size of raw data
1600 file pointer to raw data (00001600 to 000017FF)
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

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

Venkat Polisetti

Alex Feinman said:
Is there any chance you are using a DLL compiled for a wrong platform? An
x86 one?
What does dumpbin /HEADERS <yourdll> say?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Venkateswara Rao said:
Ryan,

I have done several things that did not help me. They are as follows:

1. I have modified the [HKEY_LOCAL_MACHINE\Loader] key and added the
installed directory over there.
2. Copied the dlls to \Windows
3. After that did a soft reset.

Nothing worked so far.

I have also used dumpbin to check for the method call. The method
causing the exception is "CreateJob". It is in the dll. The output of the
dumpbin is included here.
***************
G:\>dumpbin /EXPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following exports for mPrintWrapper.dll

00000000 characteristics
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
0.00 version
1 ordinal base
21 number of functions
21 number of names

ordinal hint RVA name

1 0 000010EC AddContent4
2 1 0000111C AddContent6
3 2 00001150 AddContent8
4 3 00001194 CloseJob
5 4 000010B0 CreateJob
6 5 00001078 CreatePrinterContext
7 6 00001094 DeletePrinterContext
8 7 00001040 GetLastError
9 8 0000105C GetVersion
10 9 00001258 NativeCreateFont
11 A 00001220 NativeCreatePen
12 B 0000121C NativeEndDoc
13 C 00001218 NativeEndPage
14 D 0000132C NativeExtTextOut
15 E 000012DC NativeGetTextExtentPoint
16 F 000012C4 NativeSetTextColor
17 10 000011CC NativeStartDoc
18 11 00001214 NativeStartPage
19 12 00001008 PrintJob1
20 13 00001024 PrintJob3
21 14 000011B0 ShowPrintManager

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

G:\>dumpbin /IMPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following imports:

COREDLL.dll
103000 Import Address Table
10203C Import Name Table
0 time date stamp
0 Index of first forwarder reference

Ordinal 963
Ordinal 63
Ordinal 964
Ordinal 960
Ordinal 959
Ordinal 930
Ordinal 895
Ordinal 61
Ordinal 924
Ordinal 897
Ordinal 896
Ordinal 36

mPrint.dll
103034 Import Address Table
102070 Import Name Table
0 time date stamp
0 Index of first forwarder reference

25
?CreateJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PAGH_N1PBG22@Z
31 ?GetLastError@mPrint@@SA?AW4MPRINT_RESULT@@XZ
39 ?GetVersion@mPrint@@SAIPAGI@Z
26 ?CreatePrinterContext@mPrintRender@@SAPAUHDC__@@XZ
2A ?DeletePrinterContext@mPrintRender@@SAXPAUHDC__@@@Z
3D ?PrintJob@mPrint@@SA_NPBDIPBG@Z
1D
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGH000@Z
1E
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGHPBDI000@Z
23
?CloseJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PBG_N@Z
4C
?ShowPrintManager@mPrintControl@@SA?AW4MPRINT_RESULT@@W4MPRINT_PMSHOW@@_N@Z
3E ?PrintJob@mPrint@@SA_NPBG@Z

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text
***************************

Thanks for the quick reply.
Venkat Polisetti

Ryan Chapman said:
Hi Venkat,

One thing to try as a sanity check is to verify that the method you're
trying to call is actually there. Copy the dll onto a PC and run
"dumpbin
/exports" to make sure it is actually exported and that spelling, etc.,
are
correct.

Let me know how this goes...

Thanks,

Ryan Chapman
Software Development Engineer, .NET Compact Framework

This posting is provided "AS IS" with no warranties, and confers no
rights.
Venkateswara Rao said:
I am trying to provide printing capability using HP Mobile Printing SDK
from VS.net 2003. This SDK available to people who submit a business case
proposal. Let me explain what is happening. It comes with a dll into
which
the code makes P/Invoke calls for providing printing facilities. The dll
is
made part of the project and set to content so that it is moved to the
PDA
when it is diployed.

When I run the application on the PDA it is raising this
'System.MissingMethodException' exception' when we try to call one of
the
methods that they say exists in the dll. In a FAQ on HP's web site, they
say the following:

**********
Q: I've added 'mobile printing' to my application. Now, when I click the
'Print' button, I get a 'Missing Method' exception. How do I fix this?

A: If you have followed the procedure correctly then the way you are
launching the application may be causing the problem. The print
application needs mPrintWrapper.dll in its path. If you are using a
shortcut or a program menu to launch the application then make sure that
the path is correctly set so that mPrintWrapper.dll (and
CSMobilePrintClassLibrary.dll or equivalent library if you are
developing
VB print solution) is in application's path.
***********

I am not using a short cut and the dll is copied into the directory
where
the exe is installed.

My question is, how and where you set the path so that it can find the
dll. Does any body have any idea about this. Your comments are
appreciated.

Regards,
Venkat Polisetti
 
A

Alex Feinman [MVP]

Since everything seems to be in order, can you provide the signature of a
function that causes the exception - I'd like to see its PInvoke definition

By the way, are you calling functions directly from mPrintWrapper.dll or are
you using CSMobilePrintClassLibrary.dll (which if I understand correctly is
an HP-provided set of PInvokes into mPrintWrapper.dll)?


--
Alex Feinman
---
Visit http://www.opennetcf.org
Venkateswara Rao said:
Here is Headers dump.

G:\>dumpbin /HEADERS "H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
1C0 machine (ARM)
6 number of sections
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
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)
6.20 linker version
600 size of code
E00 size of initialized data
0 size of uninitialized data
1400 entry point (00101400)
1000 base of code
2000 base of data
100000 image base (00100000 to 00106FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
3.00 subsystem version
0 Win32 version
7000 size of image
400 size of headers
0 checksum
9 subsystem (Windows CE GUI)
0 DLL characteristics
10000 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
5000 [ 242] RVA [size] of Export Directory
2000 [ 3C] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
4000 [ D8] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
6000 [ 94] 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
3000 [ 64] 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
5F0 virtual size
1000 virtual address (00101000 to 001015EF)
600 size of raw data
400 file pointer to raw data (00000400 to 000009FF)
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
2FE virtual size
2000 virtual address (00102000 to 001022FD)
400 size of raw data
A00 file pointer to raw data (00000A00 to 00000DFF)
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
98 virtual size
3000 virtual address (00103000 to 00103097)
200 size of raw data
E00 file pointer to raw data (00000E00 to 00000FFF)
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
.pdata name
D8 virtual size
4000 virtual address (00104000 to 001040D7)
200 size of raw data
1000 file pointer to raw data (00001000 to 000011FF)
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 #5
.edata name
242 virtual size
5000 virtual address (00105000 to 00105241)
400 size of raw data
1200 file pointer to raw data (00001200 to 000015FF)
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 #6
.reloc name
CE virtual size
6000 virtual address (00106000 to 001060CD)
200 size of raw data
1600 file pointer to raw data (00001600 to 000017FF)
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

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

Venkat Polisetti

Alex Feinman said:
Is there any chance you are using a DLL compiled for a wrong platform? An
x86 one?
What does dumpbin /HEADERS <yourdll> say?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Venkateswara Rao said:
Ryan,

I have done several things that did not help me. They are as follows:

1. I have modified the [HKEY_LOCAL_MACHINE\Loader] key and added the
installed directory over there.
2. Copied the dlls to \Windows
3. After that did a soft reset.

Nothing worked so far.

I have also used dumpbin to check for the method call. The method
causing the exception is "CreateJob". It is in the dll. The output of
the dumpbin is included here.
***************
G:\>dumpbin /EXPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following exports for mPrintWrapper.dll

00000000 characteristics
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
0.00 version
1 ordinal base
21 number of functions
21 number of names

ordinal hint RVA name

1 0 000010EC AddContent4
2 1 0000111C AddContent6
3 2 00001150 AddContent8
4 3 00001194 CloseJob
5 4 000010B0 CreateJob
6 5 00001078 CreatePrinterContext
7 6 00001094 DeletePrinterContext
8 7 00001040 GetLastError
9 8 0000105C GetVersion
10 9 00001258 NativeCreateFont
11 A 00001220 NativeCreatePen
12 B 0000121C NativeEndDoc
13 C 00001218 NativeEndPage
14 D 0000132C NativeExtTextOut
15 E 000012DC NativeGetTextExtentPoint
16 F 000012C4 NativeSetTextColor
17 10 000011CC NativeStartDoc
18 11 00001214 NativeStartPage
19 12 00001008 PrintJob1
20 13 00001024 PrintJob3
21 14 000011B0 ShowPrintManager

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

G:\>dumpbin /IMPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following imports:

COREDLL.dll
103000 Import Address Table
10203C Import Name Table
0 time date stamp
0 Index of first forwarder reference

Ordinal 963
Ordinal 63
Ordinal 964
Ordinal 960
Ordinal 959
Ordinal 930
Ordinal 895
Ordinal 61
Ordinal 924
Ordinal 897
Ordinal 896
Ordinal 36

mPrint.dll
103034 Import Address Table
102070 Import Name Table
0 time date stamp
0 Index of first forwarder reference

25
?CreateJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PAGH_N1PBG22@Z
31 ?GetLastError@mPrint@@SA?AW4MPRINT_RESULT@@XZ
39 ?GetVersion@mPrint@@SAIPAGI@Z
26 ?CreatePrinterContext@mPrintRender@@SAPAUHDC__@@XZ
2A ?DeletePrinterContext@mPrintRender@@SAXPAUHDC__@@@Z
3D ?PrintJob@mPrint@@SA_NPBDIPBG@Z
1D
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGH000@Z
1E
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGHPBDI000@Z
23
?CloseJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PBG_N@Z
4C
?ShowPrintManager@mPrintControl@@SA?AW4MPRINT_RESULT@@W4MPRINT_PMSHOW@@_N@Z
3E ?PrintJob@mPrint@@SA_NPBG@Z

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text
***************************

Thanks for the quick reply.
Venkat Polisetti

Hi Venkat,

One thing to try as a sanity check is to verify that the method you're
trying to call is actually there. Copy the dll onto a PC and run
"dumpbin
/exports" to make sure it is actually exported and that spelling, etc.,
are
correct.

Let me know how this goes...

Thanks,

Ryan Chapman
Software Development Engineer, .NET Compact Framework

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

I am trying to provide printing capability using HP Mobile Printing SDK
from VS.net 2003. This SDK available to people who submit a business
case
proposal. Let me explain what is happening. It comes with a dll into
which
the code makes P/Invoke calls for providing printing facilities. The dll
is
made part of the project and set to content so that it is moved to the
PDA
when it is diployed.

When I run the application on the PDA it is raising this
'System.MissingMethodException' exception' when we try to call one of
the
methods that they say exists in the dll. In a FAQ on HP's web site,
they
say the following:

**********
Q: I've added 'mobile printing' to my application. Now, when I click
the
'Print' button, I get a 'Missing Method' exception. How do I fix this?

A: If you have followed the procedure correctly then the way you are
launching the application may be causing the problem. The print
application needs mPrintWrapper.dll in its path. If you are using a
shortcut or a program menu to launch the application then make sure
that
the path is correctly set so that mPrintWrapper.dll (and
CSMobilePrintClassLibrary.dll or equivalent library if you are
developing
VB print solution) is in application's path.
***********

I am not using a short cut and the dll is copied into the directory
where
the exe is installed.

My question is, how and where you set the path so that it can find the
dll. Does any body have any idea about this. Your comments are
appreciated.

Regards,
Venkat Polisetti
 
V

Venkateswara Rao

Alex,

I am not calling functions in CSMobilePrintClassLibrary.dll as this is not
included by HP as part of the installation.

The following is the method call that is made from the print button from
Form1.cs.
// joID is a StringBuilder object below.
mPrint.MPRINT_RESULT retVal =
mPrint.mPrintControlWrapper.CreateJob(jobID, jobID.Capacity);

From the above, mPrint is a namespace. mPrintControlWrapper is a class
defined in mPrint.cs file.
The following is the P/Invoke in mPrint.cs file. other details stripped for
clarity.

namespace mPrint
{
public class mPrintControlWrapper
{
[DllImport("mPrintWrapper.dll")]
public static extern MPRINT_RESULT CreateJob(
StringBuilder szJobId,
Int32 iJobIdBufLen);
}
}

Thanks for looking into this.
Venkat Polisetti

Alex Feinman said:
Since everything seems to be in order, can you provide the signature of a
function that causes the exception - I'd like to see its PInvoke
definition

By the way, are you calling functions directly from mPrintWrapper.dll or
are you using CSMobilePrintClassLibrary.dll (which if I understand
correctly is an HP-provided set of PInvokes into mPrintWrapper.dll)?


--
Alex Feinman
---
Visit http://www.opennetcf.org
Venkateswara Rao said:
Here is Headers dump.

G:\>dumpbin /HEADERS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
1C0 machine (ARM)
6 number of sections
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
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)
6.20 linker version
600 size of code
E00 size of initialized data
0 size of uninitialized data
1400 entry point (00101400)
1000 base of code
2000 base of data
100000 image base (00100000 to 00106FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
3.00 subsystem version
0 Win32 version
7000 size of image
400 size of headers
0 checksum
9 subsystem (Windows CE GUI)
0 DLL characteristics
10000 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
5000 [ 242] RVA [size] of Export Directory
2000 [ 3C] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
4000 [ D8] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
6000 [ 94] 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
3000 [ 64] 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
5F0 virtual size
1000 virtual address (00101000 to 001015EF)
600 size of raw data
400 file pointer to raw data (00000400 to 000009FF)
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
2FE virtual size
2000 virtual address (00102000 to 001022FD)
400 size of raw data
A00 file pointer to raw data (00000A00 to 00000DFF)
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
98 virtual size
3000 virtual address (00103000 to 00103097)
200 size of raw data
E00 file pointer to raw data (00000E00 to 00000FFF)
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
.pdata name
D8 virtual size
4000 virtual address (00104000 to 001040D7)
200 size of raw data
1000 file pointer to raw data (00001000 to 000011FF)
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 #5
.edata name
242 virtual size
5000 virtual address (00105000 to 00105241)
400 size of raw data
1200 file pointer to raw data (00001200 to 000015FF)
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 #6
.reloc name
CE virtual size
6000 virtual address (00106000 to 001060CD)
200 size of raw data
1600 file pointer to raw data (00001600 to 000017FF)
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

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

Venkat Polisetti

Alex Feinman said:
Is there any chance you are using a DLL compiled for a wrong platform?
An x86 one?
What does dumpbin /HEADERS <yourdll> say?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Ryan,

I have done several things that did not help me. They are as follows:

1. I have modified the [HKEY_LOCAL_MACHINE\Loader] key and added the
installed directory over there.
2. Copied the dlls to \Windows
3. After that did a soft reset.

Nothing worked so far.

I have also used dumpbin to check for the method call. The method
causing the exception is "CreateJob". It is in the dll. The output of
the dumpbin is included here.
***************
G:\>dumpbin /EXPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following exports for mPrintWrapper.dll

00000000 characteristics
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
0.00 version
1 ordinal base
21 number of functions
21 number of names

ordinal hint RVA name

1 0 000010EC AddContent4
2 1 0000111C AddContent6
3 2 00001150 AddContent8
4 3 00001194 CloseJob
5 4 000010B0 CreateJob
6 5 00001078 CreatePrinterContext
7 6 00001094 DeletePrinterContext
8 7 00001040 GetLastError
9 8 0000105C GetVersion
10 9 00001258 NativeCreateFont
11 A 00001220 NativeCreatePen
12 B 0000121C NativeEndDoc
13 C 00001218 NativeEndPage
14 D 0000132C NativeExtTextOut
15 E 000012DC NativeGetTextExtentPoint
16 F 000012C4 NativeSetTextColor
17 10 000011CC NativeStartDoc
18 11 00001214 NativeStartPage
19 12 00001008 PrintJob1
20 13 00001024 PrintJob3
21 14 000011B0 ShowPrintManager

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

G:\>dumpbin /IMPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following imports:

COREDLL.dll
103000 Import Address Table
10203C Import Name Table
0 time date stamp
0 Index of first forwarder reference

Ordinal 963
Ordinal 63
Ordinal 964
Ordinal 960
Ordinal 959
Ordinal 930
Ordinal 895
Ordinal 61
Ordinal 924
Ordinal 897
Ordinal 896
Ordinal 36

mPrint.dll
103034 Import Address Table
102070 Import Name Table
0 time date stamp
0 Index of first forwarder reference

25
?CreateJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PAGH_N1PBG22@Z
31 ?GetLastError@mPrint@@SA?AW4MPRINT_RESULT@@XZ
39 ?GetVersion@mPrint@@SAIPAGI@Z
26 ?CreatePrinterContext@mPrintRender@@SAPAUHDC__@@XZ
2A
?DeletePrinterContext@mPrintRender@@SAXPAUHDC__@@@Z
3D ?PrintJob@mPrint@@SA_NPBDIPBG@Z
1D
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGH000@Z
1E
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGHPBDI000@Z
23
?CloseJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PBG_N@Z
4C
?ShowPrintManager@mPrintControl@@SA?AW4MPRINT_RESULT@@W4MPRINT_PMSHOW@@_N@Z
3E ?PrintJob@mPrint@@SA_NPBG@Z

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text
***************************

Thanks for the quick reply.
Venkat Polisetti

Hi Venkat,

One thing to try as a sanity check is to verify that the method you're
trying to call is actually there. Copy the dll onto a PC and run
"dumpbin
/exports" to make sure it is actually exported and that spelling,
etc., are
correct.

Let me know how this goes...

Thanks,

Ryan Chapman
Software Development Engineer, .NET Compact Framework

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

I am trying to provide printing capability using HP Mobile Printing SDK
from VS.net 2003. This SDK available to people who submit a business
case
proposal. Let me explain what is happening. It comes with a dll into
which
the code makes P/Invoke calls for providing printing facilities. The
dll is
made part of the project and set to content so that it is moved to the
PDA
when it is diployed.

When I run the application on the PDA it is raising this
'System.MissingMethodException' exception' when we try to call one of
the
methods that they say exists in the dll. In a FAQ on HP's web site,
they
say the following:

**********
Q: I've added 'mobile printing' to my application. Now, when I click
the
'Print' button, I get a 'Missing Method' exception. How do I fix this?

A: If you have followed the procedure correctly then the way you are
launching the application may be causing the problem. The print
application needs mPrintWrapper.dll in its path. If you are using a
shortcut or a program menu to launch the application then make sure
that
the path is correctly set so that mPrintWrapper.dll (and
CSMobilePrintClassLibrary.dll or equivalent library if you are
developing
VB print solution) is in application's path.
***********

I am not using a short cut and the dll is copied into the directory
where
the exe is installed.

My question is, how and where you set the path so that it can find the
dll. Does any body have any idea about this. Your comments are
appreciated.

Regards,
Venkat Polisetti
 
V

Venkateswara Rao

I tried loading it using loadlibrary and got 194 as last error number (
ERROR_BAD_EXE_FORMAT ).
But when I did a dumpbin /HEADERS, it showed this dll as ARM which I think
Dell AXIM X30's pocket pc processor type. Am I missing something here.

FILE HEADER VALUES
1C0 machine (ARM)

Thanks,
Venkat Polisetti

Venkateswara Rao said:
Alex,

I am not calling functions in CSMobilePrintClassLibrary.dll as this is not
included by HP as part of the installation.

The following is the method call that is made from the print button from
Form1.cs.
// joID is a StringBuilder object below.
mPrint.MPRINT_RESULT retVal =
mPrint.mPrintControlWrapper.CreateJob(jobID, jobID.Capacity);

From the above, mPrint is a namespace. mPrintControlWrapper is a class
defined in mPrint.cs file.
The following is the P/Invoke in mPrint.cs file. other details stripped
for clarity.

namespace mPrint
{
public class mPrintControlWrapper
{
[DllImport("mPrintWrapper.dll")]
public static extern MPRINT_RESULT CreateJob(
StringBuilder szJobId,
Int32 iJobIdBufLen);
}
}

Thanks for looking into this.
Venkat Polisetti

Alex Feinman said:
Since everything seems to be in order, can you provide the signature of a
function that causes the exception - I'd like to see its PInvoke
definition

By the way, are you calling functions directly from mPrintWrapper.dll or
are you using CSMobilePrintClassLibrary.dll (which if I understand
correctly is an HP-provided set of PInvokes into mPrintWrapper.dll)?


--
Alex Feinman
---
Visit http://www.opennetcf.org
Venkateswara Rao said:
Here is Headers dump.

G:\>dumpbin /HEADERS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
1C0 machine (ARM)
6 number of sections
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
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)
6.20 linker version
600 size of code
E00 size of initialized data
0 size of uninitialized data
1400 entry point (00101400)
1000 base of code
2000 base of data
100000 image base (00100000 to 00106FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
3.00 subsystem version
0 Win32 version
7000 size of image
400 size of headers
0 checksum
9 subsystem (Windows CE GUI)
0 DLL characteristics
10000 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
5000 [ 242] RVA [size] of Export Directory
2000 [ 3C] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
4000 [ D8] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
6000 [ 94] 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
3000 [ 64] 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
5F0 virtual size
1000 virtual address (00101000 to 001015EF)
600 size of raw data
400 file pointer to raw data (00000400 to 000009FF)
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
2FE virtual size
2000 virtual address (00102000 to 001022FD)
400 size of raw data
A00 file pointer to raw data (00000A00 to 00000DFF)
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
98 virtual size
3000 virtual address (00103000 to 00103097)
200 size of raw data
E00 file pointer to raw data (00000E00 to 00000FFF)
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
.pdata name
D8 virtual size
4000 virtual address (00104000 to 001040D7)
200 size of raw data
1000 file pointer to raw data (00001000 to 000011FF)
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 #5
.edata name
242 virtual size
5000 virtual address (00105000 to 00105241)
400 size of raw data
1200 file pointer to raw data (00001200 to 000015FF)
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 #6
.reloc name
CE virtual size
6000 virtual address (00106000 to 001060CD)
200 size of raw data
1600 file pointer to raw data (00001600 to 000017FF)
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

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

Venkat Polisetti

Is there any chance you are using a DLL compiled for a wrong platform?
An x86 one?
What does dumpbin /HEADERS <yourdll> say?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Ryan,

I have done several things that did not help me. They are as follows:

1. I have modified the [HKEY_LOCAL_MACHINE\Loader] key and added the
installed directory over there.
2. Copied the dlls to \Windows
3. After that did a soft reset.

Nothing worked so far.

I have also used dumpbin to check for the method call. The method
causing the exception is "CreateJob". It is in the dll. The output of
the dumpbin is included here.
***************
G:\>dumpbin /EXPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following exports for mPrintWrapper.dll

00000000 characteristics
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
0.00 version
1 ordinal base
21 number of functions
21 number of names

ordinal hint RVA name

1 0 000010EC AddContent4
2 1 0000111C AddContent6
3 2 00001150 AddContent8
4 3 00001194 CloseJob
5 4 000010B0 CreateJob
6 5 00001078 CreatePrinterContext
7 6 00001094 DeletePrinterContext
8 7 00001040 GetLastError
9 8 0000105C GetVersion
10 9 00001258 NativeCreateFont
11 A 00001220 NativeCreatePen
12 B 0000121C NativeEndDoc
13 C 00001218 NativeEndPage
14 D 0000132C NativeExtTextOut
15 E 000012DC NativeGetTextExtentPoint
16 F 000012C4 NativeSetTextColor
17 10 000011CC NativeStartDoc
18 11 00001214 NativeStartPage
19 12 00001008 PrintJob1
20 13 00001024 PrintJob3
21 14 000011B0 ShowPrintManager

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

G:\>dumpbin /IMPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following imports:

COREDLL.dll
103000 Import Address Table
10203C Import Name Table
0 time date stamp
0 Index of first forwarder reference

Ordinal 963
Ordinal 63
Ordinal 964
Ordinal 960
Ordinal 959
Ordinal 930
Ordinal 895
Ordinal 61
Ordinal 924
Ordinal 897
Ordinal 896
Ordinal 36

mPrint.dll
103034 Import Address Table
102070 Import Name Table
0 time date stamp
0 Index of first forwarder reference

25
?CreateJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PAGH_N1PBG22@Z
31 ?GetLastError@mPrint@@SA?AW4MPRINT_RESULT@@XZ
39 ?GetVersion@mPrint@@SAIPAGI@Z
26
?CreatePrinterContext@mPrintRender@@SAPAUHDC__@@XZ
2A
?DeletePrinterContext@mPrintRender@@SAXPAUHDC__@@@Z
3D ?PrintJob@mPrint@@SA_NPBDIPBG@Z
1D
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGH000@Z
1E
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGHPBDI000@Z
23
?CloseJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PBG_N@Z
4C
?ShowPrintManager@mPrintControl@@SA?AW4MPRINT_RESULT@@W4MPRINT_PMSHOW@@_N@Z
3E ?PrintJob@mPrint@@SA_NPBG@Z

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text
***************************

Thanks for the quick reply.
Venkat Polisetti

Hi Venkat,

One thing to try as a sanity check is to verify that the method
you're
trying to call is actually there. Copy the dll onto a PC and run
"dumpbin
/exports" to make sure it is actually exported and that spelling,
etc., are
correct.

Let me know how this goes...

Thanks,

Ryan Chapman
Software Development Engineer, .NET Compact Framework

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

I am trying to provide printing capability using HP Mobile Printing
SDK
from VS.net 2003. This SDK available to people who submit a business
case
proposal. Let me explain what is happening. It comes with a dll into
which
the code makes P/Invoke calls for providing printing facilities. The
dll is
made part of the project and set to content so that it is moved to the
PDA
when it is diployed.

When I run the application on the PDA it is raising this
'System.MissingMethodException' exception' when we try to call one of
the
methods that they say exists in the dll. In a FAQ on HP's web site,
they
say the following:

**********
Q: I've added 'mobile printing' to my application. Now, when I click
the
'Print' button, I get a 'Missing Method' exception. How do I fix
this?

A: If you have followed the procedure correctly then the way you are
launching the application may be causing the problem. The print
application needs mPrintWrapper.dll in its path. If you are using a
shortcut or a program menu to launch the application then make sure
that
the path is correctly set so that mPrintWrapper.dll (and
CSMobilePrintClassLibrary.dll or equivalent library if you are
developing
VB print solution) is in application's path.
***********

I am not using a short cut and the dll is copied into the directory
where
the exe is installed.

My question is, how and where you set the path so that it can find
the
dll. Does any body have any idea about this. Your comments are
appreciated.

Regards,
Venkat Polisetti
 
A

Alex Feinman [MVP]

Check if perhaps you have a wrong version of the dll elsewhere on your
device - e.g. in Windows directory

--
Alex Feinman
---
Visit http://www.opennetcf.org
Venkateswara Rao said:
I tried loading it using loadlibrary and got 194 as last error number (
ERROR_BAD_EXE_FORMAT ).
But when I did a dumpbin /HEADERS, it showed this dll as ARM which I think
Dell AXIM X30's pocket pc processor type. Am I missing something here.

FILE HEADER VALUES
1C0 machine (ARM)

Thanks,
Venkat Polisetti

Venkateswara Rao said:
Alex,

I am not calling functions in CSMobilePrintClassLibrary.dll as this is
not included by HP as part of the installation.

The following is the method call that is made from the print button from
Form1.cs.
// joID is a StringBuilder object below.
mPrint.MPRINT_RESULT retVal =
mPrint.mPrintControlWrapper.CreateJob(jobID, jobID.Capacity);

From the above, mPrint is a namespace. mPrintControlWrapper is a class
defined in mPrint.cs file.
The following is the P/Invoke in mPrint.cs file. other details stripped
for clarity.

namespace mPrint
{
public class mPrintControlWrapper
{
[DllImport("mPrintWrapper.dll")]
public static extern MPRINT_RESULT CreateJob(
StringBuilder szJobId,
Int32 iJobIdBufLen);
}
}

Thanks for looking into this.
Venkat Polisetti

Alex Feinman said:
Since everything seems to be in order, can you provide the signature of
a function that causes the exception - I'd like to see its PInvoke
definition

By the way, are you calling functions directly from mPrintWrapper.dll or
are you using CSMobilePrintClassLibrary.dll (which if I understand
correctly is an HP-provided set of PInvokes into mPrintWrapper.dll)?


--
Alex Feinman
---
Visit http://www.opennetcf.org
Here is Headers dump.

G:\>dumpbin /HEADERS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
1C0 machine (ARM)
6 number of sections
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
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)
6.20 linker version
600 size of code
E00 size of initialized data
0 size of uninitialized data
1400 entry point (00101400)
1000 base of code
2000 base of data
100000 image base (00100000 to 00106FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
3.00 subsystem version
0 Win32 version
7000 size of image
400 size of headers
0 checksum
9 subsystem (Windows CE GUI)
0 DLL characteristics
10000 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
5000 [ 242] RVA [size] of Export Directory
2000 [ 3C] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
4000 [ D8] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
6000 [ 94] 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
3000 [ 64] 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
5F0 virtual size
1000 virtual address (00101000 to 001015EF)
600 size of raw data
400 file pointer to raw data (00000400 to 000009FF)
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
2FE virtual size
2000 virtual address (00102000 to 001022FD)
400 size of raw data
A00 file pointer to raw data (00000A00 to 00000DFF)
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
98 virtual size
3000 virtual address (00103000 to 00103097)
200 size of raw data
E00 file pointer to raw data (00000E00 to 00000FFF)
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
.pdata name
D8 virtual size
4000 virtual address (00104000 to 001040D7)
200 size of raw data
1000 file pointer to raw data (00001000 to 000011FF)
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 #5
.edata name
242 virtual size
5000 virtual address (00105000 to 00105241)
400 size of raw data
1200 file pointer to raw data (00001200 to 000015FF)
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 #6
.reloc name
CE virtual size
6000 virtual address (00106000 to 001060CD)
200 size of raw data
1600 file pointer to raw data (00001600 to 000017FF)
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

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

Venkat Polisetti

Is there any chance you are using a DLL compiled for a wrong platform?
An x86 one?
What does dumpbin /HEADERS <yourdll> say?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Ryan,

I have done several things that did not help me. They are as follows:

1. I have modified the [HKEY_LOCAL_MACHINE\Loader] key and added the
installed directory over there.
2. Copied the dlls to \Windows
3. After that did a soft reset.

Nothing worked so far.

I have also used dumpbin to check for the method call. The method
causing the exception is "CreateJob". It is in the dll. The output of
the dumpbin is included here.
***************
G:\>dumpbin /EXPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following exports for mPrintWrapper.dll

00000000 characteristics
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
0.00 version
1 ordinal base
21 number of functions
21 number of names

ordinal hint RVA name

1 0 000010EC AddContent4
2 1 0000111C AddContent6
3 2 00001150 AddContent8
4 3 00001194 CloseJob
5 4 000010B0 CreateJob
6 5 00001078 CreatePrinterContext
7 6 00001094 DeletePrinterContext
8 7 00001040 GetLastError
9 8 0000105C GetVersion
10 9 00001258 NativeCreateFont
11 A 00001220 NativeCreatePen
12 B 0000121C NativeEndDoc
13 C 00001218 NativeEndPage
14 D 0000132C NativeExtTextOut
15 E 000012DC NativeGetTextExtentPoint
16 F 000012C4 NativeSetTextColor
17 10 000011CC NativeStartDoc
18 11 00001214 NativeStartPage
19 12 00001008 PrintJob1
20 13 00001024 PrintJob3
21 14 000011B0 ShowPrintManager

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

G:\>dumpbin /IMPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following imports:

COREDLL.dll
103000 Import Address Table
10203C Import Name Table
0 time date stamp
0 Index of first forwarder reference

Ordinal 963
Ordinal 63
Ordinal 964
Ordinal 960
Ordinal 959
Ordinal 930
Ordinal 895
Ordinal 61
Ordinal 924
Ordinal 897
Ordinal 896
Ordinal 36

mPrint.dll
103034 Import Address Table
102070 Import Name Table
0 time date stamp
0 Index of first forwarder reference

25
?CreateJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PAGH_N1PBG22@Z
31 ?GetLastError@mPrint@@SA?AW4MPRINT_RESULT@@XZ
39 ?GetVersion@mPrint@@SAIPAGI@Z
26
?CreatePrinterContext@mPrintRender@@SAPAUHDC__@@XZ
2A
?DeletePrinterContext@mPrintRender@@SAXPAUHDC__@@@Z
3D ?PrintJob@mPrint@@SA_NPBDIPBG@Z
1D
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGH000@Z
1E
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGHPBDI000@Z
23
?CloseJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PBG_N@Z
4C
?ShowPrintManager@mPrintControl@@SA?AW4MPRINT_RESULT@@W4MPRINT_PMSHOW@@_N@Z
3E ?PrintJob@mPrint@@SA_NPBG@Z

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text
***************************

Thanks for the quick reply.
Venkat Polisetti

Hi Venkat,

One thing to try as a sanity check is to verify that the method
you're
trying to call is actually there. Copy the dll onto a PC and run
"dumpbin
/exports" to make sure it is actually exported and that spelling,
etc., are
correct.

Let me know how this goes...

Thanks,

Ryan Chapman
Software Development Engineer, .NET Compact Framework

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

I am trying to provide printing capability using HP Mobile Printing
SDK
from VS.net 2003. This SDK available to people who submit a business
case
proposal. Let me explain what is happening. It comes with a dll into
which
the code makes P/Invoke calls for providing printing facilities. The
dll is
made part of the project and set to content so that it is moved to
the PDA
when it is diployed.

When I run the application on the PDA it is raising this
'System.MissingMethodException' exception' when we try to call one
of the
methods that they say exists in the dll. In a FAQ on HP's web site,
they
say the following:

**********
Q: I've added 'mobile printing' to my application. Now, when I click
the
'Print' button, I get a 'Missing Method' exception. How do I fix
this?

A: If you have followed the procedure correctly then the way you are
launching the application may be causing the problem. The print
application needs mPrintWrapper.dll in its path. If you are using a
shortcut or a program menu to launch the application then make sure
that
the path is correctly set so that mPrintWrapper.dll (and
CSMobilePrintClassLibrary.dll or equivalent library if you are
developing
VB print solution) is in application's path.
***********

I am not using a short cut and the dll is copied into the directory
where
the exe is installed.

My question is, how and where you set the path so that it can find
the
dll. Does any body have any idea about this. Your comments are
appreciated.

Regards,
Venkat Polisetti
 
V

Venkat Polisetti

Thanks to all of you who have spent your valuable time with me trying
to solve this. I got it resolved by installing a cab (mPrint.arm.CAB)
provided by HP in their install directory. They mentioned in one of
their samples that the VS.net would move the cab file to the device
during deployment but it is never the case. So I moved the cab file
and installed the required dlls on the device and the missing method
exception is gone. I started looking for the dlls after I looked at
the dumpbin /IMPORTS output in which it listed mprint.dll as a
dependent on mprintwrapper.dll. When I tried to load mprintwrapper.dll
myself using LoadLibrary I got 126 (module not found) as the lasterror
number. But mprintwrapper.dll is very much there on the device and was
certain then there were other dlls that were missing after looking at
the dumpbin /imports output.

Thanks agiain to all the nice folks who helped me solve this issue
with their valuable time.

Regards,
Venkat Polisetti


Alex Feinman said:
Check if perhaps you have a wrong version of the dll elsewhere on your
device - e.g. in Windows directory

--
Alex Feinman
---
Visit http://www.opennetcf.org
Venkateswara Rao said:
I tried loading it using loadlibrary and got 194 as last error number (
ERROR_BAD_EXE_FORMAT ).
But when I did a dumpbin /HEADERS, it showed this dll as ARM which I think
Dell AXIM X30's pocket pc processor type. Am I missing something here.

FILE HEADER VALUES
1C0 machine (ARM)

Thanks,
Venkat Polisetti

Venkateswara Rao said:
Alex,

I am not calling functions in CSMobilePrintClassLibrary.dll as this is
not included by HP as part of the installation.

The following is the method call that is made from the print button from
Form1.cs.
// joID is a StringBuilder object below.
mPrint.MPRINT_RESULT retVal =
mPrint.mPrintControlWrapper.CreateJob(jobID, jobID.Capacity);

From the above, mPrint is a namespace. mPrintControlWrapper is a class
defined in mPrint.cs file.
The following is the P/Invoke in mPrint.cs file. other details stripped
for clarity.

namespace mPrint
{
public class mPrintControlWrapper
{
[DllImport("mPrintWrapper.dll")]
public static extern MPRINT_RESULT CreateJob(
StringBuilder szJobId,
Int32 iJobIdBufLen);
}
}

Thanks for looking into this.
Venkat Polisetti

Since everything seems to be in order, can you provide the signature of
a function that causes the exception - I'd like to see its PInvoke
definition

By the way, are you calling functions directly from mPrintWrapper.dll or
are you using CSMobilePrintClassLibrary.dll (which if I understand
correctly is an HP-provided set of PInvokes into mPrintWrapper.dll)?


--
Alex Feinman
---
Visit http://www.opennetcf.org
Here is Headers dump.

G:\>dumpbin /HEADERS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
1C0 machine (ARM)
6 number of sections
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
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)
6.20 linker version
600 size of code
E00 size of initialized data
0 size of uninitialized data
1400 entry point (00101400)
1000 base of code
2000 base of data
100000 image base (00100000 to 00106FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
3.00 subsystem version
0 Win32 version
7000 size of image
400 size of headers
0 checksum
9 subsystem (Windows CE GUI)
0 DLL characteristics
10000 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
5000 [ 242] RVA [size] of Export Directory
2000 [ 3C] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
4000 [ D8] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
6000 [ 94] 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
3000 [ 64] 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
5F0 virtual size
1000 virtual address (00101000 to 001015EF)
600 size of raw data
400 file pointer to raw data (00000400 to 000009FF)
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
2FE virtual size
2000 virtual address (00102000 to 001022FD)
400 size of raw data
A00 file pointer to raw data (00000A00 to 00000DFF)
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
98 virtual size
3000 virtual address (00103000 to 00103097)
200 size of raw data
E00 file pointer to raw data (00000E00 to 00000FFF)
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
.pdata name
D8 virtual size
4000 virtual address (00104000 to 001040D7)
200 size of raw data
1000 file pointer to raw data (00001000 to 000011FF)
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 #5
.edata name
242 virtual size
5000 virtual address (00105000 to 00105241)
400 size of raw data
1200 file pointer to raw data (00001200 to 000015FF)
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 #6
.reloc name
CE virtual size
6000 virtual address (00106000 to 001060CD)
200 size of raw data
1600 file pointer to raw data (00001600 to 000017FF)
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

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

Venkat Polisetti

Is there any chance you are using a DLL compiled for a wrong platform?
An x86 one?
What does dumpbin /HEADERS <yourdll> say?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Ryan,

I have done several things that did not help me. They are as follows:

1. I have modified the [HKEY_LOCAL_MACHINE\Loader] key and added the
installed directory over there.
2. Copied the dlls to \Windows
3. After that did a soft reset.

Nothing worked so far.

I have also used dumpbin to check for the method call. The method
causing the exception is "CreateJob". It is in the dll. The output of
the dumpbin is included here.
***************
G:\>dumpbin /EXPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following exports for mPrintWrapper.dll

00000000 characteristics
3FDA2F33 time date stamp Fri Dec 12 16:12:19 2003
0.00 version
1 ordinal base
21 number of functions
21 number of names

ordinal hint RVA name

1 0 000010EC AddContent4
2 1 0000111C AddContent6
3 2 00001150 AddContent8
4 3 00001194 CloseJob
5 4 000010B0 CreateJob
6 5 00001078 CreatePrinterContext
7 6 00001094 DeletePrinterContext
8 7 00001040 GetLastError
9 8 0000105C GetVersion
10 9 00001258 NativeCreateFont
11 A 00001220 NativeCreatePen
12 B 0000121C NativeEndDoc
13 C 00001218 NativeEndPage
14 D 0000132C NativeExtTextOut
15 E 000012DC NativeGetTextExtentPoint
16 F 000012C4 NativeSetTextColor
17 10 000011CC NativeStartDoc
18 11 00001214 NativeStartPage
19 12 00001008 PrintJob1
20 13 00001024 PrintJob3
21 14 000011B0 ShowPrintManager

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text

G:\>dumpbin /IMPORTS
"H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll"

Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file H:\VSProjects\PrintTest\PrintTest\mPrintWrapper.dll

File Type: DLL

Section contains the following imports:

COREDLL.dll
103000 Import Address Table
10203C Import Name Table
0 time date stamp
0 Index of first forwarder reference

Ordinal 963
Ordinal 63
Ordinal 964
Ordinal 960
Ordinal 959
Ordinal 930
Ordinal 895
Ordinal 61
Ordinal 924
Ordinal 897
Ordinal 896
Ordinal 36

mPrint.dll
103034 Import Address Table
102070 Import Name Table
0 time date stamp
0 Index of first forwarder reference

25
?CreateJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PAGH_N1PBG22@Z
31 ?GetLastError@mPrint@@SA?AW4MPRINT_RESULT@@XZ
39 ?GetVersion@mPrint@@SAIPAGI@Z
26
?CreatePrinterContext@mPrintRender@@SAPAUHDC__@@XZ
2A
?DeletePrinterContext@mPrintRender@@SAXPAUHDC__@@@Z
3D ?PrintJob@mPrint@@SA_NPBDIPBG@Z
1D
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGH000@Z
1E
?AddContent@mPrintControl@@SA?AW4MPRINT_RESULT@@PBGPAGHPBDI000@Z
23
?CloseJob@mPrintControl@@SA?AW4MPRINT_RESULT@@PBG_N@Z
4C
?ShowPrintManager@mPrintControl@@SA?AW4MPRINT_RESULT@@W4MPRINT_PMSHOW@@_N@Z
3E ?PrintJob@mPrint@@SA_NPBG@Z

Summary

1000 .data
1000 .edata
1000 .pdata
1000 .rdata
1000 .reloc
1000 .text
***************************

Thanks for the quick reply.
Venkat Polisetti

Hi Venkat,

One thing to try as a sanity check is to verify that the method
you're
trying to call is actually there. Copy the dll onto a PC and run
"dumpbin
/exports" to make sure it is actually exported and that spelling,
etc., are
correct.

Let me know how this goes...

Thanks,

Ryan Chapman
Software Development Engineer, .NET Compact Framework

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

I am trying to provide printing capability using HP Mobile Printing
SDK
from VS.net 2003. This SDK available to people who submit a business
case
proposal. Let me explain what is happening. It comes with a dll into
which
the code makes P/Invoke calls for providing printing facilities. The
dll is
made part of the project and set to content so that it is moved to
the PDA
when it is diployed.

When I run the application on the PDA it is raising this
'System.MissingMethodException' exception' when we try to call one
of the
methods that they say exists in the dll. In a FAQ on HP's web site,
they
say the following:

**********
Q: I've added 'mobile printing' to my application. Now, when I click
the
'Print' button, I get a 'Missing Method' exception. How do I fix
this?

A: If you have followed the procedure correctly then the way you are
launching the application may be causing the problem. The print
application needs mPrintWrapper.dll in its path. If you are using a
shortcut or a program menu to launch the application then make sure
that
the path is correctly set so that mPrintWrapper.dll (and
CSMobilePrintClassLibrary.dll or equivalent library if you are
developing
VB print solution) is in application's path.
***********

I am not using a short cut and the dll is copied into the directory
where
the exe is installed.

My question is, how and where you set the path so that it can find
the
dll. Does any body have any idea about this. Your comments are
appreciated.

Regards,
Venkat Polisetti
 

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