Categories
Mastering Development

Why is my application throwing an InvalidOperationException: Invalid Enum Type after command execution completes?

This exception is thrown at an unknown, but effectively immediate time after returning from a command that creates a window and waits for its exit through Window.ShowDialog. The exception thrown is: System.InvalidOperationException: “Unknown enum type.” with Stack Trace reported in the exception viewer as: at System.RuntimeType.IsEnumDefined(Object value) in f:\dd\ndp\clr\src\BCL\system\rttype.cs:line 4155 This is ostensibly not true… […]

Categories
Development

C# running foreign exe inside windows form

I’m trying to run discord.exe inside a windows form but im getting this error. Can someone help me, thanks. Here is the error message: These are my codes: [DllImport(“user32.dll”)] static extern IntPtr SetParent(IntPtr child, IntPtr newParent); [DllImport(“user32.dll”)] static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int Iparam); [DllImport(“user32.dll”)] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool […]

Categories
Development

CallbackOnCollectedDelegate detected

After few minutes of successfull running I get this error in my application. Asistente para la depuración administrada ‘CallbackOnCollectedDelegate’ Se realizó una devolución de llamada al delegado recolectado de tipo ‘Threads!Threads.Hud+NativeMethods+WinEventDelegate::Invoke’. Since I cant figure out which part of the code is in responsible for this issue, I’m posting the complete class here. (I guess […]