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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. parse object array as string

parse object array as string

Scheduled Pinned Locked Moved C#
helpcsharpc++comdata-structures
2 Posts 2 Posters 0 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.
  • V Offline
    V Offline
    vijay victory
    wrote on last edited by
    #1

    hi experts, I hav create a COM DLL using VC++6.0 application.which has a function :

    [id(13), helpstring("method LngGenSuggW")] HRESULT LngGenSuggW([in]BSTR pwIpIscii,[out]VARIANT *pawSuggArray);

    and my client application is in C# 2005. which is as follows:

    COM_INSPELLLib.ComInSpell objCom = new COM_INSPELLLib.ComInSpell();
    String sIpWord;
    object sSuggArray = new object() ;

    objCom.LngGenSuggW( sIpWord, out sSuggArray);

    and I got the sSuggArray with the answer return by COM DLL. which contains "3 strings" means string array. but the problem is object does not contain any method to get these string back. Is there any method or solution?? that converts or parse this object array sSuggArray into String array and so that I can use it for further procedure. please help me.. I try it.. but cant done.. waiting for ur valuable reply.. thanx & regards, Victory.Thumbs Up

    J 1 Reply Last reply
    0
    • V vijay victory

      hi experts, I hav create a COM DLL using VC++6.0 application.which has a function :

      [id(13), helpstring("method LngGenSuggW")] HRESULT LngGenSuggW([in]BSTR pwIpIscii,[out]VARIANT *pawSuggArray);

      and my client application is in C# 2005. which is as follows:

      COM_INSPELLLib.ComInSpell objCom = new COM_INSPELLLib.ComInSpell();
      String sIpWord;
      object sSuggArray = new object() ;

      objCom.LngGenSuggW( sIpWord, out sSuggArray);

      and I got the sSuggArray with the answer return by COM DLL. which contains "3 strings" means string array. but the problem is object does not contain any method to get these string back. Is there any method or solution?? that converts or parse this object array sSuggArray into String array and so that I can use it for further procedure. please help me.. I try it.. but cant done.. waiting for ur valuable reply.. thanx & regards, Victory.Thumbs Up

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      have you tried casting it directly?

      COM_INSPELLLib.ComInSpell objCom = new COM_INSPELLLib.ComInSpell();
      String sIpWord;
      object sSuggArray = new object() ;

      objCom.LngGenSuggW( sIpWord, out sSuggArray);
      string [] arr = (string[])sSuggArray;

      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