views:

78

answers:

1

Background

My solution consists of two projects:

  1. A standard Windows application
  2. A DLL which my application does not use directly, but instead injects it into a target process

Basically, from my application's perspective, the only requirement that the DLL must meet is to be present in the working directory of my application. In short, my DLL doesn't export any functions that are of interest to my application.


Question

I would like to strongly couple these two binaries. What are my options aside from manually calling LoadLibrary in my application?

If this is too vague, please let me know.


Edit

Since no one seems to be "answering", I ended up doing what EFraim suggested (see comments).

I exported a dummy function from my DLL and added the DLL's generated *.lib file as an additional dependency in my application's linker property sheet. Now, at run-time, if the DLL's missing, Windows gives a nice error message and terminates execution. As an added bonus, the DLL image is also locked after successful IAT initialization; this prevents things like user deletion.

A: 

If you don't expect releasing dll and exe separately, you can add dll into your resourses and unpack it from there on startup.

Eugene