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. C++ Class Help!!!

C++ Class Help!!!

Scheduled Pinned Locked Moved C / C++ / MFC
c++javajavascriptcomtools
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.
  • C Offline
    C Offline
    calebcohoon
    wrote on last edited by
    #1

    Hello! I'm writing an activex control and I wondered how I could return a pointer to a class object back to a JavaScript Variable. I know that sounds really weird but I'll give you an example: Here's the java script: -------------------------------------------------------------------------------- 1: var testbox; 2: var variable = document.testcontrol; // this points to the active control <object idclass="blahblahblah" id="testcontrol"> 4: testbox = variable.CreateMsgBox(); 5: testbox.SetText("Hello Universe"); // im sick of "Hello World" lol <img src="images/smilies/smile.gif" border="0" alt=""> -------------------------------------------------------------------------------- Let me explain the above code. When the variable named "variable" calls the IDispatch method CreateMsgBox(), on line 4, I want it to return a pointer from the newly created class back to the variable "testbox". Then on line 5 I can access the class methods through the "testbox". Heres the pusedo code of the c++ code when one calls the CreateBox() function above. -------------------------------------------------------------------------------- CCreateBox CreateBox() { 1: CCreateBox newBox; // CCreateBox is the MsgBox class 2: return newBox; } -------------------------------------------------------------------------------- I hope anyone can understand this, and if anyone can help I’d greatly appreciate it!!!!!!!!!!!!! Thank You, Caleb </x-turndown>

    C B 2 Replies Last reply
    0
    • C calebcohoon

      Hello! I'm writing an activex control and I wondered how I could return a pointer to a class object back to a JavaScript Variable. I know that sounds really weird but I'll give you an example: Here's the java script: -------------------------------------------------------------------------------- 1: var testbox; 2: var variable = document.testcontrol; // this points to the active control <object idclass="blahblahblah" id="testcontrol"> 4: testbox = variable.CreateMsgBox(); 5: testbox.SetText("Hello Universe"); // im sick of "Hello World" lol <img src="images/smilies/smile.gif" border="0" alt=""> -------------------------------------------------------------------------------- Let me explain the above code. When the variable named "variable" calls the IDispatch method CreateMsgBox(), on line 4, I want it to return a pointer from the newly created class back to the variable "testbox". Then on line 5 I can access the class methods through the "testbox". Heres the pusedo code of the c++ code when one calls the CreateBox() function above. -------------------------------------------------------------------------------- CCreateBox CreateBox() { 1: CCreateBox newBox; // CCreateBox is the MsgBox class 2: return newBox; } -------------------------------------------------------------------------------- I hope anyone can understand this, and if anyone can help I’d greatly appreciate it!!!!!!!!!!!!! Thank You, Caleb </x-turndown>

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Not a chance in hell. Your COM component runs in a different process, and could even run on a different machine. How is the system going to marshall a class pointer for you ? Both client and server need to know about the class, in fact, you're basically talking about another COM component. Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002 Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002

      1 Reply Last reply
      0
      • C calebcohoon

        Hello! I'm writing an activex control and I wondered how I could return a pointer to a class object back to a JavaScript Variable. I know that sounds really weird but I'll give you an example: Here's the java script: -------------------------------------------------------------------------------- 1: var testbox; 2: var variable = document.testcontrol; // this points to the active control <object idclass="blahblahblah" id="testcontrol"> 4: testbox = variable.CreateMsgBox(); 5: testbox.SetText("Hello Universe"); // im sick of "Hello World" lol <img src="images/smilies/smile.gif" border="0" alt=""> -------------------------------------------------------------------------------- Let me explain the above code. When the variable named "variable" calls the IDispatch method CreateMsgBox(), on line 4, I want it to return a pointer from the newly created class back to the variable "testbox". Then on line 5 I can access the class methods through the "testbox". Heres the pusedo code of the c++ code when one calls the CreateBox() function above. -------------------------------------------------------------------------------- CCreateBox CreateBox() { 1: CCreateBox newBox; // CCreateBox is the MsgBox class 2: return newBox; } -------------------------------------------------------------------------------- I hope anyone can understand this, and if anyone can help I’d greatly appreciate it!!!!!!!!!!!!! Thank You, Caleb </x-turndown>

        B Offline
        B Offline
        Bill Wilson
        wrote on last edited by
        #3

        Dim Rs1 As New ADODB.Recordset Rs1 is a pointer to the Recordset interface of the ADODB object. I believe this is what you are asking for. If the control is already embedded in the document using an

        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