Advertisement

07.08.2008 at 06:17PM PDT, ID: 23548853
[x]
Attachment Details

How do I retrieve the return value from a out IntPtr type of variable?

Asked by lapucca in C# Programming Language, C++ Programming Language

Tags: C#, C++, VS2005, .net 2

Hi, I'm calling C++ function from a C# windows application.  The DllImport declaration is at
http://www.pinvoke.net/default.aspx/ntdsapi/DsCrackNames.html

ONe of the function is decared as:
[DllImport("ntdsapi.dll", CharSet=CharSet.Auto, SetLastError = false)]
static public extern uint DsCrackNames(
      IntPtr hDS,
      DS_NAME_FLAGS flags,
      DS_NAME_FORMAT formatOffered,
      DS_NAME_FORMAT formatDesired,
      uint cNames,
    [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 4)]
        string[] rpNames,      
      string[] rpNames,
      out IntPtr ppResult  // PDS_NAME_RESULT
      );

1.  How do I get the result returned in ppResult?
2.  I tried testing calling this funciton and assign the function result to a unit variable but am not able to read its value in Debug.  How can I tell if the function returns No_Error?
Thank you.Start Free Trial
[+][-]07.08.2008 at 06:34PM PDT, ID: 21959946

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, C++ Programming Language
Tags: C#, C++, VS2005, .net 2
Sign Up Now!
Solution Provided By: jaime_olivares
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628