I plan on using PInvoke in my C#.NET application to call methods in the blfwkdll.dll. The end goal is to integrate the most basically functionality of the KinetisFlashTool into the C# application.
I've come here to ask if the PInvoke signatures are already known and can be provided, or/and if a C# app has been created that demonstrates using PInvoke to call blfwkdll.dll. It would end up saving a lot of time if this information was easily available.
Additionally, since we'll be using the blfwkdll.dll in our C# project, can you tell me, in short, what I need to include with my application when it is deployed? Do I just need to provide a license.txt, or are there other requirements that need to be met as well.
Thanks,
Kevin
Solved! Go to Solution.
I changed the blfwkdll.dll source code to encapsulate all the state/object information into a single function which performs the tasks, like flashing firmware, with one call. I used depends.exe to determine what the mangled names of the functions were and call the methods using P/Invoke. Even the progress callback works well and have not run into any issues.
If one doesn't want to edit blfwkdll source, then they can write a C++/CLI library that will allow you do to things like create an instance of an object and call its functions.
blfwkdll.dll has C++ interface. Usually P/Invoke requires C interface because C++ interface uses mangled names and class invocations. Basically, you are not going to get anywhere with this unless you write a pure C wrapper first or use managed C++ instead of C#.
I changed the blfwkdll.dll source code to encapsulate all the state/object information into a single function which performs the tasks, like flashing firmware, with one call. I used depends.exe to determine what the mangled names of the functions were and call the methods using P/Invoke. Even the progress callback works well and have not run into any issues.
If one doesn't want to edit blfwkdll source, then they can write a C++/CLI library that will allow you do to things like create an instance of an object and call its functions.