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 / C++ / MFC
  4. Return Values, No Pointers

Return Values, No Pointers

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionjavascriptcomsysadmin
5 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.
  • J Offline
    J Offline
    Josh Koppang
    wrote on last edited by
    #1

    I have a web-device that is running Windows CE 3.0 embedded. I've made a small webserver like application that allows me to type in it's IP address and view the webpages that I have set up on it. I'm using a COM wrapper to wrap the low level C code. I instantiate the COM object with server side JavaScript (because there is no support for ASP), and perform the operations on the machine through the COM object. Finally... Here's the problem: Whenever I call the functions to interact with the machine, the result I always get is 0 (S_OK). Even though I specify one of the parameters as [out, retval]. How do I call COM methods, that you usually pass a pointer to, from JavaScript and ASP, that do not have pointers? Any help would be appreciated. There's a fine line between confidence and arrogance.

    N L 2 Replies Last reply
    0
    • J Josh Koppang

      I have a web-device that is running Windows CE 3.0 embedded. I've made a small webserver like application that allows me to type in it's IP address and view the webpages that I have set up on it. I'm using a COM wrapper to wrap the low level C code. I instantiate the COM object with server side JavaScript (because there is no support for ASP), and perform the operations on the machine through the COM object. Finally... Here's the problem: Whenever I call the functions to interact with the machine, the result I always get is 0 (S_OK). Even though I specify one of the parameters as [out, retval]. How do I call COM methods, that you usually pass a pointer to, from JavaScript and ASP, that do not have pointers? Any help would be appreciated. There's a fine line between confidence and arrogance.

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      joshkoppang wrote: How do I call COM methods, that you usually pass a pointer to, from JavaScript and ASP, that do not have pointers? Dunno about JavScript, but in ASP you can pass arguments ByRef. Same as in Client side VBScript Nish Nish was here, now Nish has gone; He left his soul, to turn you on; Those who knew Nish, knew him well; Those who didn't, can go to hell. I like to :jig: on the Code Project Sonork ID 100.9786 voidmain www.busterboy.org

      J 1 Reply Last reply
      0
      • N Nish Nishant

        joshkoppang wrote: How do I call COM methods, that you usually pass a pointer to, from JavaScript and ASP, that do not have pointers? Dunno about JavScript, but in ASP you can pass arguments ByRef. Same as in Client side VBScript Nish Nish was here, now Nish has gone; He left his soul, to turn you on; Those who knew Nish, knew him well; Those who didn't, can go to hell. I like to :jig: on the Code Project Sonork ID 100.9786 voidmain www.busterboy.org

        J Offline
        J Offline
        Josh Koppang
        wrote on last edited by
        #3

        Nish [BusterBoy] wrote: Dunno about JavScript, but in ASP you can pass arguments ByRef. Same as in Client side VBScript How? There's a fine line between confidence and arrogance.

        1 Reply Last reply
        0
        • J Josh Koppang

          I have a web-device that is running Windows CE 3.0 embedded. I've made a small webserver like application that allows me to type in it's IP address and view the webpages that I have set up on it. I'm using a COM wrapper to wrap the low level C code. I instantiate the COM object with server side JavaScript (because there is no support for ASP), and perform the operations on the machine through the COM object. Finally... Here's the problem: Whenever I call the functions to interact with the machine, the result I always get is 0 (S_OK). Even though I specify one of the parameters as [out, retval]. How do I call COM methods, that you usually pass a pointer to, from JavaScript and ASP, that do not have pointers? Any help would be appreciated. There's a fine line between confidence and arrogance.

          L Offline
          L Offline
          Le centriste
          wrote on last edited by
          #4

          C++

          BSTR bsOutRetval;
          HRESULT hr = myCOMObj->SomeMethod(&bsOutRetval);
          ....
          SysFreeString(bsOutRetval);

          VB

          Dim sOutRetval As String
          sOutRetval = myCOMObj.SomeMethod();

          If you don't grab it, I can explain more. Michel

          L 1 Reply Last reply
          0
          • L Le centriste

            C++

            BSTR bsOutRetval;
            HRESULT hr = myCOMObj->SomeMethod(&bsOutRetval);
            ....
            SysFreeString(bsOutRetval);

            VB

            Dim sOutRetval As String
            sOutRetval = myCOMObj.SomeMethod();

            If you don't grab it, I can explain more. Michel

            L Offline
            L Offline
            Le centriste
            wrote on last edited by
            #5

            DAMN, I misread the article. Again! Sorry buddy X|

            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