how to reference a .net coded library in a MFC dialog-based 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:
- Convert your MFC project to be mixed-mode
- Add an intermediate façade assembly
- 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
精彩评论