Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Relevant parts of code of GFMAPI.NET for FMOpen and FMClose (www.netripper.nl)
- public enum ResultCode : int
- {
- Success = 0,
- InvalidParameter = 87,
- CallNotImplemented = 120,
- NotSupported = 50,
- BadUnit = 20,
- NotReady = 21,
- OpenFailed = 110,
- DeviceAlreadyAttached = 548,
- GenFailure = 31
- }
- // ...snip...
- private const string DLL = "GFMAPI.DLL";
- [DllImport(DLL, SetLastError = true)]
- public static extern IntPtr FMOpen(int FMDeviceIndex);
- [DllImport(DLL)]
- public static extern ResultCode FMClose(IntPtr FMDevice);
- // ...in the calling class when FMOpen is called (in my test app)...
- // Opening device
- FMDevice = GFMAPI.FMOpen(0);
- // Fetching device information
- TagFMDEVINFO devinfo = new TagFMDEVINFO();
- devinfo.Size = Marshal.SizeOf(devinfo);
- ResultCode rc = GFMAPI.FMGetDevInfo(0, ref devinfo);
- // Register window for notifications
- ResultCode result = GFMAPI.FMRegisterNotification(FMDevice, MessageWindow.Hwnd, GFMAPI.WM_FMNOTIFICATION);
- // ... in the calling class when FMClose is called...
- // Closing device
- ResultCode result = GFMAPI.FMClose(FMDevice);
Add Comment
Please, Sign In to add comment