iebidan Posted June 5, 2003 Posted June 5, 2003 I have been trying to develop a control using some API's, 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 haven't found a good document telling about API's in .NET Quote Fat kids are harder to kidnap
*Experts* mutant Posted June 5, 2003 *Experts* Posted June 5, 2003 Its not good to declare as Object but if you used as Any you have to use Object as it can represent anything. Quote
iebidan Posted June 5, 2003 Author Posted June 5, 2003 That's why I'm asking, As Any and Variant are no longer supported on .NET, but can't find the correct Data Type, and I know the As Object will help, the API I'm calling is CreateWindowEx, in the last option you have to send you will see in every doument about API's and VB that the data type is Any. Quote Fat kids are harder to kidnap
Administrators PlausiblyDamp Posted June 5, 2003 Administrators Posted June 5, 2003 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
iebidan Posted June 5, 2003 Author Posted June 5, 2003 Right, overloads... why I forgot that???? Quote Fat kids are harder to kidnap
Recommended Posts