Click here to Skip to main content
15,909,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MDI Document with data from UDP Pin
schultz.tom11-Mar-05 12:21
schultz.tom11-Mar-05 12:21 
GeneralCreating MDI Child windows Pin
laiju10-Mar-05 22:37
laiju10-Mar-05 22:37 
QuestionHow to set background colours for texts in a treeCtrl or CTreeView? Pin
AnoopVarma10-Mar-05 21:36
AnoopVarma10-Mar-05 21:36 
AnswerRe: How to set background colours for texts in a treeCtrl or CTreeView? Pin
Mircea Puiu11-Mar-05 5:05
Mircea Puiu11-Mar-05 5:05 
GeneralExecution timing issue Pin
marco.marsella10-Mar-05 21:21
marco.marsella10-Mar-05 21:21 
GeneralRe: Execution timing issue Pin
Branislav11-Mar-05 2:00
Branislav11-Mar-05 2:00 
GeneralEditable Print Preview Pin
henky_arektc9710-Mar-05 20:53
henky_arektc9710-Mar-05 20:53 
GeneralQuick and dirty C++ managed memory Pin
Ron Waller10-Mar-05 18:11
Ron Waller10-Mar-05 18:11 
Why not have the "new" operator return a typed handle when you get memory on the heap (if you want it to)? And then use a "lock" operator to get a pointer to the memory, and the pointer is only valid within the scope of the function. Then on idle time, all memory is unlocked and can be compacted.

I wonder if there is a way of doing this by overiding the global new and delete operators and somehow checking for handle types?

In any case I think it would be better if the compiler was in on the action.

For instance you could declare a handle:

char* # hString;

hString = new char[80];

char* pString = lock hString;

strcpy( pString, "A String");

int len = strlen( pString );


And when you want to free the memory:

delete [] hString;


And when calling a member function:

CThisObject* # hThis = new CThisObject( data );

if( hThis )

hThis->DoThat();


is the same as:

CThisObject* # hThis = new CThisObject( data );

if( hThis )
{
CThisObject* p = lock hThis;

p->DoThat();
}

In any case, I'm sure die-hard C++ programmers would prefer managed memory along these lines instead of all the crap you have to deal with in .NET managed C++.

Generalsave BMP to JPG Pin
kd834110-Mar-05 17:32
kd834110-Mar-05 17:32 
GeneralRe: save BMP to JPG Pin
V.10-Mar-05 21:09
professionalV.10-Mar-05 21:09 
GeneralRe: save BMP to JPG Pin
kd834111-Mar-05 4:15
kd834111-Mar-05 4:15 
GeneralRe: save BMP to JPG Pin
Mircea Puiu11-Mar-05 4:34
Mircea Puiu11-Mar-05 4:34 
GeneralRe: save BMP to JPG Pin
Chris Losinger11-Mar-05 6:18
professionalChris Losinger11-Mar-05 6:18 
GeneralVirtual Destructor Pin
Neelesh K J Jain10-Mar-05 17:09
Neelesh K J Jain10-Mar-05 17:09 
GeneralRe: Virtual Destructor Pin
Serge Krynine10-Mar-05 17:25
Serge Krynine10-Mar-05 17:25 
GeneralRe: Virtual Destructor Pin
Cedric Moonen10-Mar-05 20:55
Cedric Moonen10-Mar-05 20:55 
QuestionHow to control mouse to select area ? Pin
RobertHuang10-Mar-05 15:49
RobertHuang10-Mar-05 15:49 
QuestionOleLoadFromStream?? Pin
Anonymous10-Mar-05 11:09
Anonymous10-Mar-05 11:09 
Generalplease help me Pin
ali elba10-Mar-05 10:57
sussali elba10-Mar-05 10:57 
GeneralRe: please help me Pin
David Crow11-Mar-05 4:59
David Crow11-Mar-05 4:59 
GeneralRe: please help me Pin
Anonymous11-Mar-05 6:57
Anonymous11-Mar-05 6:57 
GeneralRe: please help me Pin
David Crow11-Mar-05 7:25
David Crow11-Mar-05 7:25 
GeneralVisual C++.Net Pin
jogodo10-Mar-05 10:16
jogodo10-Mar-05 10:16 
GeneralRe: Visual C++.Net Pin
Serge Krynine10-Mar-05 12:49
Serge Krynine10-Mar-05 12:49 
QuestionHiw can I make "Visual C++ 6 Components"? Pin
Behzad Ebrahimi10-Mar-05 9:55
Behzad Ebrahimi10-Mar-05 9:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.