On Apr 28 2001, 6:06 am, "Michael Harris" <mik...@mvps.org> wrote:
> "...So there is no way to transparentlyreturnanarrayinJScript?..."
> To be "JScript-friendly", you have toreturn*everything" via a >functionreturnvalue. And as I
> said before,JScriptcan handle a SAFEARRAY by converting it with VBArray() >since aJScriptarray
> isn't really anarraybut rather a special (IDispatch[Ex] based)JScriptobject with >numeric
> properties.
JScript takes array[0] as array.0
2 1571
What's the question?
http://groups.google.com/group/microsoft.public.scripting.jscript/browse_thread/thread/0e10ec0571c9ca48/2d160e9d46d49c3e
JScript takes array[0][1] as array.0.1 -
-
-
STDMETHODIMP CUfmArray::XLocalClass::GetDispID(
-
BSTR bstrName, DWORD grfdex, DISPID *pid)
-
{
-
METHOD_PROLOGUE(CUfmArray, LocalClass)
-
-
CString strValue;
-
if(pThis->m_psaAry.Lookup(CString(bstrName),strValue))
-
{
-
*pid =pThis->m_pidAry->GetCount()+0x1000;
-
pThis->m_pidAry->AddTail(strValue);
-
-
return S_OK;
-
}
-
return pThis->m_JuggleAry->GetDispID( bstrName, grfdex, pid);
-
}
-
-
STDMETHODIMP CUfmArray::XLocalClass::InvokeEx(
-
DISPID id, LCID lcid, WORD wFlags,
-
DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei,
-
IServiceProvider *pspCaller)
-
{
-
METHOD_PROLOGUE(CUfmArray, LocalClass)
-
-
CString strValue;
-
if(strValue = pThis->m_pidAry->GetAt(pThis->m_pidAry->FindIndex(id-0x1000)))
-
{
-
// Validate that they passed in a valid variant for results
-
// and have no parameters assigned to the "Get"
-
if( pvarRes != NULL &&
-
(pdp == NULL || pdp->cArgs == 0) )
-
{
-
// Do the "Get" with the specified ID
-
VariantClear(pvarRes);
-
pvarRes->vt =VT_BSTR;
-
pvarRes->bstrVal = strValue.AllocSysString();
-
}
-
else
-
{
-
// They passed in bogus stuff
-
return E_INVALIDARG;
-
}
-
return S_OK;
-
}
-
-
-
HRESULT hr = pThis->m_JuggleAry->InvokeEx( id, lcid, wFlags,
-
pdp, pvarRes, pei,
-
pspCaller);
-
-
if(hr ==E_POINTER)
-
{
-
IUfmArray* pSry =(IUfmArray*)pThis->GetInterface(&IID_IUfmArray);
-
-
-
UINT nErrArg = 0;
-
-
hr =pSry->Invoke( id, IID_NULL, lcid, wFlags,
-
pdp, pvarRes, pei,
-
&nErrArg);
-
}
-
return hr;
-
}
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: jeff |
last post by:
I have a php file that contains a couple of arrays used for
state/country pull-down lists. I have two global arrays and an accessor
method for each. I have some simple logging methods, so I know a...
|
by: Gent |
last post by:
I have two questions which are very similar:
Is it possible to return an object in C++. Below is part of my code
for reference however I am more concerned about the concept. It seems
like the...
|
by: Derek Basch |
last post by:
Is there any way to associate name/value pairs during an array
initialization? Like so:
sType = "funFilter"
filterTypeInfo = ;
filterTypeInfo = new Array("type" : sType);
I can do it using...
|
by: dotnettester |
last post by:
Hi,
I am maintaining some code and I see in some functions..
Function myFunction
set someobj = Server.CreateObject("MYOBJ")
.....
....
set myFunction = "somedataToReturn"
|
by: Faustino Dina |
last post by:
Hi,
The following code is from an article published in Informit.com at
http://www.informit.com/guides/content.asp?g=dotnet&seqNum=142. The problem
is the author says it is not a good idea to...
|
by: cdg |
last post by:
Could anyone correct any mistakes in this example program. I am just
trying to return an array back to "main" to be printed out. And I am not
sure how a "pointer to an array" is returned to the...
|
by: I.M. !Knuth |
last post by:
Hi. I'm more-or-less a C newbie. I thought I had pointers under control until
I started goofing around with this:
...
|
by: sjsean |
last post by:
All thanks in advance for reading my post. I am new to using js and
more accustomed to vbscript.
I had written code which created a shopping cart into an array using
vbscript and then...
|
by: jodleren |
last post by:
Hi!
I have a function, a part of my code which I can use as a function. It
will return 2 arrays, and I am wondering what way to do so. Both
arrays hold strings, there are no special keys.
1)...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |