Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to preface this by saying "I love my job and I want to stay here"

But I've got a serious problem,

  1. Circularly linked DLL's (DLL's linked back to the EXE)
  2. Special builds with conditional defines to get rid of the links when the EXE doesn't exist for using the DLL's in special utilities.
  3. Inability to reference our own DLL's as external functions because they throw errors when linked (have to use Windows LoadLibrary functions instead)

So... My question is, referencing the executable seems like a bad idea, but a necessary evil to get session information (this is a client/server application with multiple users). Is the best way around referencing the executable in it's called DLL's is to initialize the DLL's called by the executable with all the information it could ever possibly need to do its job?

share|improve this question
up vote 4 down vote accepted

If you need this data then it should be either

a) passed into the dlls (as you suggest), or

b) stored in a "global" dll from which you can reference it from other dlls.

Given you're talking about session information I'd go with the latter so that you only have to keep in up to date in one location. If you passed it into each dll when it got initialised then it would get out of date and you'd have no way of knowing this.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.