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

  • SEARCH
  • Home
  • 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 920491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:43:24+00:00 2026-05-15T18:43:24+00:00

I have COM object with few constructors, I’m trying to create new instance and

  • 0

I have COM object with few constructors, I’m trying to create new instance and passing parameters to the constructor using powershell 2.0. But I’m getting this error: Parameter set cannot be resolved using the specified named parameters.

This is the code:

$paramsInfo = New-Object -ComObject 'MyObject.ObjectA' 
$comObj = New-Object -ComObject 'MyObject.ObjectB'  -ArgumentList  $paramsInfo

This code doesn’t work!!!
Any help?

  • 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-05-15T18:43:25+00:00Added an answer on May 15, 2026 at 6:43 pm

    COM has no concept of a constructor. It follows a hyper-pure interfaced-based programming style, implementation is always hidden and you only ever work with interfaces. Interfaces are very easy to make portable across language runtimes, implementation never is. Lots of languages that implement COM have no notion of a constructor, it is an OOP concept.

    COM objects are created with the CoCreateInstance() API function, the standard factory method for COM objects. It has no way to pass any kind of arguments to the real class factory that it could use to pass arguments to the constructor. The real factory is the IClassFactory interface implementation, hyper-pure style.

    While many languages support making their classes visible to COM clients (like .NET’s [ComVisible] attribute), only their parameter-less constructor will ever be called. Necessarily so.

    If you need a factory method that takes arguments then just write your own. Implement your own factory interface. No restrictions on the arguments you can pass to its Create() method, how you pass them to the constructor is an invisible implementation detail 🙂

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

Sidebar

Related Questions

I have a COM object that I'm trying to use from C++ (not .NET),
I have really simple few lines of Facebook app, using the new Facebook API:
We have a number of classic ASP websites using a VB6 DLL (COM) object
If I have a mail object, eg: mail = Mail.new do from jim@gmail.com to
I have a Com Object, setup/create/working from a DataModule. creating/running/freeing the Datamodule from an
I have a COM object (C#, visual studio) with a function that takes a
For ex. i have c# COM object with such function: int GetString([In, Out, MarshalAs(UnmanagedType.LPStr)]ref
I have an unmanaged COM object, and I would like to call it from
I have a native Visual C++ COM object and I need to make it
Suppose I have an Anti-XML object, e.g.: import com.codecommit.antixml._ val child = <child attr=val>...</child>.convert

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.