As Any

iebidan

Well-known member
Joined
Feb 6, 2003
Messages
484
I have been trying to develop a control using some APIs, but sometimes I find that in VB6 you declared some parts of the function with the phrase "As Any", will be ok to declare them "As Object"????? what do you think??? I havent found a good document telling about APIs in .NET
 
Thats why Im asking, As Any and Variant are no longer supported on .NET, but cant find the correct Data Type, and I know the As Object will help, the API Im calling is CreateWindowEx, in the last option you have to send you will see in every doument about APIs and VB that the data type is Any.
 
It is better to declare the parameters as the correct type rather than Object.
Quite often the parameters were declared as any because the API could accept differrent things (string, integer, long etc) - but usually this was a pointer to the data in memory.

In VB.Net simply declare the API multiple times, specifying the correct different versions of the API.
 
Back
Top