|
-
Aug 20th, 2000, 09:07 AM
#1
Thread Starter
Fanatic Member
Thank you.
I'm giving examples of how you would do the same thing in VB to make the questions clearer.
1) How do I append a Null to a string? (VB: 'strX & vbNull')
2) How do I generate a random number? (VB: 'Rnd')
3) How do I redraw evrything on the form automatically (you know without having to put everything in WM_PAINT (Do I set CS_SAVEBITS to the WNDCLASSEX thing to pass to RegisterClassEx or is ther a better way)? (VB: 'Me.Autoredraw = True')
4) Is there a way to create a static variable (local to a function)? (VB: 'Static MyVar As Long')
Sorry for my complete ignorance (I started C++ a few days ago). I know I'm ambitious, but the more I'm told, the more I learn. 
Thank you all. But not you in particular.
-
Aug 20th, 2000, 10:06 AM
#2
Monday Morning Lunatic
1. Strings are by default null-terminated in C++. For example, these do pretty much the same thing. They are different, though, in a very complicated, low-level way.
Code:
char* mystring = "My Str";
char mystring[] = {'M', 'y', ' ', 'S', 't', 'r', '\0');
2. I think there's a rand() function defined in stdlib.h
3. I don't know.
4. Just use static:
Code:
void myfunc(int iNum) {
static int myInt;
myInt += iNum;
}
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 20th, 2000, 10:06 AM
#3
Use the RedrawWindow or UpdateWindow function.
Also, keep in mind that redrawing is painting it.
-
Aug 20th, 2000, 10:09 AM
#4
Monday Morning Lunatic
I think that for the AutoRedraw stuff, VB itself stores the bitmap and blits that back again, rather than anything in the API.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 20th, 2000, 12:31 PM
#5
Thread Starter
Fanatic Member
Originally posted by parksie
I think that for the AutoRedraw stuff, VB itself stores the bitmap and blits that back again, rather than anything in the API.
That's what CS_SAVEBITS does (saves a bitmap and then puts it back)
Thank you, bozos, you've helped a lot. You'll see. One day I'll be able to do something without having to look through MSDN, and then post a quetion here if I can't find it there.
Originally posted by, well, me
One day
multos grazias
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
|