|
-
Aug 18th, 2009, 12:17 AM
#1
Thread Starter
New Member
Replacing API Calls with .NET Framework Classes
Do we have nay .NET framework classes to replace the following API calls?
CreateWindowEx
GetWindowText
ShowWindow
SendMessage
GetWindowRect
Basically we have migrated our application from VB6 to .NET and used same API calls in .NET as well.
Now the time has come to replace all API calls to .NET framework classes.
We used those API calls to validate textboxes by popping up a temporary error message box next to textbox object. After few seconds, the error message box disappears by itself or on loosing the focus of textbox.
If we can use the similar functionality of .NET, then there will be less code changes, otherwise please suggest other alternatives.
Regards
-
Aug 18th, 2009, 12:26 AM
#2
Re: Replacing API Calls with .NET Framework Classes
None of those functions are required if you're dealing with forms in your own app but then I don't think they would have in VB6 either. If you're dealing with windows outside your own app then you'll still have to use the same functions.
Just note that, if you do use those functions in VB.NET, you need to use .NET-specific declarations. You should use the DllImport attribute but you can still use the Declare key word if you want. Either way though, you MUST ensure that you use the correct numeric types, which generally means using an Integer in VB.NET everywhere you would have used a Long in VB6.
-
Aug 18th, 2009, 06:16 AM
#3
Thread Starter
New Member
Re: Replacing API Calls with .NET Framework Classes
But I was talking about completely knocking out the API calls. Which means, I should be able to create same functionality in .NET as it was with API methods.
-
Aug 18th, 2009, 06:59 AM
#4
Re: Replacing API Calls with .NET Framework Classes
Well JMC stated it pretty clearly. If you are doing this within your own app, then you don't need the API calls, otherwise, you do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|