Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 3 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
add comment

Your Answer

 
discard

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.