5

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?

Peter Turner
  • 6,897
  • 1
  • 33
  • 57

1 Answers1

4

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.

ChrisF
  • 38,878
  • 11
  • 125
  • 168