So, what is the "preferred" practice to do this? Is it to create the wrappers and store the wrapped component in source control to be pulled at build-time? Or is it to wrap at build-time?
<xsl:for-each select="../../References/Reference">
<xsl:choose>
<xsl:when test="@WrapperTool='tlbimp'">
<script language="C#">
<code>
[System.Runtime.InteropServices.DllImport( "oleaut32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, PreserveSig = false,SetLastError=true )]
private static extern void QueryPathOfRegTypeLib( ref Guid guid, Int16 wVerMajor, Int16 wVerMinor, Int32 lcid, [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.VBByRefStr)] ref StringBuilder lpbstrPathName);
public static void ScriptMain(Project project)
{
try
{
StringBuilder pathResult = new StringBuilder(1024); Guid g = new Guid("<xsl:value-of select="@Guid" />");
QueryPathOfRegTypeLib(ref g,
<xsl:value-of select="@VersionMajor" />,
<xsl:value-of select="@VersionMinor" />,
<xsl:value-of select="@Lcid" />,
ref pathResult);
project.Properties["<xsl:value-of select="@Name" />.path"] = pathResult.ToString();
}
catch (Exception e)
{
throw e;
}
}
</code>
</script>
<tlbimp output="${{config.binary.dir}}/[EMAIL PROTECTED]" typelib="[EMAIL PROTECTED]" keyfile="src\RR.snk" /> </xsl:when>
... And so on
Is there a better way to find the path for the COM object to be wrapped?
Is this a good way to do this?
Thanks,
Evan A. Bonnett
Reynolds and Reynolds, IT
ERA Integrated Desking Development
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Bert Jan Lappenschaar
Sent: Tuesday, August 17, 2004 8:28 AM
To: Ian MacLean; Gert Driesen
Cc: [EMAIL PROTECTED]
Subject: RE: [Nant-users] references to interop dll's
Thanks. I created new wrapper DLL's using the AXIMP tool. These do have the names that Nant expects. I don't know how the old wrapper DLLs were created. The developers who programmed the app have left the company so I can't ask. Let's forget about it.
Bert-Jan
-----Oorspronkelijk bericht-----
Van: Ian MacLean [mailto:[EMAIL PROTECTED]]
Verzonden: dinsdag 17 augustus 2004 9:00
Aan: Gert Driesen
CC: Bert Jan Lappenschaar; [EMAIL PROTECTED]
Onderwerp: Re: [Nant-users] references to interop dll's
>
>
> ----- Original Message ----- From: "Bert Jan Lappenschaar"
> <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, August 16, 2004 3:26 PM
> Subject: [Nant-users] references to interop dll's
>
>
> I am running into the following problem:
>
>
> I use a nant script that has produces an exe. It has a references to
> Interop.TGXLib.dll and AxInterop.TGXLib.dll (wrapper dll's).
>
> Everything compiles fine.
>
> Now, when I run the program I just compiled, it is looking for dll's
> TGXLib.dll and AxTGXLib.dll, but it can't find them because these
names
> are wrong, it should look for Interop.TGXLib.dll and
> AxIntererop.TGXLib.dll.
>
>
no - this is incorrect. the interop dlls are wrappers for the
non-interop ones. You need both to be available at runtime. The interop
ones should be in the same directory as you app ( or somewhere loadable
by .net ) while the com dlls ( TGXLib.dll and AxTGXLib.dll ) will need
to be registered using regsvr32 or some other com registration method.
>
>
> If I rename my interop dll's to TGXLib.dll and AxTGXLib.dll,
everything
> works fine.
>
I find that very surprising - if they are true interp dlls. I think as
Gert said, you had better package up a sample.
> So the names of the references in the exe are wrong. The part
'interop.'
> has dropped off.
Ian
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users