Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

prob w/ calling overloaded functions from OCX

0 views
Skip to first unread message

jeff clausius

unread,
Dec 4, 1998, 3:00:00 AM12/4/98
to
I am using a third party control, which has two functions with the same name
(overloaded functions). One is a "get" function, while the other is a "set"
function.

Example:
string FooBar(long l) - returns a string from index l
FooBar(long l, string s) - sets the string.

In my code, if I use the following:

string strTemp
long l
strTemp = "HI"
l = 5
ole_1.object.FooBar(l, strTemp)


I get an error message stating I did not pass the correct number
of arguments.

Does anyone know if there is a problem with overloaded functions
inside OCXs and PB 6.5? If so, is there a workaround?

What gives?

TIA
Jeff
iome...@iometrics.com

Roy Kiesler

unread,
Dec 4, 1998, 3:00:00 AM12/4/98
to
A shot in the dark here -- did you try ole_1.object.DYNAMIC FooBar(l,
strTemp) ?

Roy

comms

unread,
Dec 7, 1998, 3:00:00 AM12/7/98
to
Jeff,

The ActiveX (OCX,COM etc) interface does not support overloaded functions.

If you build a pb object with function overloading using inheritance (or
otherwise), the COM generator flattens out the public funtions to expose
them all in the descendant.

This is a funtion of COM and not PB. A COM method must be unique to an
interface.

Once you have


string FooBar(long l) - returns a string from index l

you can't have
FooBar(long l, string s)


Hope this Helps

Michael

jeff clausiu

unread,
Dec 7, 1998, 3:00:00 AM12/7/98
to
Hmmm....
The OCX is from Microsoft, and comes with Visual Basic (Grid).
If a COM interface cannot be overloaded, how does MS do it inside of VB?
Any thoughts?


comms wrote in message <366B5053...@ozemail.com.au>...


>Jeff,
>
>The ActiveX (OCX,COM etc) interface does not support overloaded functions.
>

> Michael


0 new messages