|
Arman Z. Sahakyan wrote: I don't see it is surprising.
well, i did find it a little surprising. I believe that most of the people learn programming starting with C/C++, which i still believe is the right approach.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
not at my school
The guy who is trying to teach programming is a disaster...
Stef
|
|
|
|
|
steffw wrote: The guy who is trying to teach programming is a disaster...
This is the scenario in most of the schools and collages i suppose.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
Like everyone said, C# and C++ are very different, you should work through a book even if you know a lot of stuff already.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
no problem, do you know a good book about it?
What are your experiences?
Stef
|
|
|
|
|
You just go through BOOK Programming in C++ Written by Balgurus wamy.
Avadhut
Software Developer
|
|
|
|
|
You just go through BOOK Programming in C++ Written by Balguruswamy.
Avadhut
Software Developer
|
|
|
|
|
Since you are used to programming, i can recommend you the following books (in no order of priority).
The C++ Programming Language - by Bjarne Stroustrup.
C++ - The Complete Reference.
C++ Primer - by Stanley Lippman and Josse Lajoie.
you can use any of the above book to start with.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
Avadhut_mane wrote: Programming in C++ Written by Balguruswamy.
Nah... i guess its good for beginners and not for someone who already has a programming experience.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
Thank you for the reply
i will consider it
Stef
|
|
|
|
|
|
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!!
|
|
|
|