|
|||
|
Hello,
Is it possible to access return/output parameters from ActiveX controls using SWF Kit? I have created a custom ActiveX object. I've been able to call methods on it from FFish, and have it generate events to FFish. (Using the ActiveXObject in SWFKit Pro 2). However, I can not figure out a way to access output/return values. I am not an ActiveXObject expert, but I assumed the correct way would be to use a VARIANT* parameter marked as [out, return] in the IDL. For example, I would like to write something like this in FFish: var returnValue = myActiveXCtl.doSomething(inputParams); OR myActiveXCtl.doSomething(inputParam1, outputParam2); ...where the activeX object has changed the value of 'outputParam2' when the method returns. Is it possible to do this? If so, any help is appreciated. If not, what is the suggested way to have an ActiveX object return values to a FFish script? Use properties? Thanks in advance. The SWFKit product has proved useful on a number of occassions. - josh |
|
|||
|
SWFKit doesn't support out params. But it supports return parameters. A method of an ActiveX is something like this:
Code:
HRESULT myMethod(VARAINT param1, VARIANT param2, [out, retval]VARIANT *out); Code:
var myValue = myActiveX.myMethod(param1, param2); E.g. Code:
LRESULT onSomething(VARIANT param1, [out]VARIANT *param2); Code:
myActiveX.onSomething = function (param1, param2)
{
...
param2.value = "OK";
}
|
|
|||
|
Thank you. That works.
Fwiw, I had originally tried that method signature, but I had not correctly set the Variant.vt property. For anyone else that stumbles upon this, be sure to have your ActiveX code similar to the following for returning a string to FFish: Code:
STDMETHODIMP ActiveXLib::myMethod(VARIANT* outParam)
{
CComBSTR str;
strAppend(L"Testing");
outParam->bstrVal = tmp.Copy();
outParam->vt = VT_BSTR; // <-- this is what I forgot initially. Might be common ActiveX knowledge.
return S_OK;
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|