Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Hashtables Pin
RChin31-Dec-05 18:57
RChin31-Dec-05 18:57 
GeneralRe: Hashtables Pin
John R. Shaw31-Dec-05 20:13
John R. Shaw31-Dec-05 20:13 
AnswerRe: Hashtables Pin
Michael Dunn31-Dec-05 19:04
sitebuilderMichael Dunn31-Dec-05 19:04 
GeneralRe: Hashtables Pin
Prakash Nadar31-Dec-05 19:39
Prakash Nadar31-Dec-05 19:39 
GeneralRe: Hashtables Pin
Michael Dunn1-Jan-06 8:00
sitebuilderMichael Dunn1-Jan-06 8:00 
AnswerRe: Hashtables Pin
John R. Shaw31-Dec-05 20:43
John R. Shaw31-Dec-05 20:43 
AnswerRe: Hashtables Pin
Prakash Nadar31-Dec-05 20:56
Prakash Nadar31-Dec-05 20:56 
AnswerRe: Hashtables--More Info on Original Question Pin
jblau31-Dec-05 21:23
jblau31-Dec-05 21:23 
wow, I am surprised at how many people responded, thanks everyone!

Here is some more information which might allow you guys to set me straight.

I am using Visual Studio.net 2003
The type of project that I opened is a "Windows Form Application (.Net)"
(so I don't know if that means that I am using "Normal" or "Managed" C++ ?)

My code is something like this:

void LoadLists()
{
Hashtable *hashSelectedItems = new Hashtable;

......(code working with the hashtable)

delete hashSelectedItems;
hashSelectedItems = NULL;
}

When I try to build the project, I get this error message: error C3841: illegal delete expression: managed type 'System::Collections::Hashtable' does not have a destructor defined


I'm thinking that perhaps it is, as one of you mentioned, being automatically managed, but I'm not certain.
It was my impression that if I wanted to use a Managed object I would specifiy so in the declaration, for example, in declaring an array, if I wanted it to be a managed array I would declare it like so: int c __gc[] = new int __gc[12]; but if I didn't want it Managed, I would leave out the __gc part.

************So given all of this, what do I need to know about declaring Hashtables without leaving any memory leaks?
Thanks,
Jody Blau

GeneralRe: Hashtables--More Info on Original Question Pin
John R. Shaw31-Dec-05 22:22
John R. Shaw31-Dec-05 22:22 
GeneralRe: Hashtables--More Info on Original Question Pin
Gary R. Wheeler1-Jan-06 1:51
Gary R. Wheeler1-Jan-06 1:51 
GeneralRe: Hashtables--More Info on Original Question Pin
John R. Shaw1-Jan-06 9:02
John R. Shaw1-Jan-06 9:02 
GeneralRe: Hashtables--More Info on Original Question Pin
Prakash Nadar1-Jan-06 4:25
Prakash Nadar1-Jan-06 4:25 
GeneralRe: Hashtables--More Info on Original Question Pin
Michael Dunn1-Jan-06 8:07
sitebuilderMichael Dunn1-Jan-06 8:07 
AnswerRe: Hashtables--One More Follow Up Pin
jblau1-Jan-06 9:49
jblau1-Jan-06 9:49 
GeneralRe: Hashtables--One More Follow Up Pin
Prakash Nadar1-Jan-06 17:44
Prakash Nadar1-Jan-06 17:44 
QuestionCButton displayes dark edge after first click Pin
spiritofklanawa31-Dec-05 14:23
spiritofklanawa31-Dec-05 14:23 
AnswerRe: CButton displayes dark edge after first click Pin
Prakash Nadar31-Dec-05 16:55
Prakash Nadar31-Dec-05 16:55 
AnswerRe: CButton displayes dark edge after first click Pin
dipuks31-Dec-05 16:58
dipuks31-Dec-05 16:58 
AnswerRe: CButton displayes dark edge after first click Pin
Michael Dunn31-Dec-05 19:06
sitebuilderMichael Dunn31-Dec-05 19:06 
GeneralRe: CButton displayes dark edge after first click Pin
spiritofklanawa10-Jan-06 6:29
spiritofklanawa10-Jan-06 6:29 
QuestionHow to add new thread to CDialog Pin
dipuks31-Dec-05 11:09
dipuks31-Dec-05 11:09 
AnswerRe: How to add new thread to CDialog Pin
Prakash Nadar31-Dec-05 16:52
Prakash Nadar31-Dec-05 16:52 
Questiongetting filename Pin
RabiaAslam31-Dec-05 9:15
RabiaAslam31-Dec-05 9:15 
AnswerRe: getting filename Pin
Michael Dunn31-Dec-05 10:42
sitebuilderMichael Dunn31-Dec-05 10:42 
QuestionApplication in a system tray Pin
RabiaAslam31-Dec-05 9:13
RabiaAslam31-Dec-05 9:13 

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.