Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easy API Question?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00258567
Message ID:
00259199
Views:
24
>>>Hi George - Of course you're right. I thought there was a problem with win32api declaration, but of course it was due to my dumb 'case' mistake. I'll change the code appropriately :)
>>
>>Hi Bruce, It isn't that USER32 is wrong (it isn't), just unnecessary. The easiest way I know to avoid spelling and/or case mistakes when dealing with the API is to simply copy the declaration from either the Win32 SDK or the MSDN Library. Quite frankly, I can never remember the entire list of what's searched. If I find that it can't find the entry point, then I my first reaction is to check what the import library is and use that.
>
>But keeping the api call generic with win32api seems like a better way to go than using specific DLLs, isn't it? I only used the user32 because of this:

It isn't very likely that a function will be moved from its original library, so it's hard to try to quantify which is better. I use the Win32API identifier myself. But only because I'm lazy< g >. However, an argument could be made that someone coming from another language (say VB, where you have specify the library) might find not using the exact name confusing. I don't think it'd be a terribly strong argument, however.

>declare integer GetDeskTopWindow in win32api
>
>errors. But
>
>declare integer GetDeskTopWindow in user32.dll
>
>does not error. Of course, the error comes later, when you try to invoke it. By which time I was pretty thoroughly confused :)

Oh, I could tell you some stories, Bruce.:-) Working with the API can do that to you.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform