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. COM
  4. parse object array into string....

parse object array into string....

Scheduled Pinned Locked Moved COM
helpcsharpc++comdata-structures
3 Posts 3 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.:thumbsup:

    M F 2 Replies 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.:thumbsup:

      M Offline
      M Offline
      Mike the Red
      wrote on last edited by
      #2

      If you know you're going to return 3 strings, why not just return an array of BSTRs, instead of VARIANT ?

      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.:thumbsup:

        F Offline
        F Offline
        frx96
        wrote on last edited by
        #3

        1.Modify like this: [out] BSTR* pawSuggArray 2. "SAFEARRAY" maybe also can do this.

        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