|
If you're using MFC:
BeginWaitCursor();
...
EndWaitCursor();
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
TyMatthews wrote:
If you're using MFC:
BeginWaitCursor();
...
EndWaitCursor();
Better yet, use the RAII class CWaitCursor .
|
|
|
|
|
New question of the day. How can you download a file that needs you to accept a security certificate? Also I get a fail on the username/password using the http://UserName:Password@URL.com/file.ext. This may be due to the security certificate as well. Is there a way around this?
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
Try using OpenSSL and Curl.
OpenSSL and Curl are two libraries that are used together to interface with Secure HTTP.
They're available for Dos, Windows, Unix, and Linux platforms.
You can download these libraries from the following links:
http://curl.sourceforge.net/
http://www.openssl.org/
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/
|
|
|
|
|
Hi.
I discovered an interesting bug in an MFC multithreaded program. I found that when you delete a pointer to the worker thread's parameter (declared using new operator), the destructor of the class that is part of the parameter is called.
-----
// This is global.
struct THREADPARAMS
{
ClassA *pCA;
}
// This code is in the primary or main thread.
THREADPARAMS *ptp = new THREADPARAMS;
// Assume that clObject is a member variable and is an instance
// of a ClassA.
ptp->pCA = &clObject;
...
CWinThread *Thread = AfxBeginThread(ThreadFunction, ptp, ...);
// Assume everything works.
// Here is ThreadFunction
UINT ThreadFunction(LPVOID *pParams)
{
THREADPARAMS *ptp = reinterpret_cast<threadparams *="">(pParams);
ClassA *pClassA = ptp->pCA;
// Here is the code that causes the bug.
// I studied Jeff Prosise book on MFC.
// Prosise deleted the new struct inside the worker thread.
delete ptp;
-----
Okay. Lets get to the point. "delete ptp" calls ClassA destructor. I am not sure how to get this working.
My goal is to pass into a worker thread pointers to private data members of the primary thread (main) including primitive data type and ADT. I would like to know is the situation above normal or is there a flaw in my design?
Thanks,
Kuphryn
|
|
|
|
|
I can't see why "delete ptp" should touch ClassA. That said you haven't included the declaration for ClassA, and the answer may lie there.
Have you stepped into the delete ptp in the debugger to see if the ClassA destructor is really being called there?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Okay. Thanks.
Yeah something is definitely wrong. I will try to setup more breakpoints to see what triggers ClassA destructor. As far as I know right now, ClassA destructor gets triggered before the worker thread begins and even before the worker thread is resumed (note I declared the worker thread as suspended in order to duplicated its handle).
Kuphryn
|
|
|
|
|
I see that you assign ptp->pCA = &clObject ....
Question: Does clObject go out of scope? ( it is automatic in the function where you are filling out the ptp structure ) .... that could do it you know......
Why not : ptp->pCA = new ClassA; ????
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Okay. Thanks.
I see the problem.
You were right. The problem had to do with scope. The class destructor gets called as the function goes out of scope.
I fixed the bug.
Kuphryn
|
|
|
|
|
Can somebody tell me what is a good book that i can buy that is a good started guide for VS .Net.
I am really looking forward to learning everything about VS.NET and I need a good book that will help me.
Thanks everyone!
|
|
|
|
|
|
Hi,
here is a tricky question... I have a customized listbox (own colors). Now I'd like to specify the background of the listbox's scrollbar (a child of the listbox). Is this possible?
|
|
|
|
|
Hi all,
I am experiencing a very strange problem with windows XP, and I believe that it is related to the themes, but I am not certain.
I have a topmost style window, that contains an IE control. When I display a context (popup) menu, it appears, then the parent window is forced to repaint, and it repaints on top of the context menu. This happens for the dropdown list box portion of a select control in the embedded HTML of the IE control.
The funny thing is that I can click a few times, and finally get the menu to appear on top of the window. Also if I right click on the desktop to bring up that context menu, the problem occurs, so I think that I have eliminated the possibility of me displaying the popup menu incorrectly.
This problem does not happen on any other OS. I am about to try to disable XP desktop themse and display using the classic UI.
If anybody else has experienced this problem, or knows how to solve it, I would really apprecieate hearing from you.
Thank you
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!
|
|
|
|
|
using the classic windows UI does not change anything regarding this problem on Windows XP.
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!
|
|
|
|
|
I have not tested this, but : could problem be that parent is set to topmost window style and you having a z-order shoot-out?
Just trying to keep the forces of entropy at bay
|
|
|
|
|
I used SPy++ and found the cause.
I am using Jeffrey Richters Appbar class that appeared in an MSDN article a while back. This class handles a notification when a full screen app is shown, and moves the topmost appbar to the bottom of the zorder to prevent it from covering up the full screen window.
In windows XP for some reason, I get about 7 of these notification messages right in a row (I am unsure of the origin of these messages) and this is what is causing the appbar to repaint.
Now I am looking for this cause to hopefully handle this problem in XP gracefully.
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!
|
|
|
|
|
Dear all,
This would be a major easy question to most people here but
How do I launch another program from my program, and to just show the other program window if the program is already launched? Just out of interest, how do I launch a seperate instance of the program instead of just showing it?
Many many Thanks,
Chun Te
|
|
|
|
|
Chun Te, Ewe wrote:
How do I launch another program from my program
Many ways.....a couple of which are:
the std library call: system
thw Win32 call: CreateProcess
the Win32 call: ShellExecute
Chun Te, Ewe wrote:
how do I launch a seperate instance of the program instead of just showing it
This may not be up to you....It depends on if the "other program" will allow itself to run simultaneous multiple instances
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Dear all,
I was told by my professor to make a program in Perl and that is done. I now would like to intergrate it into a GUI program that will execute the Perl program. If this is possible, how do I do so? Does the user have to have a copy of Perl on his/her computer?
Many thanks.
Chun Te
|
|
|
|
|
Yes, they'll need to have perl installed, unless you package the perl program up into an exe using perlapp from activestate or perl2exe from I forgot who. Neither are free, but you can get a 7 day trial license of perlapp, that may do the trick.
-Lunchy
|
|
|
|
|
I love Perl. It's so great that I like with
my C++ too. Here's info on embedding a Perl
interpreter into your C/C++ projects.
No need for the user to install Perl, just
build in your own interpreter into your projects.
|
|
|
|
|
COOL! It's funny, TMTOWTDI is almost getting cliche.
-Lunchy
|
|
|
|
|
At the moment i am having trouble adding tree items using separate functions in Visual C++.
Basically I need a series of buttons to add tree items in the order they are pressed. However at the moment I am finding that all items have to be added in the same function (ie. the same button) since I do not know how to set up the code so that variables created in one function can be referenced by calls in another function. For example when one item is created by a function, the other function is not aware of it's existance and hence any instructions to place a new item after it cannot be understood.
Can anyone help? I apologise for my poor command of the technical terminology - I am very new to programming.
|
|
|
|
|
Hello, from time to time i play a game, and sometimes when the game is too hard i download one of those trainer programs that alter certain memory locations so that you may have more health or experience or whatever. Now my question is how do they determine where the values are in memory and how are they changed?? i mean, dont the memory addresses change when the game is written in C or any higher level language when a variable is declared? How does a trainer spot the locations and alter them??
Thanks for any help
Kuniva
--------------------------------------------
|
|
|
|
|
This could be done many ways, depending on how the game/program was designed. They could be storing information in the registry, an XML file, their own file type....etc, I think you get the point.
If you have a *trainer* program, typically I would assume that the program knows where the *user data* is stored and then simply modifies it for you, that's all.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|