Example #1
0
        public static bool GetLastError(CBase AInstance, out String AErrorMessage)
        {
            Byte   resultHasError     = 0;
            UInt32 sizeErrorMessage   = 0;
            UInt32 neededErrorMessage = 0;

            CheckError(Internal.LibAMCFWrapper.GetLastError(AInstance.GetHandle(), sizeErrorMessage, out neededErrorMessage, IntPtr.Zero, out resultHasError));
            sizeErrorMessage = neededErrorMessage;
            byte[]   bytesErrorMessage = new byte[sizeErrorMessage];
            GCHandle dataErrorMessage  = GCHandle.Alloc(bytesErrorMessage, GCHandleType.Pinned);

            CheckError(Internal.LibAMCFWrapper.GetLastError(AInstance.GetHandle(), sizeErrorMessage, out neededErrorMessage, dataErrorMessage.AddrOfPinnedObject(), out resultHasError));
            dataErrorMessage.Free();
            AErrorMessage = Encoding.UTF8.GetString(bytesErrorMessage).TrimEnd(char.MinValue);
            return(resultHasError != 0);
        }
Example #2
0
 public static void AcquireInstance(CBase AInstance)
 {
     CheckError(Internal.LibAMCFWrapper.AcquireInstance(AInstance.GetHandle()));
 }