
Overloading DLL functions with VB (OR) API Declarations in VB
Robert,
Thanks for your input on this subject I was working on that problem for
awhile.
I've had several problems with the way VB declares DLL functions in the
past, especially with functions where the paramater may be of a unknown data
type.
I'm not sure if your familiar with VB, if so, I have a couple of questions
to ask of you since your the only one that replied to my LoadBitmap(Blah,
Whatever Blah) API function problem....
VB seems to follow a set of rules that determines whether-or-not what data
type can be passed to functions, even if the function can accept a universal
value... C on the other hand can accept the data type, or a pointer (start
address _was that an old C64/128 term?_) to the data sent to the function.
In C, type checking doesn't seem to work perfectly if the parameter is a
pointer to the data (cause it's impossible...), and VB's perfectionism is
far too perfect to accept a 'universal' data type that a specific function
requires, this is where ByValue and ByRef takes toll in VB.
Since VB doesn't support 'true' function overloading, and the function has
to be declared in a specific way... how would you declare a function to
accept parameters that could be sent in a 'unknown' format? Should the
function be declared with several aliases? Since I don't have access to the
source of the original DLL's, I need to know of a way to call a function
_SAFELY_ in different formats...
Any suggestions would be helpful...
BTW, I've already tried the use of _As Any_ in the function declarations, it
seems to work in VB4, but not VB5. (bugg?)
John