|
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!
|
|
|
|
|
Hello,
I am trying hard to show tooltips for controls that are enclosed by a group box using standard stuff of Windows.
I have noticed that if the group box is visible I get no tooltip whatsoever, if I make it invisible I get the tooltip.
Has anyone a good solution to this problem ?? I know that the group box is technically a camouflaged push button, but there must be a way to have both the group box and the tooltip visible.
PLS HELP ME !!!!!!!!!!!
Riccardo
|
|
|
|
|
Check the Z_order of your controls, and make sure that your controls come after the group box, that way they will appear to be on top of the group box, and hopefully the group box won't still the mouse messages.
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!
|
|
|
|
|
yes, but how can I control the Z-order of my controls ??
|
|
|
|
|
Did you ever find a solution for this problem? The Z-Order does not seem to make a difference.
Thanks,
John
|
|
|
|
|
What method would my fellow CPians recommend I use to interface with an SQL server. I don't need anything too complicated... just a basic way to connect and send and recieve data from the DB. There won't be any mad SQL statements [like the ones I had in my good damn DB exam!!]
Any help appreciated
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it"
Nish on life [methinks]
|
|
|
|