Re: [newbie]Calling eVc4++ dll from .NET application



The OpenNETCF Smart Device Framework, found at www.opennetcf.org, has tons
of platform invoke (P/Invoke) declarations that you might use as examples.
Since you haven't said whether you're working in VB.NET or C#, I've given a
single example from the SDF below:

using System.Runtime.InteropServices;

// P/Invoke declarations.
[DllImport ("coredll.dll", SetLastError=true)]
private static extern IntPtr RequestDeviceNotifications(
byte[] devclass, IntPtr hMsgQ,
bool fAll );

Obviously, this isn't something general, where looking at this one example
is going to help much, except as a syntax sample.

By the way, the best place for managed code questions for Windows CE is
microsoft.public.dotnet.framework.compactframework.

Paul T.


"JB" <jb@xxxxxxxxx> wrote in message
news:4371ee74$0$29591$4fafbaef@xxxxxxxxxxxxxxxxxxxxxx
> Hi everybody,
>
> I've developed a very simple dll using eVc4++
> This dll was used as the JNI part of a java application running on a
> PocketPC 2003 device in order to access serial port and virtual Bluetooth
> serial ports.
>
> Now I have to make this dll usable from a .Net appliation.
>
> I've no experience on .NET at all.
>
> How I have to declare my dll functions in order to be easily utilized from
> a .NET application?(_declspec(dllexport), extern "C", ecc)
>
> If I want to make a very simple .Net application to test this dll, how
> this would be achieved? (If I'm not wrong i should use a DllImport
> call...is it true?)
>
> Can anyone point me in the right direction, even with a HelloWord piece of
> code (both dll and .Net app would be really appreciated)
>
> Thanks in advance.
> JB


.



Relevant Pages

  • why do these 2 ways of invoking an external C function work?
    ... I'm using P/Invoke to call a C function from a DLL in my C# class. ... I've tested both these declarations and both work. ... the second declaration works as well and I'm wondering why. ...
    (microsoft.public.dotnet.framework.interop)
  • why do these 2 ways of invoking an external C function work?
    ... I'm using P/Invoke to call a C function from a DLL in my C# class. ... I've tested both these declarations and both work. ... the second declaration works as well and I'm wondering why. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C++ Interop and P/Invoke in C++
    ... C language Win32 dll. ... P/Invoke is managed code calling an unmanaged Dll. ... The term "Interop" is used loosely, so it's best to explain exactly what ...
    (microsoft.public.dotnet.framework.interop)
  • Re: NEWBIE: use COM Interop or P/Invoke?
    ... If I had the option of interop using COM or P/Invoke I would ... Writing a DLL is simple, if you keep your interop data types simple, P/I is ... And eventually my code will run as a Windows Service. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: PInvoke a legacy class?
    ... Which parts actually constitute the mangled name DllImport is looking for? ... > or the numeric ordinal - you can use dumpbin or depends to find out this ... > then P/Invoke this from managed code. ... But how do you do that for a legacy dll that is built as a ...
    (microsoft.public.dotnet.framework.compactframework)