Using blfwkdll from C# application

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using blfwkdll from C# application

Jump to solution
1,956 Views
kevinlfw
Contributor III

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

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,291 Views
kevinlfw
Contributor III

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.

View solution in original post

0 Kudos
2 Replies
1,291 Views
alexfeinman
Contributor III

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#.

0 Kudos
1,292 Views
kevinlfw
Contributor III

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.

0 Kudos