Re: C libraries in C#

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Paul G. Tobey [eMVP] (ptobey)
Date: 08/24/04


Date: Tue, 24 Aug 2004 08:30:42 -0700

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" <NaveenMukkelli@discussions.microsoft.com> wrote in
message news:33E6561E-25BB-4AD6-94F1-E0EBC9350758@microsoft.com...
> 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/community/newsgroups
>>
>>
>>



Relevant Pages

  • Re: Need help in exporting API for Kernel Mode DLL to Application
    ... I am facing some problem in exporting kernel mode Driver DLL API to ... When this MYDTest is called in application, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: VC++ .NET 2002: Which Wizard/Template to Use to Get a Regular DLL and a non-MFC DLL of native C+
    ... Prior to this use such DLL file must be loaded into memory by host ... make your DLL usable from other compilers or other programming ... "Managed C++" above - as those are NOT plain dynamic libraries! ... entities you are exporting from your DLL library. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Exporting classes; good idea, bad idea, and problems?
    ... I wrote an "engine" while I was working towards my MS in Comp.Sci and pretty ... I've decided that I whould like to make the Engine library into a DLL ... > Since the implementation is available in the client app because the client ... > If exporting the classes is not feasible, ...
    (microsoft.public.vc.language)
  • Re: Show Dialog from MFC Extension DLL
    ... and used by both MFC applications as well as non-MFC applications. ... I simplify things by exporting a non-MFC class that "represents" my dialog. ... file that has no MFC in it, so they aren't exposed to it (this is what allows ATL and console applications to use the DLL to show the dialog). ...
    (microsoft.public.vc.mfc)
  • Re: So Delphi cant do this ...
    ... > doesn't want to define some memory that he can export as a function, ... > he wants to read and write it, having imported it from the DLL ... but I worry about it as a general solution for exporting data. ...
    (borland.public.delphi.language.objectpascal)