I am trying to get a struct from a function in a DLL, but I always get zero.

The below code always leaves the struct with 0 as the value for each
parameter in the struct though the equivalent C code populates the values.

Does anyone see what I am missing?

Thanks,
-Mont

Here is what I have:

C definitions:

typedef struct {
   uint32_t    majorErrorNo;
   uint32_t    minorErrorNo;
   uint32_t    sysErrorNo;
} FlxActError;

   void flxActCommonHandleGetError(FlxActHandle handle, FlxActError *err);


   public struct ActivationError
   {
       public uint majorError;
       public uint minorErrorNo;
       public uint systemErrorNo;
   }


C# definition and function call:

       [DllImport("mydll.dll", CharSet = CharSet.Ansi)]
       private static extern void flxActCommonHandleGetError(handle, out
ActivationError error);

       public ActivationError GetLastError()
       {
           ActivationError error;

           flxActCommonHandleGetError(Handle, out error);

           return error;
       }

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to