|
The process that spawns the new process has limited knowledge of what goes on afterward. If WaitForSingleObject() does not return for a long time then I suspect that the spawned process is not exiting.
Kuphryn
|
|
|
|
|
kuphryn wrote:
I suspect that the spawned process is not exiting.
Yes, that would be my assumption as well
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
HI.
Can someone tell what vectors are usauly used for and
what can be stored in them\Console app and WinApp.
I am a beginer can someone help me with this.
create vector of size 1000.
containing values 0.1,1.1.1.2,1.3,....,1.999;
display values in vector using the vector it self.
resize vector size 5.
empty out vector.
To pro's like you oaks this must be easy!
I did do but would like to see how someone else doe's it
just to make sure im wright.
maybe silly, but help me out pls.
lance
|
|
|
|
|
use the template class std::vector<t>, you can store anything by choosing the right T. It behaves pretty much like a C array . In your case, code could look like
#include <vector>
typedef std::vector< float > vector_f;
vector_f v(1000);
for (size_t i = 0;i<v.size();++i)
v[i] = ???
v.resize(5);
v.clear();
|
|
|
|
|
I have a simply question as well. Can vectors grow automatically?
|
|
|
|
|
Yes, use the push_back() member function:
i.e.:
std::vector<CMyClass> vMyVector;
for(int i=0; i<nElements; i++)
{
vMyVector.push_back(CMyClass(SomeCtorArgs...));
}
then use at() instead of []...
CMyClass mcTest = vMyVector.at(iSomeIndex);
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
how to read and get the cunks data in png file using vc++...
i've learn on pnglib.org i'm still dont understood any explain??
====================^_^
|
|
|
|
|
Many binary files formats are composed of chunks. It usually contains an ID header, the size of the chunk, then the data. If the data is constant length (contains no variable length strings), and integers are in right format you can just create a structure and read it directly into memory using raw reads.
|
|
|
|
|
How can I flash a window in a taskbar? Just like MSN or Yahoo messengers do when a new message arrives in a chat window.
Thanks
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
|
|
You are welcome
|
|
|
|
|
Take a look at FlashWindow() and FlashWindowEx()
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hello guys,
I am frequently using one WorkerThread in my application. It is starting using AfxBeginThread() function. When I run application from within IDE, debug window is also not showing any memory leake.
But when I run this application in Windows NT, its task manager shows memory usage going on increasing by time in chunk of 4 KB.
Can anybody show me the way to control this memory wastage.
Thanking You,
C.R.Naik
|
|
|
|
|
There are several possible reasons. One reason is that the threads do not terminate correctly. Another reason is that the process does not deallocate memory correctly.
Kuphryn
|
|
|
|
|
1. I have used "return 0;" statement to return from thread's controlling function and hence to terminate thread.
2. How can you make sure that the process deallocates memory correctly ?
Thanking You
C.R.Naik
|
|
|
|
|
Hello All,
I am trying to find a easy-to-understand way where I set up a handler that can detect changes to my windows screen. basically, whenever the screen changes, I want to be notified by Windows.
I know that I can tap in to windows hooks to do this, but I have not been able to understand the code too well.
Is there a simple tutorial that can guide me through this problem. TIA.
RGB
|
|
|
|
|
Hi all,
I am trying to make my ListView (displaying files) scroll without any flickering. But I cannot get it work. I tried for example putting GetListCtrl().SetRedraw(FALSE) and GetListCtrl().SetRedraw(TRUE) around CListView::OnKeyDown() call if key pressed was PAGE DOWN or PAGE UP, but it made things even worse.
For example this program does absolutely no flickers!
http://www.altap.cz/ftp/salamand/salen200.exe
Try scrolling eg. WINNT\System32 directory of any other directory with thousand of files with Page Down key held and you will see that.
How is this possible???
I am using virtual ListView.
Thank you for any suggestion!
|
|
|
|
|
Maybe you should do a search here at CP for articles by "Keith Rule" and see his CMemDC class.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
Thanks for your suggestion Colin. Unfortunately, CMemDC doesn't work for my CListView-derived class. CMyView::OnDraw() is never executed and returning FALSE in OnEraseBackground() casues my ListView not being updated and look ugly...Don't you know why?
Best regards,
Standa.
|
|
|
|
|
s_k wrote:
CMyView::OnDraw() is never executed
That's correct behaviour. View derived from CCtrlView never have their OnDraw() method called. You'll have to use OnPaint() instead.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
But how can I then use CMemDC class, when it needs CDC pointer to be passed to constructor?
|
|
|
|
|
void CMyList::OnPaint()
{
CPaintDC dc(this);
CMemDC memDC(&dc);
}
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you Ryan, it works. But, in fact, I don't know what to wirte into OnPaint() handler routine. I have just CListView that displays list of files on local drives and the only thing I wanted to achieve is to get rid of flickering while scrolling the content of ListView....
|
|
|
|
|
void CMyList::OnPaint()
{
CPaintDC dc(this);
CMemDC memDC(&dc);
DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);
} Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|