450
« on: December 27, 2019, 08:21:35 AM »
i use the Api to control the mach by c# and its work ok
now want to improve and also write into the registry by the api
but i got error in c# while try to get the registry handle
the c# code:
[DllImport(@"C:\Mach4Hobby\Mach4IPC.dll", EntryPoint = "mcRegGetHandle")]
public static extern int mcRegGetHandle(int mlnst, string regname);
private void manualloading(object sender, RoutedEventArgs e)
{
int debug= mcRegGetHandle(0, "iRegs0/auto");
}
attach is the error from vs
System.AccessViolationException
HResult=0x80004003
Message=An attempt was made to read or write to protected memory. This condition usually indicates that another memory is defective.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>