none
Unmanaged .dll Import. RRS feed

  • Question

  • C# 2005.
    I'm using an unmanaged .dll in C#.  I have most of the funtions working but I can get this one to work.  The original C function passes "NULL" as the last two parameters.  C# soes not like this.  What  should I pass in C# that is equivalent to NULL?  Thanks.
     

    C# Code:
    [
    DllImport("mcs132.dll")]

    public static extern uint PassThruIoctl(uint ChannelID, uint IOCtrlID,NULL,NULL);  //C# does not like the NULLs.


    C++ Code:
    //typedef long (CALLBACK* PTIOCTL)(unsigned long, unsigned long, void *, void *);


    - It's all good.
    Saturday, November 15, 2008 11:07 AM

Answers


  • Thanks Viral.  I got it to work with this:

    public static extern uint PassThruIoctl(uint ChannelID, uint IOCtrlID, IntPtr Param1, IntPtr Param2);


    - It's all good.
    • Marked as answer by Harry Zhu Wednesday, November 19, 2008 5:20 AM
    Saturday, November 15, 2008 12:05 PM

All replies

  • Try "null" - smaller case.

    Thanks,
    Viral.
    Saturday, November 15, 2008 11:49 AM

  • Thanks Viral.  I got it to work with this:

    public static extern uint PassThruIoctl(uint ChannelID, uint IOCtrlID, IntPtr Param1, IntPtr Param2);


    - It's all good.
    • Marked as answer by Harry Zhu Wednesday, November 19, 2008 5:20 AM
    Saturday, November 15, 2008 12:05 PM