|
Try Koenig/Moo "Accelerated C++" (Teaser here[^])
A little old, but your target isn't moving too fast....
Failure is not an option - it's built right in.
|
|
|
|
|
|
|
|
hmmm.. looks usefull!
Thanks!
Stef
|
|
|
|
|
You're welcome,learn it early;)
|
|
|
|
|
How do I add a bitmap to a MENU
|
|
|
|
|
See Here[^] & here.[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You just search BCMenu on google .You will get Project for Bitmap on Menu
Avadhut
Software Developer
|
|
|
|
|
Avadhut_mane wrote: search BCMenu on google
I think I saw BCMenu on the codeproject.;)
|
|
|
|
|
|
Hi All!
I have a Working Thread that send a message to the application by ::PostMessage, in parameter WPARAM a put it a pointer to a new class instace:
SEND CODE
UINT CServerSocket::ThreadPipe(LPVOID pParam)
{
.
.
.
while(*bContinue) {
EnterCriticalSection(&m_csPipeMsg);
.
.
.
pManageEventCommandData = new CGeneralData();
pManageEventCommandData->SetSocketAddress(*pSocketAddress);
pManageEventCommandData->SetEvent(EventQCDReceiveSocketACK);
::PostMessage(aHwnd,WM_USER_MANAGE_EVENT_COMMAND,(WPARAM)pManageEventCommandData,(LPARAM)0);
.
.
.
LeaveCriticalSection(&m_csPipeMsg);
::Sleep(200);
}
.
.
.
}
RECEIVE CODE
When I receive message the class instance is delete
LRESULT CMainFrame::OnManageEventCommand(WPARAM wParam, LPARAM lParam)
{
int nManageEventResult;
CString sMessage;
CGeneralData* pManageEventCommandData= reinterpret_cast<CGeneralData*>(wParam);
if( pManageEventCommandData == NULL )
return 0;
if( pManageEventCommandData != NULL ) {
delete pManageEventCommandData;
pManageEventCommandData = NULL;
}
return 0;
}
This work fine, but the problem is......sometimes when I close the application I see memoryleaks,
I think that the problem is legacy to the fact that the PostMessage does not come received and the class remains allotted...but I not sure...
Any Idea
Thanks in advance
Too many plans make the health badly!!
|
|
|
|
|
This work fine, but the problem is......sometimes when I close the application I see memoryleaks,
I think that the problem is legacy to the fact that the PostMessage does not come received and the class remains allotted...but I not sure...
I guess you are right unless there are no other places where you do new/delete. To make yourself sure of what happening I advise you to put TRACEs inside CGeneralData's ctor and dtor, and observe them; they should have been called equally. Anyway, there is a synchronization gap in the way the two threads communicate. Another level of uncertainty is caused by PostMessage which simply enqueues the message which some time later it will have been processed [actually between this duration you close the app and the message will not've been processed; thus there'd be a leak].
Another issue is the looping inside ThreadPipe; this worker thread should exit when the UI thread exits. So use CEvent to inform to the worker thread from the UI one. See here[^] for more details. In this case, when you garrantee that the worker thread will get known about the fact app exits, it would be possible to overcome the memory leak by not posting but sending (using SendMessage). But this may harm the functional logic of the app. And I am pretty sure there is no obvious solution to this situation.
If you redesign it, you could omit the 'new' inside the worker thread and do it inside the ui one; just post a message and let the ui thread do the new/delete part.
--
=====
Arman
|
|
|
|
|
I cannot use the SendMessage but thanks same...
I read the article that you have subordinate to me…
Too many plans make the health badly!!
|
|
|
|
|
Catch the WM_CLOSE message in your mainframe class and use PeekMessage to find any unprocessed WM_USER_MANAGE_EVENT_COMMAND in the message queue. If / when you find one, don't do any processing, just delete the pointer in the message.
Judy
|
|
|
|
|
Good idea…
It seems to work… I will make other tests....
Thanks
Too many plans make the health badly!!
|
|
|
|
|
I want to get certify in vc++(MCP).I want to know the pattern of MCP for VC++ can anybody help me.My email id is tasumisra@gmail.com please guide me..
Thanks in advance
vikas
|
|
|
|
|
vikas1982 wrote: I want to get certify in vc++(MCP).
This certification has been discontinued by MS long back.
Prasad
MS MVP - VC++
|
|
|
|
|
I think he is pretty late to have decided on doing a course.
found at bash.org
[kernx]|.|.|.|.|.|.|.|
[kernx]sorry, wrong window
[beox33]say me why in the f*ck will you type that in any window
|
|
|
|
|
Yes, late by few years.
Prasad
MS MVP - VC++
|
|
|
|
|
Hello,
Mr.prasad_som and brahmma ,I think you two guys has joined the community just for fun and getting toffies ,if u cant help others then atleast dont laugh on others quetion.
Thanks
vikas
|
|
|
|
|
Dear Vikas,
I wonder, why you have directed this post to me.
First, understand the rules/notations of the community. How it is organized ? Refer FAQ's wherever possible.
vikas1982 wrote: I think you two guys has joined the community just for fun
I'm not sure about Brahma, but, you are right, I've joined this comminity for fun. And pleasure, that I get, while helping others. And in your case, I've answered you correctly( that exam you are talking is discontinued long back). Learn to appreciate others for their time.
About discussion,in me and brahma; you should understand, such discussions happens between CP regulars, who know know each other very well, and are not directed to original poster. And ofcourse , you have not seen joke icon his post.
So, before looking for my intention on this site or others, learn to follow forum rules. Because, nobody is paid or obliged to answer you here.
Prasad
MS MVP - VC++
|
|
|
|
|
Thanks Mr Prasad.....Now onwards I ll follow the rules
Thanks
Vikas
|
|
|
|
|
Didn't you see the Joke Icon attached to the Reply??
vikas1982 wrote: if u cant help others..
They actually did help you. Didn't they?
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
vikas1982 wrote: Mr.prasad_som and brahmma ,I think you two guys has joined the community just for fun and getting toffies
1. We can have a lot of fun here, there isn't a damn thing wrong about it.
2. Nobody is giving out toffees here.
3. Why would you page prasad, when you had to tell something to me? Moreover, Prasad actually helped you. He had let you know that the exam you've been looking for is discontinued.
4. You need some sense of humor. With your post count of 5, I can tell that you don't know a thing about what this community is.
5. You did not notice the joke icon in my post and I wasn't joking to you. I know Prasad well, so please be courteous and don't make much fuss when it isn't required.
6. See David Crows reply. That takes you to the MCP examination information page at Microsoft website.
7. If you criticize me, that is okay. But, for your information, Prasad is a Microsoft MVP and his contributions to the community are very valuable.
Anything I will say you will bring it down to whatever you want.
|
|
|
|