PDA

View Full Version : Automating the hassle of building VB project tree


Shawn
01-09-2004, 09:38 AM
I recently had a need to automate the process of building a hierarchy of dependant Visual Basic projects, most of which were ActiveX dll's or controls. Anyone who has ever dealt with VB in such a situation knows that this can be pure hell if binary compatibility gets out of whack. It was beginning to cost my development team substantial amounts of wasted time and effort keeping these binary compatibility issues straight.

To deal with this problem, I sat down and wrote a series of custom build steps and a library of objects that I used in these custom build steps. I also wrote some global subroutines in Visual Build Pro. With this, I was able to completely automate the building of my VB project tree, regardless of whether binary compatibility was in synch or not. It has turned out to be a great time saver. So I thought I'd offer it to other VBP users who may still be doing VB COM development. This package is available by clicking here (http://www.sunergeosystems.com/Vbp_vb6.zip).

To use this package, you'll need to unzip the files to a directory on your hard drive. You'll need to run RegSvr32 on CdsiXUtils.dll, CdsiComUtils.dll, and VbBuildUtils.dll. Once you've done that, you'll need to copy the custom steps and macros from the VisBuildPro.steps and VisBuildPro.macros files into your global build steps and macros files.

Next, you need to register the custom steps with VBP. I've provided a custom step that does that, and the included sample BLD file demonstrates how to do it.

Finally, you'll need to call the subroutine to build your VB project. Again, the included BLD file demonstrates how to do that. I've included a sample project tree containing 5 VB projects that are dependant on one another for binary compatibility. If you break compatibility on one of them (remove a method/change parameters/etc.), this automated process should deal with it for you.

Let me know if you have any trouble with it - it's a pretty complicated process and probably has some issues specific to our build environment.

Sotorin
01-13-2004, 11:59 AM
I just tried running your project and:
- When you say " ... copy the custom steps and macros from the VisBuildPro.steps and VisBuildPro.macros files into your global build steps and macros files." where exactly is this? Are you referring to a root directory or actual files. Which one is global macro file, what's the name of it? I just copied your files into the root directory of my VBPro installation dir.
- when I run RegisterCustomSteps I kept getting errors. "Failed to open 'C:\Program Files\VisBuildPro\Build Options Action.action': The system cannot find the file specified." I changed the path from what it was in your project to something that reflected my installation layout.

What am I doing wrong?

Shawn
01-13-2004, 01:53 PM
VBP has 4 global files called VisBuildPro.config, VisBuildPro.macros, VisBuildPro.Global.scripts, and VisBuildPro.steps. The location for these files is specified by selecting the Tools->File Locations menu from within the VBP main program window. These are XML files, and are pretty self-explanatory as to their layout. I have included the .steps and .macros files in this zip because there are custom global build steps and macros that the solution uses.

As for the other problem, that was an oversight on my part. I failed to include the .action files that this custom build step requires to register the steps with VBP. I've updated the zip file to include these, so you can get the updated one from the same link that you got the original one. Just copy the .action files into the same location where you copied the other files. You may need to change the filename field for the steps under the RegisterCustomSteps subroutine, as I think they are currently pointing to a specific location on my system.

Thanks for trying this out. I hoped it would be useful to someone else. Let me know if you have any more trouble.

Sotorin
01-14-2004, 11:54 AM
Do any of these DLL's included in your project, reference something that's not standard on NT Server? I keep getting "ActiveX component can't create object" whenever I'm trying to execute BuildVbProject -> Retrieve current project settings subroutine. No matter what I try I keep getting the same error. I've register and unregister your DLLs multiple times unfortunately to no avail.
Can you think of anything I can try?

Sotorin
01-14-2004, 12:27 PM
I have another box running XP and I reinstalled the whole thing from the scratch. Everything was smooth until, again, I tried to compile the first VB project, I got to "Retrieve current project settings" and it failed w/ msg "Application-defined or object-defined error"

VBPbetaTest
03-09-2004, 10:36 AM
Shawn,

Like Sotorin, I can't 'create the automation object'.

That's really pity cause your work seems to be really interesting and usefull.

Could you give us more information about your dlls?

Or if it is to tough job to comment your binaries, just zip your code source.

Thanks anyway for your job

Shawn
03-09-2004, 10:52 AM
Dear Sotorin and VBPBetaTest,

I am sorry about the difficulties you guys are having. I probably should not have posted this until I had a good way to deploy it to other environments. I will try to spend a little time this week to put together a setup executable. I need to do that for the in-house guys anyway. Thanks for your patience.

Shawn

JFoust
06-08-2005, 12:03 PM
Has any more work been done on this?

When I try to edit the properties of one of the VBProj actions I am getting an "Error initializing action's custom UI components: The system cannot file the file specified." I think this is because I am running Windows 2000 and your dll seems to be trying to open uxtheme.dll.

I also get an error saying "Error loading info for custom action 'VBProjGetInfo': The system cannot find the file specified." when I try to run it. I am not seeing any file access to uxtheme.dll, but I'm not seeing any other failed file accesses either, so I'm not sure what is going on.

Thanks,
Josha Foust

JFoust
06-08-2005, 01:13 PM
Ok, I got past those problems, they were mostly directory issues. Now I am also getting the "can't create object" error.

Josha Foust

kevina
06-08-2005, 01:25 PM
I haven't looked at this in any detail, but if you are receiving a "Can't create object" type error, you may simply need to register the different dll's installed with this package with regsrv32.exe... Of course this is only speculation.

JFoust
06-08-2005, 02:53 PM
I did that and it looks like the other people in the thread that had the same problem also registered the DLLs.

zisco
09-26-2006, 07:52 AM
Hello shawn, the link you've provided is outdated - could you please provide a new, working one?