|
Can anyone tell me how to change the text of a property page. There's a method SetWindow Text, but calling this method before the property page is shown results in an ASSERTION, because there's no window handle in this stage. Calling this method afterwards doesn't seem to have any effect.
I see only the text I assigned to the property page in the ressource editor.
I'm using the method creating a CPropertySheet and method add page to create my property sheet.
Hope anyone cann make me a bit wiser in this thing. Thanks.
|
|
|
|
|
Check out MSDN article Q141487.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thanks very much. This was the clue I needed.
|
|
|
|
|
hi, i am getting started with a very resource intensive app, i was wondering if there is any speed difference between the following three versions of a function (assuming they are not inlined):
int func1() {return 0;}<br />
<br />
namespace testns {<br />
int func2() {return 0;}<br />
};<br />
<br />
class testclass {<br />
static int func3() {return 0;}<br />
};<br />
<br />
void main() {<br />
func1();<br />
testns::func2();<br />
testclass::func3();<br />
}
any help is appreciated
|
|
|
|
|
How you tried putting some timer code around each call, or running the code through the profiler to see?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
me think scopes are resolved at compilation time, and will be converted to something similar.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
Chris Losinger wrote: they all turn into 'jmp xxxxx' after compilation
or call instructions
|
|
|
|
|
ok, thanks guys!
i assumed instance member functions are a bit slower than static functions, is this correct too?
|
|
|
|
|
zildjohn01 wrote: is this correct too?
there's a minimal amount of extra setup required for member functions (need to push a 'this' pointer onto the stack - basically an extra parameter) before the call gets made.
virtual functions will be slower because there's a function pointer lookup to deal with.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi Guys,
You all know that the RichEdit Control can auto-detect links in the text. And you all know to that the Micrsoft Visual Studio allows you to use some kind of "HTML Dialog", where the Buttons are coded in HTML. Now my question is: The Button are also some kind of Hyperlinks. Can I add this kind of HTML in my RichEdit ?
So I want for example create a Hyperlink in my RichEdit which should open a MessageBox when clicked. Is there any possibility to do this ?
With best regards,
Benedikt
|
|
|
|
|
If int i; is the decleration then what could be the definition?
Can any one please let me know this.
Nice talking to you.
|
|
|
|
|
i = 3; ???
That's used for methods...
|
|
|
|
|
int
int is a built-in atomic type that the compiler recognizes as part of the particular language definition you're using, in this case C++. So read the docs to find what an int or some other type is defined as. As for C++ on Win32 int is defined as a storage size of 4 bytes which can contain values ranging in -(2^32-1) and +2^32.
Other compilers/platforms may define it slightly differently resulting in a differing value range.
|
|
|
|
|
|
I have a simple C++6.0/MFC SDI application that has some username/passwords associated with it. Up to now I have stored these items in the registry since there was no real security needs. However, there are now a few users who are requesting some increased security so I would like to encrypt/decrypt the username and passwords. I have searched for and found many encryption downloads but was wondering if there is any consensus on a preferred one. I just need to encrypt/decrypt a string as simply as possible, with moderate security. Thanks for your time and any assistance. StoneRaven
|
|
|
|
|
You could use a simple xor on the password.
I think the standard way is to use a MD5 hash or SHA hash.
You hash the user password and store the hash in the registry. After you get the plain text password from the user you then hash the password and then compare the hash value to the hash value stored in the registry. This way even if the registry is compromised the password is not stored in the clear.
Forever Developing
|
|
|
|
|
I don't know what is you application for, but if you need increased security you need to change the way you store user/password.
You could encrypt the passwords with any algoritm you want, but if someone modifies the registry and sets the password to null, all you security is f****d up.
If you still want to store the info in the registry, and want the users to think that they have improved security, just add 100 or some random number to the string, and is the same.
|
|
|
|
|
StoneRaven wrote: so I would like to encrypt/decrypt the username and passwords
RC4[^] is well suited for you need
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
If you want to use Win encryption as simply as possible then use CryptProtectData()/CryptUnprotectData() to encrypt/decrypt the secret data before/after writing/reading the registry.
These will allow you to use either the machine key (any user on machine can decrypt the data), or the current user key (only that user can decrypt the data).
...cmk
Save the whales - collect the whole set
|
|
|
|
|
How do I go about getting a storable value from the encrypted DATA_BLOB that can be stored/recovered from the registry and re-inserted in a new DATA_BLOB struct for decryption later on? Thanks...
|
|
|
|
|
if you are putting the app into the public domain, then I suggest that you use at least des56. The hackers out there WILL try to break your encryption and if you use xor or bit flipping, they will break it and post the findings on a hundred hacker bulletin boards. MS has some simple envelope and password encrypt functions in their csp that make it easy or there are many examples out there. I bury a long password in code somewhere and use it as the password to encrypt/decrypt the envelope. Be sure to obfuscate your code or that part where the password is hidden to thwart decompliers.
http://msdn.microsoft.com/msdnmag/issues/03/11/NETCodeObfuscation
|
|
|
|
|
Hi there,
I need to get the dimensions of a window's restored/normal size when it is maximized. This might sound simple, but i have spent hours trying different SDK and CWnd functions, and searching this forum and others, but to no avail.
The only function i can find that apparently retrieves the restored window size is GetWindowPlacement() and use its "rcNormalPosition" member. However, this member does not contain the correct restored size. When i compare the value of this member to the actual size that the window was before being maximized, it is different (the size is a lot bigger, and the top-left is a -3 value for some reason).
When i click the MDI window's restore button it restores the window to its previous (restored) correct size. Therefore the SDK obviously stores this value correctly somewhere in order to correctly restore it. Why can i not get this correct value from the SDK or CWnd please?
It seems a simple thing yet i have spent quite some time and have not found the answer.
Any help for this would be very much appreciated. Thank you.
Regards,
James
|
|
|
|
|
I think the values in the WINDOWPLACEMENT structure are opaque, in that they don't relate to "real" coordinates. We have the same requirement for one of our apps, and what we do is call GetWindowPlacement when closing the app, save all the values in the structure, and on startup, recreate the WINDOWPLACEMENT structure, and call SetWindowPlacement .
|
|
|
|
|
Hi Graham,
Thanks a lot for replying. I think that you are correct about the values of the WINDOWPLACEMENT structure not being "real".
My trouble is that the way in which we store window information, i cant currently store the WINDOWPLACEMENT structure and then restore it using that. We only store the starting point (x,y) and dimensions (cx,cy), and also whether it is maximised or not. Unfortunately i am limited to this and so i really need the actual restored point and dimensions.
Im sure that there must be a way to get this information, as the window is correctly restored by the SDK and so it must be able to work out the window's original placement info (even if it uses the WINDOWPLACEMENT structure to determine the "real" dimensions).
Thanks again for your suggestion, much appreciated.
Any further suggestions or help on the problem would be greatly appreciated.
Thanks,
James
|
|
|
|