How Can i load third party .dll (COM DLL) in ATL A

2019-07-26 05:48发布

问题:

I got the answer and need to understand the following :

I have a WinCe 5.0 ATL application. This application is using third party COM dll and 3rd party application(.exe).As per my understanding on WinCE and Dll loading is as following:

WinCE:

All the dll exported functions should be written in ".Def" file and the dll that need to included during runtime image process should be there in ".bib" file.And one should call DLLExport or loadlibrary (i do not want to go into deep how to use these), to load the DLL.

But in My case: There is no .def file related to the third party dll and .bib file is there, but, the path of the .dll is commented in the file(My code is building successfully and i'm able to make runtime image).

Along with this one more additional file i got : That is, .cfg (i think configuration file) and in that it is written "SERVICE name.dll (for example, this is the 3rd party dll name)".I'm able to see the exported function by using "Dll Export Viewer (a free tool)" but not able to find the use of (calling of) the exported functions from the application.

Can i write .cfg file and include the dll that will be used by application? Can any one pls help me to understand all these??

Thanks in Advance...


回答1:

I'm not 100% certain I understand the question, so I'll paraphrase what I think you're asking:

  • You have an ATL application and a COM library that it uses built for Windows CE.
  • These items are provided by a third-party, so you don't have source code
  • You want to integrate these items directly into a CE OS build

If my understanding is correct, then the answer is:

Yes, you can do this. What you need to do is:

  1. Add the binary files (EXE and DLL) to the OS image. This is done by adding them to your BIB file (PLATFORM.BIB or PROJECT.BIB). They could be in either the MODULES or FILES section.
  2. Add the requisite registry entries for the COM objects to the platform by adding the entries into your REG file (PLATFORM.REG or PROJECT.REG).

If you don't have the entries for #2, then do the following:

  1. Use Remote Registry Editor to export the entire registry for a device without your COM library installed
  2. Put the COM object onto that device
  3. Call the DllRegisterServer entry point on the COM object (regsvrce or however)
  4. Use Remote Registry Editor to export the entire registry for the device again
  5. Diff the two reg files. The new entries are the ones you need to put in your REG file