|
-
Feb 3rd, 2002, 12:33 AM
#1
API Translation
I've got the API Guide and want to know if I can use the API calls in it with C++, even though the examples are in VB.
I'm asking about the declarations, not the usage. I can figure that out. I'm in terested in:
VB Code:
Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
'AND
Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Also, with the RECT declaration. do I declare that as
Code:
struct RECT {
long Left;
long top;
long right;
long bottom;
}
I'm new to C++ so thats probably horribly wrong, so please bare with me!
Thanks
NOMAD
-
Feb 3rd, 2002, 05:53 AM
#2
transcendental analytic
The API declarations are in windows.h, the only thing you need to do is include windows.h and you will be able to use any of API functions defined for win32api. Even if you know the usage since VB you'd better look up the usage again in MSDN since win32api is has names most types for their specific purposes.
RECT and any other API related types are also in windows.h, RECT's members are all lowercase btw.
If you haven't programmed C++ before, it's recommended that you choose a tutorial (check out the FAQ) and go trough the language concepts and first when you're trough start with the API, since C++ differs from VB in a lot of ways that would cause you trouble if you don't get them straight from the beginnning.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Feb 3rd, 2002, 11:30 AM
#3
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
|