2

I have follow methods in Java:

public abstract int AMRecoveryModeDeviceSetAutoBoot(am_recovery_device paramam_recovery_device, byte paramByte);

public abstract int AMRecoveryModeDeviceReboot(am_recovery_device paramam_recovery_device);`

Both are imported from a DLL.

How to use it in C#.net?

I tried it with:

[DllImport(DLLPath, CallingConvention = CallingConvention.Cdecl)]
unsafe public extern static void AMRecoveryModeDeviceSetAutoBoot(AMRecoveryDevice device, byte paramByte);

It didn't throw an error, but nothing happens (the USB Device, a iPhone, should be restart, in the Java Application with these 2 lines it workes, here not.

1 Answer 1

2

There are many ways to do it. The way i like best is to use the extern keyword. This will allow you to create a wrapped class and simply reference the dll.

http://msdn.microsoft.com/en-us/library/e59b22c5(VS.80).aspx

Sign up to request clarification or add additional context in comments.

1 Comment

Do you have any control over the compiled third party dll? You may want to put some trace logs in there. Was the DLL even called? If it was called, did it have permissions issues? Also, did you try just putting in the name of the dll refrence instead of the complete path? How did you reference AMRecovery device exactly?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.