If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > New Members & Introductions > VBA and OCX

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-11, 04:28
VBA_Prog VBA_Prog is offline
Registered User
 
Join Date: Dec 2011
Posts: 1
VBA and OCX

Hi all,

I've developed an OCX with a public function taking 3 refences parameters and returning one Variant:

ret = f(p1,p2,p3).

My problem here is that f reports in VBA that the parameter type is invalid as soon as more than 1 parameter is declared as reference or [in,out]. Hover the same OCX and function works in:

C++
VB.NET (VS2008,VS2010)
C#

but not in VBA??

*** Declarations ****
IDL file:
void f([in,out] BSTR* bstrTitle, [in,out] BSTR* bstrParameter1,[in,out] BSTR* bstrParameter2, [out,retval] VARIANT* varReadDataReturn);

CPP file:
DISP_FUNCTION_ID(xxx, "f", DISPID_f,
f, VT_VARIANT,VTS_PBSTR VTS_PBSTR VTS_PBSTR VTS_VARIANT

VARIANT class::f(CComBSTR& bstrTitle, CComBSTR& bstrParameter1,CComBSTR& bstrParameter2,VARIANT* varReadNumericDataReturn)

Has anyone an idea why it does not work in VBA?
Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On