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. a strange problemo..

a strange problemo..

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 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.
  • S Offline
    S Offline
    safee ullah
    wrote on last edited by
    #1

    hi there.. thanks for your time firstly.. i am having a strange problem in the invoke of my IDispatch.. This method is called from the get property of an aX control. When i call this get method, i dont seem to get any return vaule in the pvarresult variable.. any suggestions.. here is the method: double CControl:: GetNumber(long nRow, long nCol) { DISPPARAMS DispParam1; EXCEPINFO excep; UINT nArgErr; VARIANT pVarResult; double temp; DispParam1.cArgs = 2; //number of arguments DispParam1.cNamedArgs = 0;// Number of named arguments. DispParam1.rgvarg = new VARIANTARG[2]; DispParam1.rgvarg->vt = VT_ARRAY; DispParam1.rgvarg[1].vt = VT_I4; DispParam1.rgvarg[1].lVal = nRow; DispParam1.rgvarg[0].vt = VT_I4; DispParam1.rgvarg[0].lVal = nCol; IImpl::Invoke(DISPID_Number , IID_NULL , 0 , DISPATCH_PROPERTYGET, &DispParam1, &pVarResult , &excep, &nArgErr); temp = pVarResult.dblVal; //delete [] DispParam1.rgvarg; return temp; }

    G 1 Reply Last reply
    0
    • S safee ullah

      hi there.. thanks for your time firstly.. i am having a strange problem in the invoke of my IDispatch.. This method is called from the get property of an aX control. When i call this get method, i dont seem to get any return vaule in the pvarresult variable.. any suggestions.. here is the method: double CControl:: GetNumber(long nRow, long nCol) { DISPPARAMS DispParam1; EXCEPINFO excep; UINT nArgErr; VARIANT pVarResult; double temp; DispParam1.cArgs = 2; //number of arguments DispParam1.cNamedArgs = 0;// Number of named arguments. DispParam1.rgvarg = new VARIANTARG[2]; DispParam1.rgvarg->vt = VT_ARRAY; DispParam1.rgvarg[1].vt = VT_I4; DispParam1.rgvarg[1].lVal = nRow; DispParam1.rgvarg[0].vt = VT_I4; DispParam1.rgvarg[0].lVal = nCol; IImpl::Invoke(DISPID_Number , IID_NULL , 0 , DISPATCH_PROPERTYGET, &DispParam1, &pVarResult , &excep, &nArgErr); temp = pVarResult.dblVal; //delete [] DispParam1.rgvarg; return temp; }

      G Offline
      G Offline
      geo_m
      wrote on last edited by
      #2

      try to VariantInit the result variant. VariantInit( &pVarResult ); this can help (and if not, it's anyway better)

      S 1 Reply Last reply
      0
      • G geo_m

        try to VariantInit the result variant. VariantInit( &pVarResult ); this can help (and if not, it's anyway better)

        S Offline
        S Offline
        safee ullah
        wrote on last edited by
        #3

        thanks :) kindest regards

        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