Re: C# Prototype & Delegate in Compact Framework

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello, ThinkRS232!

T> Win32 DLL Function Prototype
T> -----------
T> Status = XferFiles(int PortID, int Direction, int Protocol, LPCTSTR
T> Fspec, int Flag, int (WINAPI *Callback)(int Chgflg, char *Fname, long
T> Bytcnt, int Curblk, int Errcnt, unsigned Rate));

T> 1. What would the above C# function prototype look like?
T> 2. And the delegate for the callback function?

What type returns XferFiels(...)?

C#
[DllImport("your.dll", SetLastError=true)]
XferFiles( int portID, int Direction, int Protocol, string Fspec, int Flag, CallbackDelegate callback);

delegate int CallbackDelegate(int Chgflg,
[MarshalAs(UnmanagedType.LPStr]
string Fname,
long Bytcnt,
int Curblk,
int Errcnt,
uint Rate);

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

Relevant Pages

  • Re: [RFC/PATCH] unregister_node() for hotplug use
    ... this kind of stuff to the driver core maintainer, ... > Not needed for a function prototype. ... +void unregister_node ... +static int __init register_node_type ...
    (Linux-Kernel)
  • [2.6.36-rc5] TTM fixes...
    ... Correct allocation flags type and function prototype for ANSI C compliance. ... struct list_head list; ... * This function is reentrant if caller updates count depending on number of ... int ttm_flags, enum ttm_caching_state cstate, unsigned count) ...
    (Linux-Kernel)
  • [C++] Functions Opinion
    ... and the second is the function definition. ... really needing to include the function prototype). ... were to just simply define the function prior to main (doing away with a ... int function ...
    (alt.comp.lang.learn.c-cpp)
  • Re: function prototype declaration
    ... Sheldon wrote: ... Compiling gives the following error with the function prototype: ... int and not use the #define method, it might work, but I would like ...
    (comp.lang.c)
  • Re: Prototype or not prototype?
    ... have the opinion of the experts here: ... int function() ... there is no function prototype here. ... the compiler knows exactly the signature of main, ...
    (comp.std.c)