Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating DLL Compilation

Status
Not open for further replies.

mmilan

Programmer
Jan 22, 2002
839
GB
The project I am involved with at work relies heavily on about 40 DLLs (which we have also written), and a number of these dlls are dependent upon each other. For example, the DLL that handles all our stock taking is dependent on the DLL that deals with Data Access, as is the main program, as is the employees DLL, as is... And so on and so forth...

Sticking with the example of Data Access, we have a number of seperate classes that expose records on particular tables, which means that when someone changes the design of one of these tables (read FREQUENT and OFTEN...) we end up having to recompile the Data Access, which then means recompiling the StockTaking, and the employees, and the...

What I want to do is to write a program that looks at a folder full of vbp shortcuts. It should then examine these projects to determine which DLLs depend on which others, and then recompile every DLL but in an appropriate order (as defined by dependencies).

I can already hear some of you saying "just recompile what has changed, and version compatibility will do the rest..." - but for some reason we do keep hitting problems with version compatability. I also want to do other things like incrementing the version numbers, copying the new DLL to a history folder with the version tagged on the end of the DLL file name - registering DLLs as I go - all kind of things...

So I'm throwing this open for anyone who has any ideas - at the moment I'm thinking this is perhaps going to end up as a VBADDIN, but I'm no further forward really...

Something else to consider is that we do know (through manual inspection) which Dlls depend on which others. I've been wondering down the Linux road of late, so I was wondering if it would be possible to use a Make file for this kind of thing...

Let me know what you think anyway...

mmilan
 
What I would do is create a simple .cmd (or .bat file) to automate your builds.

You would manually have to determine your dependencies (sorry, it's not magic!), but then you would call the VB6.exe in your batch file with the arguments needed to make your projects.

In case no one has seen this, change to your VB6 directory and run it from a command line like so:
Code:
C:\Program Files\Microsoft Visual Studio\VB98>vb6 /?
You'll then get a popup that shows you all the options available.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Cheers for the tip chip!

I had considered that.

Of course, there's always the question of what happens if errors are produced.

I'll give it some thought...

mmilan


 
You can redirect the output with the ">>" function, which will append to a file.

Once you have this compilation output, you can then use the FIND command to look for keywords such as "Error" in it, to determine if the compilation was successful. Or use a grep tool, which is much more powerful, but doesn't come with the OS. Search for "command redirection" in windows help.

Another way would be to use the && operator, which executes the second command only if the first one returned a 0 return status. Search for "command shell overview" in windows help.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
When I get home this evening, you're having a star you are...

(Scripting problems with IE...)

mmilan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top