hello
i'm building an application in visual studio c# to work with a device.
at some point i have my device handle in an intptr variable.
then i have another process that needs to use the same handle.
the way i passed this information was by doing this in the primary app:
IntPtr h = ;//"the function that returns the device handle"
ProcessStartInfo p = new ProcessStartInfo("otherapp.exe", h.ToString());
Process.Start(p);
and in the other app i catch the string parameter and then do this:
IntPtr h = new IntPtr(Int32.Parse(args[0]));
so far everything works but when i try to use the new handle in the second app it throws an error:
trying to access protected memory
can someone help me please????
What I have tried:
the way i passed this information was by doing this in the primary app:
IntPtr h = ;
ProcessStartInfo p = new ProcessStartInfo("otherapp.exe", h.ToString());
Process.Start(p);
and in the other app i catch the string parameter and then do this:
IntPtr h = new IntPtr(Int32.Parse(args[0]));
so far everything works but when i try to use the new handle in the second app it throws an error:
trying to access protected memory