try to use in vb.net an api which is used in a similar vb6 code .the api was created in vb6 code and succesfully works in vb6 code but when i use a vb.net the same code as vb6 when i run the exe it says that it could not load the <api name>
Printable View
try to use in vb.net an api which is used in a similar vb6 code .the api was created in vb6 code and succesfully works in vb6 code but when i use a vb.net the same code as vb6 when i run the exe it says that it could not load the <api name>
Show us how you are trying it, because it could be a few things.
I'm guessing that maybe you are still using "As Long", instead of "As Int32".
Maybe you are not using an Alias that's different than the function name.
Here is an example of how to declare API's the old way, with VB.NET.
Code:Private Declare Function apiGetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Int32
Which API?Quote:
Originally Posted by chriskaza81