开发者

how to reference a .net coded library in a MFC dialog-based project

开发者 https://www.devze.com 2023-03-07 17:39 出处:网络
I want to use Html Agility Pack which is in a .NET code library. Anyone knows how to 开发者_高级运维import/reference the dll file into my vc++ MFC project?

I want to use Html Agility Pack which is in a .NET code library. Anyone knows how to 开发者_高级运维import/reference the dll file into my vc++ MFC project?

I tried right clicking on my project, choose "References...", then I click the "Add new Reference" button, and I get an empty dialog box with a single tab "Projects" which contains an empty list.


You can't call .Net code directly from unmanaged native code. You have several options if you want to do this indirectly though:

  1. Convert your MFC project to be mixed-mode
  2. Add an intermediate façade assembly
  3. Expose htmlagilitypack via COM (if you have access) and call it via COM interop

You need to provide more context if you want a recommendation on which approach might suit your circumstances best

0

精彩评论

暂无评论...
验证码 换一张
取 消