Hi Paul,
Thank you very much for your reply.
As I am a starter, I couldn't understand
> " but you should make sure that you are
> compiling the exported functions in the DLL as C functions, not C++. "
I have a C run time DLL( third party), I need to access the C methods in
this DLL. What I have done is
I have written a sample code which access a method called Connect in the dll.
[ DllImport (" blah.dll")]
private static extern void Connect ();
Then I compiled the code using "Build"
but when I deployed it on my PDA, it is giving "MissingMethod" exception.
Am I doing right thing?. if not, kindly let me know what I need to change.
do I need to change any settings in Visual Studio.NET 2003.
I got the same problem when I tried the following sample code from the
internet
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
public class Win32
{
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern int MessageBox(int hWnd, string text,
string caption, uint type);
}
public class HelloWorld
{
public static void Main()
{
Win32.MessageBox(0, "Hello World", "Platform InvokeSample", 0);
}
}
Thank you,
Naveen.
"Paul G. Tobey [eMVP]" wrote:
> You don't have to register anything, but you should make sure that you are
> compiling the exported functions in the DLL as C functions, not C++. C++,
> as you certainly must know, changes the exported names of functions so that
> their parameter and return types are part of their name. This allows
> overloading of functions, since you can distinguish between int A( float b )
> and int A( long b ) by the mangled function name, but it also makes it
> harder to call from systems where you have to know the actual exported name.
> The depends.exe tool will show you the actual exported names from a DLL and
> you should be able to use this tool to see if what you are telling your C#
> code to call is actually what the DLL is exporting...
>
> Paul T.
>
> "Naveen Mukkelli" <(E-Mail Removed)> wrote in
> message news:33E6561E-25BB-4AD6-94F1-(E-Mail Removed)...
> > Hi Steve,
> >
> > Thank you for your response.
> > I when I tried a samle program, I got "Missing method exception" in my
> > PDA.
> >
> > I am wondering are we supposed to install and register the "DLL" in PDA.
> >
> > Kindly let me know.
> >
> > Cheers,
> >
> > Naveen
> >
> > "Steve Maillet (eMVP)" wrote:
> >
> >> In particular search for "dll import" or "PInvoke"
> >>
> >> --
> >> Steve Maillet
> >> EmbeddedFusion
> >> www.EmbeddedFusion.com
> >>
> >> Do have an opinion on the effectiveness of Microsoft Windows Mobile and
> >> Embedded newsgroups? Let us know!
> >> https://www.windowsembeddedeval.com/...ity/newsgroups
> >>
> >>
> >>
>
>
>