Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9214533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:59:24+00:00 2026-06-18T01:59:24+00:00

we have a nasty (or maybe a trivial?) issue. There is a WPF control.

  • 0

we have a nasty (or maybe a trivial?) issue.

There is a WPF control. It has 2 interfaces, the main and one for automated testing purpose. Defined this way:

[ComVisible(true)]
[Guid("xxx")]
public interface IXXXXXTest
{
[DispId(1)]
    void Test1(int index);
}

[ComVisible(true)]
public interface IXXXXX
{
    void Main1(index);
}

[ComVisible(true)]
[Guid("xxx")]
ClassInterface(ClassInterfaceType.None)]
public partial class XXXXX_WPF_CONTROL : UserControl,
                         IXXXXX,
                         IXXXXXTest
{
     ...
}

Now we are trying to reach it from VBS.
Try 1)

Set Ctrl = GetControl(...)  <---- this is ok
Ctrl.Test1(0)  <---- Object doesn't support this property or method: 'Ctrl.Test1'

Set Ctrl = GetControl(...)  <---- this is ok
Ctrl.Main1(0)  <---- this is ok

So it works fine for the “main” interface but for the test interface.
This seems ok(?), because as far as I know VBS reaches the “main” interface only via IDispatch if there is no IDispatchEx. So I added a property to the IXXXXX to get the test interface.

[ComVisible(true)]
public interface IXXXXX
{
    void Main1(index);
    IXXXXXTest Test { get;}
}
....
public IXXXXXTest Test
{
    get {   return this as IXXXXXTest;  }
}

Great, so now I can reach this IXXXXTest interface via the “main” interface.
Try 2)

VBS:

Set Ctrl = GetControl(...)  <---- this is ok
Set CtrlTest = Ctrl.Test  <----- this is ok
CtrlTest.Test1(0)    <---- Object doesn't support this property or method: 'CtrlTest.Test1'

🙁

Note that, for an other .NET control of us the “Try1” works, without any trick!

So probably due to the WPF something different?
Also, changing the

ClassInterface(ClassInterfaceType.None)]

into anything else (AutoDispatch / AutoDual), or leaving it makes the WPF control unusable.

Besides that this is also how it should be by this article: Is it possible to package WPF window as COM Object

Do you have any idea what could be the problem?
Thank much in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:59:25+00:00Added an answer on June 18, 2026 at 1:59 am

    Scripting languages can only use the default interface on a class. You’ve got more than one so at least one of them will not be usable. And method names may be renamed if they conflict with other declarations. I’d assume you obfuscated the real names in your question so hard to diagnose such a renaming happening from what you posted.

    Best thing to do is to temporarily apply the [InterfaceType(ComInterfaceType.InterfaceIsDual)] attribute on your interface types. Which allows you to generate a type library with Tlbexp.exe which you can then view with the OleView.exe utility, File + View Typelib command. You’ll see the exact names of the methods and you’ll see which interface is the [default] one on the coclass. From there you should have little trouble modifying your declarations so they’ll work in a scripting language.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have encountered a rather nasty problem with the DataGridView control (Windows.Forms, .NET Framework
In my Satchmo project, I have a nasty bug where one of the rows
Fellas! I have one nasty page to parse but can't figure out how to
I'm sure this is an easy one for someone out there. I have a
I have this nasty rendering issue in IE9 only, IE8 & IE7 works fine
I have a pretty nasty error I can't get rid of. Here's the function
I have got a very nasty piece of code i would like to refactor
I have been looking for a way to get rid of the nasty black
They seem to be so nasty. I have a gridview, and the query it
Renting houses can be nasty so I need to automate it. Please, have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.