Using blfwkdll from C# application

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using blfwkdll from C# application

ソリューションへジャンプ
3,235件の閲覧回数
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

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
2,570件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
2,570件の閲覧回数
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 件の賞賛
返信
2,571件の閲覧回数
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 件の賞賛
返信