On 4/26/06, Foster, Richard - PAL <[EMAIL PROTECTED]> wrote:
> Ah... Perhaps I was a bit unclear. Are you still trying to do this in
> Nant? If so, I meant in VB6!

No problem; your advice gave me enough to figure out how to fix this!

> I also forgot another step:
>
> 2a) In your VB projects, you need to (temporarily) set the reference to
> the in-IDE project, not the built version of the library.

This is what I do when building from within the IDE. I still find it
incredible that you can't build a project group in one step,
considering how long VB6 has been going.

> I assume you are referring to the GUID part of the "Reference=" line?
> Again, this would be consistent with TransportX.DLL being a VB project
> that has been rebuilt outside the project group (solution) while not
> maintaining binary compatibility. I also assume from your subsequent
> message that you have now found the right GUID. Is that true?

That's right. Once I found a way to get the CLSID (it's a GUID, but
it's called CLSID) from the DLLs I had just built, I was able to get
this whole build working.

What I do now, for each DLL:

1. Check out from source control.
2. If this DLL depends on other DLLs which have just been built, fix
their references in the .vbp by extracting the CLSID, major and minor
versions from the DLLs.
3. Set .vbp file's compatibility to 'project' (value = 1)
4. Set name of compatibility file to empty ("") in .vbp
5. Build the DLL
6. Set .vbp file's compatibility to 'binary' (value = 2)
7. Replace name of compatibility file in .vbp
8. Rebuild the DLL

For the final EXE, which references all the DLLs I've built, I perform
steps 1 and 2, then build.

In the end I ditched my VB6 console app and used the typelib utilities here:

http://confluence.public.thoughtworks.org/display/CCNETCOMM/Tools+for+VB6

To build an interop wrapper for TLBINF32.DLL, as that page notes is
needed, I created a simple project in VS.NET and added a reference to
TLBINF32.DLL, then built the project. There's probably a command line
utility to do this somewhere.

I then had no idea how to get the compilation of the typelib code to
use the interop wrapper. I couldn't find any documentation on the nant
site relating to this, though perhaps it was on their wiki, which was
down when I looked.

After some guesswork, I tried copying the wrapper DLL into
nant-release-directory\bin and edited nant.exe.config, adding <include
name="interop.tli.dll" /> into <task-assemblies> inside <platform
name="win32" default="auto>. This worked!

I would have used the VB project building code which John Cole
provided, but my google search first turned up the typelib code and I
only found the rest later.

I will now have a look to see if I can use some of John's VB handling
code (thanks John!) as mine has a couple of problems:

1. The CLSID of all DLLs is updated, when it may not need to be (BC
may not have been broken). This may or may not be a problem for us.
2. All DLLs are built twice. This wastes about two minutes of build
time, so isn't such a problem.

Cheers,
Rik


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to