Please bear with me, as the description of the problem is fairly involved :)
I've got a strange issue when I am calling a function in an MFC C DLL declared with a DllImport from a .Net user control.
When I display the user control in a standalone application it works fine. I have migrated the component to our main product, which launches a new process, dynamically loads the assembly containing my user control (loading using the Assembly.Load passing
in the bytes), hosts the component on a windows forms and displays it.
When run in this context, the first time one of the DLLs methods is called I get a message box saying "<PATH>\<COMPONENT_FULL_TYPE_NAME> was not found" where <PATH> is the root path of the application that initially lauched the process
(in our cases this is two processes down Launcher -> Application -> Hosting Process). <COMPONENT_FULL_TYPE_NAME> is the name of the .Net user control that is calling the method in the DLL). The same behavior occurs if I try to load
the DLL using LoadLibrary. It doesn't occur with other DLLs I call or load in a similar way.
This had me scratching my head for a while until I started ProcessExplorer (ex-sysinternal thing) and it showed that when the LoadLibrary is called then a read is attempted for this file it is complaini
View Complete Post