Relative Content

Tag Archive for c#c++.netcomwin32-process

Created COM object with .Net 8. It just works (TM) but I am struggling with deps.json and consuming with Native code

I have a .Net 4.72 DLL, exposed to COM using ComVisible(true) and the rest. I’ll put example in a sec. I have been modernizing this DLL to .Net 8. This DLL consumes some registered ocx files via Interops that are 32 bit, so I build the DLL always as x86. In .Net 4.72 you could use “Any CPU” for this. In .Net Core+ you have to explicitly target x86, which I think has to do with the comhost.dll that’s created now. This DLL is a bit of an abomination, consumed by an application that is entirely single threaded (PowerBuilder), so it is actually written as net8.0-windows with UseWindowsForms set to true to allow for a message pump so the UI doesn’t freeze entirely. Truly an old school Windows only application. And, it works. The PowerBuilder app is able to load the DLL just fine as I kept the GUID intact, as well as the ProgId.