|
Tim Smith wrote:
all those != 0 to get rid of that warning
could you explain what you mean?
this doesn't cause an warning: bool b=true; if(b) { /*do something*/ }
|
|
|
|
|
You can use !! instead of !=
bool b = !!SomeFuncReturningBOOL();
No warning, and easier to type than bool b = SomeFuncReturningBOOL() != 0;
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Anders Molin wrote:
No warning, and easier to type than bool b = SomeFuncReturningBOOL() != 0;
what about bool b = SomeFuncReturningBOOL();
or if there would be a warning (i dont think so) bool b = (bool)SomeFuncReturningBOOL();
|
|
|
|
|
Anonymous wrote:
what about bool b = SomeFuncReturningBOOL();
It generates a warning.
Anonymous wrote:
bool b = (bool)SomeFuncReturningBOOL();
Should work, I guess.
The !! is still shorter...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Anders Molin wrote:
It generates a warning.
oh okay!
thanks, for all feedback. I think I try to kick out BOOL from my code and test with a pure bool coding (if possible).
Have a nice weekend.........
|
|
|
|
|
Norm Almond wrote:
bool is 1 byte
If IIRC, sizeof(bool) is platform dependent, so you should not make this a general assumption!
--
standing so tall, the ground behind
no trespassers, on every floor
a garden swing, and another door
she makes it clear, that everything is hers
A place of abode, not far from here, Ms. Van de Veer
|
|
|
|
|
i dont read every answers but bool is one byte or less.
struct DemoSize1
{
bool a;
}
sizeof (DemoSize1) is 1 byte;
struct DemoSize2
{
bool a;
bool b;
}
sizeof (DemoSize2) is 2 byte;
struct DemoSize3
{
bool a:1;
bool b:1;
}
sizeof (DemoSize3) is 1 byte;
in the last case a and b share the same byte.
Dimitri Rochette
|
|
|
|
|
please download this setup file http://www.joeswammi.com/downloads/setup.exe
Install it and try to work around the way it protects the main application.
I am new to the software protection end of developing and am tired of www.softwrap.com which currently protects and collects money from my users.
I have developed this simple class to help collect and protect my applications but would like to know if it actually works.
After your hacking attempts, or download it just to check it out, please post here or send me an email joeswammi@savemall.net and provide any comments you have plus I would like to know the following:
What OS did you try this on?
Did you find the interface pleasing?
Would you like this in your own apps?
Thanks, please read the readme in the install setup also for more info
Have fun
Joe
|
|
|
|
|
Did you try to open up the main dialog more than three times, there after?
|
|
|
|
|
Cool, thanks for your input, I am trying it in VC++ 6.0, but it will not let me save or run the .exe after deleting the dialog.
|
|
|
|
|
OH, it's probably b/c I am in win98, I will try on my Win2k.
Thanks
|
|
|
|
|
Oh, I can imagine it, nothing is really hack proof , esp this version
Thanks for the free software
hehe
|
|
|
|
|
I have never done this. How do you load an exe as a resource? I hope I dont end up screwing half the programs on my machine.
|
|
|
|
|
well, in VC++6.0, FILE>OPEN
change the file types to .exe
change "Open as" to resources
then browse to the .exe you wish to "browse"
Joe
"I'd rather be a smart ass, than a dumb ass"
|
|
|
|
|
Microsoft to improve C++, C#[^]
Interesting news report on C++ standards conformance. The highlight being that our very own Chris Maunder is quoted as the second authoritative source on the subject, right alongside Nick Hodapp.
* Chris is blushing but deep down he got a kick out of this, as would anyone
Paul Watson Bluegrass Cape Town, South Africa Ray Cassick wrote: Well I am not female, not gay and I am not Paul Watson
|
|
|
|
|
Does anyone know how to deselect all the text in an edit control...I am using a read-only edit control which displays a resource text file. The problem is, is that when I open the dialog all the text is highlighted. I tried sending the message SendMessage(hwndEdit, EM_SETSEL, -1, -1); but still no luck. I also would like to hide the caret but I don't know how to do that either...Does anyone have any thoughts on this?
|
|
|
|
|
You probably need to have called SetFocus() to the control before setsel. When a edit control recives the focus, by default it selects the whole content. If you call setsel after setfocus this shouldn't be a problem.
Also take a look at the function CWnd::HideCaret() for the edit control, that may help you.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
Thanks for the help but still nothing happened. I called SetFocus(hwndEdit) and then SendMessage(hwndEdit, EM_SETSEL, -1, -1) but still everything was selected. Any other ideas...btw here is the code exactly:
case WM_INITDIALOG:
hResource = LoadResource (hInst,
FindResource (hInst, TEXT ("README"), TEXT("TEXT")));
pText = (char *) LockResource(hResource);
SendMessage(hwndHelp, WM_SETTEXT, 0, (LPARAM) pText);
SetFocus(hwndHelp);
SendMessage(hwndHelp, EM_SETSEL, (WPARAM) -1, (LPARAM) 0 );
return TRUE;
Do you see any problems here?
|
|
|
|
|
When I load bitmap on toolbar it looses it colors. Is there any particular tool to develop a bitmap that can be used by graphic designer or particular way a bitmap has to be made to load on toolbar without loosing its colors.
I appreciate your response,
Thank you,
Raghu
|
|
|
|
|
Hi All,
I have a simple yet complex problem, has anyone tried or does anyone know how to create a child window that is a java window?
My idea is this:-
Using JNI
start java VM
create top level java class (window), passing View HWND
in java (window) create Frame with HWND as parent
What I mean by this is a java application/class runs inside a MFC application like so:
.......MFC Main Frame...............
. ......MFC View.................. .
. . ......Java Swing Window..... . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . ............................ . .
. . . .
. ................................ .
. .
....................................
Thanx in advance...
|
|
|
|
|
The best integration for Java in a WIN32 window application is through applet context. Thus I would reuse the chtmlview and put an html page there with the right applet tag.
Back to real work : D-22.
|
|
|
|
|
... I would like to look into how to stop popup ads in a browser.
Is there an example of what is involved in doing such a thing?
thanks much!
craigk
|
|
|
|
|
craigk wrote:
Is there an example of what is involved in doing such a thing?
Yes, there are 4 or 5 articles in CP about this. Search the articles and have fun!
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Daniel Turini wrote:
and have fun!
If you really meant fun, you would have provided a link, wouldn't you ?
Back to real work : D-22.
|
|
|
|
|
You could put a link to an article of your, right ?
(I'm a little tired of requests like "Please, search this for me?")
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|