troubleshooting Question

Including header and accessing classes' effect on release exe’s performance and size in VC6

Avatar of bigsteve87
bigsteve87 asked on
System Programming
7 Comments1 Solution249 ViewsLast Modified:
I want some guidance on how to set up my classes to optimize my program’s speed and size.  I don’t really care about compile time.

My program has alot of large classes with large header files and most new classes I make need one or two functions from at least a dozen of the large classes.  
They are usually the same functions needed across the project.

For example:

class CMyApp : public CWinApp
  CString TempDirectory();
…(Tons of other functions)

A crapload of other classes need that TempDirectory() function, will it hurt the program’s performance to have “#include “MyApp.h” all over the place?

Should I add some intermediate files to provide access to these common functions?

For example:

CString TempDirectory();
…(a few other common functions)

“#include “MyApp.h”
CString TempDirectory(){
      return (CMyApp*)AfxGetApp()->TempDirectory();
Then just include “Directories.h” everywhere.

Any suggestions and explanations would be appreciated; the project is becoming a mess of header files.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros