CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jan 2014
    Posts
    3

    Instantiating and using Opaque struct in C Sharp

    Hello....



    I have the below limited info provided from some 3rd party. Due to security reasons no more info will be available.

    I am trying to use this info in C# and I am not sure how to use it. I have tried allocating memory but that did not help.

    Can someone provide inputs on this?
    I am new to C# and have only few hours worth of experience with it.

    ********************************************************

    /* Opaque function */
    typedef struct _Opaque_Func *Opaque_Func;


    // main function
    int
    main(int argc, char* argv[])
    {
    Opaque_Func abc = NULL;

    /* Function 1 */
    err = Function1 (&abc, &xyz);
    if (err) {
    fprintf(print error here);
    }

    /* Function2 */
    err = Function2(abc, 0);
    if (err) {
    fprintf(print error here);
    }
    }

    ********************************************************

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Instantiating and using Opaque struct in C Sharp

    You state that you want to do this in C#, but the code snippet you provided is in C++. So are you coding in C# or in C++?

  3. #3
    Join Date
    Jan 2014
    Posts
    3

    Re: Instantiating and using Opaque struct in C Sharp

    Quote Originally Posted by Arjay View Post
    You state that you want to do this in C#, but the code snippet you provided is in C++. So are you coding in C# or in C++?
    Hi Arjay,

    The snippet I provided is from C++ and I want to replicate that in C#.
    Basically I am trying to create a .NET DLL by writing wrappers around the C++ code.

  4. #4
    Join Date
    Jan 2014
    Posts
    3

    Re: Instantiating and using Opaque struct in C Sharp

    Hi Arjay,

    Yes the code snippet is from C++ and I want to mimic this in C#.
    I am the process of creating .NET DLL for teh C++ code by writing wrappers around it in C#.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured