|
no,its a long process...it takes 3 to 4 mins
Raja
|
|
|
|
|
It sounds as though your long process is taking up all of the CPU such that the first SetPaneText() does not get a chance to paint (i.e., the WM_PAINT message has not been processed).
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
so ...what should be done to slove this problem???i need the gui updates to be shown along with the process
Raja
|
|
|
|
|
Mohanraj D wrote: so ...what should be done to slove this problem
I would use a secondary (worker) thread to do the work. That way the primary thread can remain responsive and handle painting.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Friends,
Can I do something like this ? Is it portable across all platforms ?
<br />
int* ptr = new int();<br />
int& tmp = *ptr;<br />
delete &tmp;<br />
|
|
|
|
|
I am not sure about portability issue but is there any specific reason to do this? These kind of smart-ass statements makes code harder to read and maintain.
-Saurabh
|
|
|
|
|
My design of stuff is another issue.
Basic question here is
- is this a standard practice?
- Are there any issues?
|
|
|
|
|
It mostly depend if you are interested in generic programming and in having value vs pointer semantics.
until &*&x == &x whatever x, than what you did is true.
Of course if x overloads * and/or &, things may be not be as expected, but sometime this is wanted by certain generic algorithms.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
vikrams wrote: int* ptr = new int();
int& tmp = *ptr;
delete &tmp;
Another hint for not to be in trouble - if you delete by using reference, then the ptr variable will become a dangling pointer.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
M making a search application in that m using SHBrowseForFolder, while running the application, when we click on the BRowse button second time then i want the previous folder(which we selected when we pressed first time) should come as selected. But now Mycomputer is coming selected everytime i click the Browse button.
Please someone tell me how to do.
This is my current code
void CTestingDlg::OnBrowse() { BROWSEINFO bi; TCHAR szDir[MAX_PATH]; LPITEMIDLIST pidl;
|
|
|
|
|
Hi,
I am not sure there may be some standard method, but you can save the previously opened folder path in an INI file.
When open dialog next time, initialize BROWSEINFO->pidlRoot to the previously opened folder path from INI file.
Hope you got some idea..
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Most applications use registry to get the last file that was opened. You can then use a parameter in BrowseInfo to open the previously selected folder.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi all,
Now I m using VC++ 2005,i want to use keyboard fast asseccing on Button control, how can i do this?
When i m using the VC++ 2006 then there i m using & with the caption of button and the access of that button with the help of assigning buttons.
But it is not working in VC++ 2005.
Please help me for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
Expecting good explanation
|
|
|
|
|
|
The size of object of a class that contains int variable is 4bytes then why the size of class 1byte is not considered along with 4bytes?.
|
|
|
|
|
I don't quite understand what you are asking? But I will make a guess. You are saying that a class containing since int will have objects of size 4 bytes. Then why does empty class takes 1 byte instead of 4 bytes? Because 1 byte is enough for the purpose of differentiating two objects of an empty class. So why use 4 bytes and waste 3 bytes per object?
-Saurabh
|
|
|
|
|
My previous question is not so clear, let me clear my doubt here
class A
{
};
class B
{
int k;
};
int main()
{
A a;
int i = sizeof(a); -----> the value of i is 1byte
B b;
int j = sizeof(b); -----> the value of j is 4bytes
return 0;
}
why the value of j is 4bytes why not 5 bytes[size of int variable(4bytes) + size of class(1byte))
|
|
|
|
|
class objects have to have non zero memory size.
In case of class A it is empty since compiler cant determinne the size it will allocate minimum allocation unit i.e. 1 byte for its object.
In case of class B it has int variable so compiler knows its size and hence will allocate appropriate size i.e 4 bytes for int for its object.
Regards,
Sandip.
|
|
|
|
|
Because class B now has data, and doesn't need to insert a byte to maintain memory integrity.
|
|
|
|
|
|
Kwanalouie wrote: The problem I have is that when the cursor is at the top of the client window and I click the right mouse button, the value of point.y is around 72 instead of zero. When I use this same code in the OnLeftMouseDown routine, the value of point.y at the top of the Client window is zero.
Because OnContextMenu point parameter is in screen co-ordinates and your right click handler point is in client co-ordinates so call ClientToScreen/MapWindowPoints to convert to screen co-ordinates. That's why it's zero in right click handler and 72 in context menu handler.
From MSDN for OnContextMenu point parameter
Position of the cursor, in screen coordinates, at the time of the mouse click.
From MSDN for OnLButtonDown point parameter
Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
modified on Thursday, June 5, 2008 11:52 PM
|
|
|
|
|
Thanks a lot. That did the trick!
|
|
|
|
|
Which one and can it be done taking VS 6.0 C++ code and bringing it into one of the new VS 2xxx versions? We would like not to recode at this time and just import/rebuild under the newer environments.
Any problems with doing this?
thanks
|
|
|
|