How do I find the address-of the one's complement of 15 (&~15 (C++ code)) in VB? At least I think that's how it is said. :eek: :)
Thanks
Printable View
How do I find the address-of the one's complement of 15 (&~15 (C++ code)) in VB? At least I think that's how it is said. :eek: :)
Thanks
I know C, but I'm finding that people asking for C stuff out of context means that I usually give a bad answer.
Post the code you got this from.
To answer your question -
z is now a pointer to aCode:Dim a as long
a = 15
z = varptr(a)
If this is for a function call, pass z ByVal.
I'm not sure how to do a one's complement with VB.
Here is the code:
And I saw somewhere were perhaps a one's complement can be acheived some how with Not?Code:bmp.bmWidthBytes = ((bmp.bmWidth + 15) &~15)/8;
Thanks
Oh. That's what I thought.
You are right, not does give one's complement, except in VB I"ve gotten wierd results. If you want to assume not will work-- this is your code:Code:((bmp.bmWidth + 15) &~15)/8;
should be:
((bmp.bmWidth + 15) & ~15)/8;
which is
( bmp.bmwidth + 15) and one's complement of 15
not the address of.
Code:dim i as long
i= (bmp.bmwidth + 15) and ( not 15)
i = i/8
bmp.bmWidthBytes = i