none
Javascript to BHO data pass RRS feed

Answers

  • On 6/28/2011 9:54 PM, George SS wrote:

    Very weak experience with the microsoft frameworks. Am I look at something along these lines? How would assign the property to StoreInfo?

    [code]
    DISPPARAMS dp = { 0, 0, 0, 0 };
    VARIANT var;
    DISPID putid = DISPID_THIS;
    var.vt = StoreInfo;<- ????
    var.pdispVal = StoreInfo;<- ????

    StoreInfo needs to be a COM object implementing IDispatch interface. Then you do something along the lines of

    StoreInfo* p = new StoreInfo;
    var.vt = VT_DISPATCH;
    (var.pdispVal = p)->AddRef();

    And VariantClear(&var) after the Invoke call. Or, use CComVariant wrapper - it'll call VariantClear in its destructor.

    dp.rgvarg =&var;        dp.rgdispidNamedArgs = NULL;
    dp.cArgs = 0;

    dp.cArgs = 1;


    Igor Tandetnik

    Wednesday, June 29, 2011 2:00 AM

All replies

  • On 6/28/2011 9:26 PM, George SS wrote:

             CComVariant dest;
             DISPPARAMS dp = { 0, 0, 0, 0 };
             hr = pScriptDispEx->Invoke( did, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT,&dp,&dest, NULL, NULL );

    DISPATCH_PROPERTYPUT needs one parameter (packed into DISPPARAMS) - the value to assign to the property. You pass none.


    Igor Tandetnik

    Wednesday, June 29, 2011 1:31 AM
  • Very weak experience with the microsoft frameworks. Am I look at something along these lines? How would assign the property to StoreInfo?

    DISPPARAMS dp = { 0, 0, 0, 0 };
    VARIANT var;
    DISPID putid = DISPID_THIS;
    var.vt = StoreInfo; <- ????
    var.pdispVal = StoreInfo; <- ????
    	
    dp.rgvarg = &var;		
    dp.rgdispidNamedArgs = NULL;
    dp.cArgs = 0;
    dp.cNamedArgs = 0;
     hr = pScriptDispEx->Invoke( did, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT,&dp,&dest, NULL, NULL );
    Wednesday, June 29, 2011 1:54 AM
  • On 6/28/2011 9:54 PM, George SS wrote:

    Very weak experience with the microsoft frameworks. Am I look at something along these lines? How would assign the property to StoreInfo?

    [code]
    DISPPARAMS dp = { 0, 0, 0, 0 };
    VARIANT var;
    DISPID putid = DISPID_THIS;
    var.vt = StoreInfo;<- ????
    var.pdispVal = StoreInfo;<- ????

    StoreInfo needs to be a COM object implementing IDispatch interface. Then you do something along the lines of

    StoreInfo* p = new StoreInfo;
    var.vt = VT_DISPATCH;
    (var.pdispVal = p)->AddRef();

    And VariantClear(&var) after the Invoke call. Or, use CComVariant wrapper - it'll call VariantClear in its destructor.

    dp.rgvarg =&var;        dp.rgdispidNamedArgs = NULL;
    dp.cArgs = 0;

    dp.cArgs = 1;


    Igor Tandetnik

    Wednesday, June 29, 2011 2:00 AM