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 6471701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:15:18+00:00 2026-05-25T06:15:18+00:00

I am able to call a COM interface method using SAFEARRAY(BSTR) as input. If

  • 0

I am able to call a COM interface method using SAFEARRAY(BSTR) as input. If I define instead a simple (containing only some BSTR-s fields) STRUCT to pass into the COM I get
“[System.ArgumentException] = {“The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))”

The call to my COM server is not made because as it seems the arguments from client does not match the expected arguments on server: E_INVALIDARG

Here is my declaration in IDL:

typedef enum UserEntityType
{
    User,
    Group,
    IPAddress
} UserEntityType;

[
    uuid(4786F77E-BA5F-4806-B224-12AA8601A5B1)
]
typedef struct UserEntity
{
    UserEntityType      EntityType;
    BSTR                Value;
} UserEntity;

[id(9)]          HRESULT SetUsers([in] SAFEARRAY(UserEntity) input);

The exception is thrown at run-time when a C# 4 client calls SetUsers().

  • 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-25T06:15:19+00:00Added an answer on May 25, 2026 at 6:15 am

    The problem was in the C# client that was using the exe COM server where

    SetUsers([in] SAFEARRAY(UserEntity) input)
    

    was defined.
    In order to fix this (at least for .NET 4.0) one has to change the following property of the imported COM server: Embed Interop Types = False

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

Sidebar

Related Questions

I'd like to be able to call getProgram on objects which have that method,
I have couple questions regarding some C++ rules. Why am I able to call
I want to be able to make an HTTP call updating some select boxes
hey guys, I have mypage.com/user-login.php?action=register and I want to be able to call mypage.com/register
I'd like to be able to call a function exposed by a VSTO addin
My goal is to be able to call functions that are inside my JQuery
Summary I want to be able to call a JavaScript function from a Flex
Doesn't value have to return toString() to be able to call value.toString()? When do
I am able to successfully call a function with ctypes in Python. I now
I need to call unmanaged COM code from C#.NET. By loading unmanaged COM Type

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.