Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Calling method with SAFEARRAY(VARIANT) argument

Calling method with SAFEARRAY(VARIANT) argument

Scheduled Pinned Locked Moved C#
comdata-structuresquestion
1 Posts 1 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tcleveland
    wrote on last edited by
    #1

    I am having trouble calling a method on a COM object that takes a SAFEARRAY of VARIANTS as an argument. This array of values is really an array of strings but when the array is contructed like this: System.Array arr = new System.String[1] {"Some String"} it raises a "System.Runtime.InteropServices.SafeArrayTypeMismatchException" exception. When the array connstructed like this: System.Array arr = new System.Object[1] {"Some String"} it raises a "System.Runtime.InteropServices.COMException" exception saying that a referenced object is not found. The method I am trying to call is ICOMAdminCatalog.InstallMultipleComponents Any suggestions? Tony Cleveland

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups