[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: IBugTraqProvider2

From: Jan <jan.linnenkohl_at_googlemail.com>
Date: Sat, 18 Oct 2008 05:25:33 -0700 (PDT)

Hi,

may be, when you are generate a new interface, you can also add a
possibility for editing the parameter with the interface. This would
be a perfect extension for the TracExplorer provider and hopefully
others.

I mailed some time ago a suggestion for this:

http://groups.google.com/group/tortoisesvn-dev/browse_thread/thread/b7f8a7b4cbf5956c/66e9cc9e51666584?hl=en&lnk=gst&q=IBugTraqProvider#66e9cc9e51666584

By now a dialog opens up to edit the parameter, but the user has to
copy them by hand to the textbox. I think an extra button, optional
visible, with parameters getting in and out would be fine.

Thangs a lot!

Jan

On Oct 17, 11:36 am, Stefan Küng <tortoise..._at_gmail.com> wrote:
> Roger Lipscombe wrote:
> > Roger Lipscombe wrote:
> >> That C# interop was hand-crafted, so it might not actually be
> >> equivalent to what you'd get from using TLBIMP. Particularly, I'm not
> >> sure about deriving one interface from the other. I'll take a quick
> >> look at it today.
> > Ah. The reason it's hand-crafted is because MIDL and TLBIMP do strange
> > things with the HWND (see below), which make it hard to use from C#; I
> > had to change it to use an IntPtr. I've just created a TLB from the
> > source IDL and imported that using TLBIMP.
>
> > Loading that into "Reflector" gives me this:
>
> > [ComImport, InterfaceType((short) 1),
> > Guid("C5C85E31-2F9B-4916-A7BA-8E27D481EE83")]
> > public interface IBugTraqProvider2 : IBugTraqProvider
> > {
> >    [MethodImpl(MethodImplOptions.InternalCall,
> > MethodCodeType=MethodCodeType.Runtime)]
> >    bool ValidateParameters([In,
> > ComAliasName("BugTraqProviderLib.wireHWND")] ref _RemotableHandle
> > hParentWnd, [In, MarshalAs(UnmanagedType.BStr)] string parameters);
> >    [return: MarshalAs(UnmanagedType.BStr)]
> >    [MethodImpl(MethodImplOptions.InternalCall,
> > MethodCodeType=MethodCodeType.Runtime)]
> >    string GetLinkText([In, ComAliasName("BugTraqProviderLib.wireHWND")]
> > ref _RemotableHandle hParentWnd, [In, MarshalAs(UnmanagedType.BStr)]
> > string parameters);
> >    [return: MarshalAs(UnmanagedType.BStr)]
> >    [MethodImpl(MethodImplOptions.InternalCall,
> > MethodCodeType=MethodCodeType.Runtime)]
> >    string GetCommitMessage([In,
> > ComAliasName("BugTraqProviderLib.wireHWND")] ref _RemotableHandle
> > hParentWnd, [In, MarshalAs(UnmanagedType.BStr)] string parameters, [In,
> > MarshalAs(UnmanagedType.BStr)] string commonRoot, [In,
> > MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_BSTR)]
> > string[] pathList, [In, MarshalAs(UnmanagedType.BStr)] string
> > originalMessage);
> >    [return: MarshalAs(UnmanagedType.BStr)]
> >    [MethodImpl(MethodImplOptions.InternalCall,
> > MethodCodeType=MethodCodeType.Runtime)]
> >    string OnCommitFinished([In,
> > ComAliasName("BugTraqProviderLib.wireHWND")] ref _RemotableHandle
> > hParentWnd, [In, MarshalAs(UnmanagedType.BStr)] string commonRoot, [In,
> > MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_BSTR)]
> > string[] pathList, [In, MarshalAs(UnmanagedType.BStr)] string
> > logMessage, [In] uint revision);
> > }
>
> > ...so it looks like C# doesn't correctly handle deriving one COM
> > interface from the other.
>
> > Try this:
>
> >    [ComVisible(true),
> > InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
> > Guid("C5C85E31-2F9B-4916-A7BA-8E27D481EE83")]
> >    public interface IBugTraqProvider2 : IBugTraqProvider
> >    {
> >        [return: MarshalAs(UnmanagedType.VariantBool)]
> >        bool ValidateParameters(IntPtr hParentWnd,
> >            [MarshalAs(UnmanagedType.BStr)] string parameters);
>
> >        [return: MarshalAs(UnmanagedType.BStr)]
> >        string GetLinkText(IntPtr hParentWnd,
> >            [MarshalAs(UnmanagedType.BStr)] string parameters);
>
> >        [return: MarshalAs(UnmanagedType.BStr)]
> >        string GetCommitMessage(IntPtr hParentWnd,
> >            [MarshalAs(UnmanagedType.BStr)] string parameters,
> >            [MarshalAs(UnmanagedType.BStr)] string commonRoot,
> >            [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType =
> > VarEnum.VT_BSTR)] string[] pathList,
> >            [MarshalAs(UnmanagedType.BStr)] string originalMessage);
> >              [return: MarshalAs(UnmanagedType.BStr)]
> >        string OnCommitFinished(
> >            IntPtr hParentWnd,
> >            [MarshalAs(UnmanagedType.BStr)] string commonRoot,
> >            [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType =
> > VarEnum.VT_BSTR)] string[] pathList,
> >            [MarshalAs(UnmanagedType.BStr)] string logMessage,
> >            [MarshalAs(UnmanagedType.U4)] int revision);
> >    }
>
> > If that doesn't work, try it without the ": IBugTraqProvider"
>
> That was it!
> Thank you so much - I've really tried and just couldn't get this to work.
>
> Stefan
>
> --
>        ___
>   oo  // \\      "De Chelonian Mobile"
>  (_,\/ \_/ \     TortoiseSVN
>    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
>    /_/   \_\    http://tortoisesvn.net
>
>  signature.asc
> < 1KViewDownload

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_tortoisesvn.tigris.org
For additional commands, e-mail: dev-help_at_tortoisesvn.tigris.org
Received on 2008-10-18 14:26:30 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.