|
I want to change the background colour of a button but am unable to do it. This button is attached to a class derived from CButton, and i want the code to reside in this class, not the dialogs class.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
Check out some of the owner-drawn button articles for ideas. You might be able to use one of them without modifications.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I think you can do it in Paint of this class.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
This is the best button you will ever get
Best regards,
Alexandru Savescu
|
|
|
|
|
|
thanks, i haven't had a good look at the code to see if I can incorporate it into my class, but it looks promising.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
Hi!
Does anyone has some ideas about dynamic software update ? (existing classes ...)
My purpose is to reduce effort while distributing a new release of the same software.
I just want to put the new version on a shared network directory, and force my software to update itself and its components (DLLs, exe files, config files ....)
What's the good way to add such a funtion ??
Thanks,
Vince
vince
|
|
|
|
|
You can use a class derived from WebResourceProvider to check for component (DLL) updates at run time.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Checking updates at run time is not realy a strong effort !
My real need is to learn technicals about the way to force an exe file to auto-update.
|
|
|
|
|
A (one) simple way to do that is to have a very thin driver app that calls an explicitly loaded DLL's exported function that does all the work of the app. When your "update app" logic fires, unload the DLL, replace it with a newer version and reload the DLL.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have objects that I create with new() and I store pointers to them in a CArray:
Object *o;
o=new Object();
Array.Add(o);
When I want to delete all and free all memory, do I have to do:
while (Array.GetSize()){
delete Array[0];
Array.RemoveAt(0);
}
Thanks!
|
|
|
|
|
Yep, that should work.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Jason Hihn wrote:
while (Array.GetSize()){
delete Array[0];
Array.RemoveAt(0);
}
That's a pretty inefficient way of doing it since every time you remove at 0 the upper data has to be shifted down. I would just keep it simple e.g.
for(int i=0; i
|
|
|
|
|
Jason Hihn wrote:
while (Array.GetSize()){
delete Array[0];
Array.RemoveAt(0);
}
Let's try again.
That's a pretty inefficient way of doing it since every time you remove at 0 the upper data has to be shifted down. I would just keep it simple e.g.
for(int i=0; i < Array.GetSize(); i++)
{
delete Array[i];
}
Array.RemoveAll();
Joel
|
|
|
|
|
Joel Matthias wrote:
for(int i=0; i < Array.GetSize(); i++)
{
delete Array[i];
}
Array.RemoveAll();
I prefer to write this as follows, personally:
while (Array.GetSize())
{
delete Array[0];
}
Array.RemoveAll();
I don't like using for() loops when clearing out arrays - but I guess that's just me being picky about coding style.
: Dean 'Karnatos' Michaud
|
|
|
|
|
That's fine but the code doesn't work and infact it produces an infinite loop since you never actually remove the pointer from the array.
Also you imply that 'while loops' are somehow more correct or are a better coding style than 'for loops' how do you justify that. People have been using 'for loops' to iterate through arrays for years.
Joel
|
|
|
|
|
Dean `Karnatos` Michaud wrote:
I prefer to write this as follows, personally:
while (Array.GetSize())
{
delete Array[0];
}
Array.RemoveAll();
Imho, that's bad, for 2 reasons: (1) it's inefficient to repeatedly make a function call to GetSize() and (2) it's dangerous to treat integers as boolean expressions. Better to write while (Arrary.GetSize() > 0) .
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Do you know how to exclude a MFC dialog-based application from the taskbar?
rechi
|
|
|
|
|
Remove the WS_EX_APPWINDOW style from the window, and that should do the trick.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
My application is having some major errors due to an issue relating to the variables defined in my app. As I step through the code using the debugger to check up on some bugs, I notice that upon declaration of my variables, they are immediately populated with junk data. This junk data is the source of many of my issues. Has anyone ever seen this before? I dont' understand why when a CString is declared it is being initially populated with junk instead of being an empty string.
Thoughts?
|
|
|
|
|
no real advice. but when things stop making sense, a Rebuild All is usually my first action.
-c
Cheap oil. It's worth it!
|
|
|
|
|
Stew wrote:
I notice that upon declaration of my variables, they are immediately populated with junk data.
This is what a debug build does to tell you "You forgot to initialize this data".
|
|
|
|
|
Variables (intrinsic types and pointers) are not initialized for you. When you istantiate a class object the constructor is called and the constructor is responsible for initializing it's internal variables.
If you have a CString which you are declaring like:
CString strMyString;
and it has junk in it, the most likely problem is that you have overwritten your stack somewhere. If you are doing:
CString* pstrMyString;
then it should be set to junk since the constructor hasn't been called and all you've done is allocate apointer.
|
|
|
|
|
hi,
how can i import or use *.jpg images with the picture control (static) with microsoft visual c++ 6.
- thanks.
|
|
|
|
|
you can't. you need code to translate the JPG to a format windows understands. there are many ways to do this on this site.
-c
Cheap oil. It's worth it!
|
|
|
|