Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAFEARRAY as [in] parameter

Status
Not open for further replies.

Leoghann

Programmer
Mar 9, 2003
5
US
After years of resistance, I'm finally setting about writing my first ActiveX DLL in VB. It took about ten minutes for me to run into an problem.

Want I want to do is pass a SAFEARRAY from a C++ Service into this ActiveX DLL as an [in] parameter. Thus far, I've been able to spec input-only stuff by declaring things ByVal on the VB side. Arrays can't be ByVal, though, so I keep hitting a wall.

Rephrased -- How do I declare this:

[tt]void Test([in] SAFEARRAY(long) TheArray);[/tt]

in Visual Basic 6.0?
 
It would appear that the following should work.

Public Declare Sub Test Lib "DLL_Name" (TheArray() as long)

My information for determining this was found by looking at "Passing Arrays to a DLL Procedure" in the MSDN.

-Sean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top