Click here to Skip to main content
15,892,809 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Cross application process Handle Pin
SNI3-Jul-07 20:44
SNI3-Jul-07 20:44 
GeneralRe: Cross application process Handle Pin
Stephen Hewitt3-Jul-07 20:48
Stephen Hewitt3-Jul-07 20:48 
GeneralRe: Cross application process Handle Pin
SNI3-Jul-07 21:10
SNI3-Jul-07 21:10 
GeneralRe: Cross application process Handle Pin
Naveen3-Jul-07 21:10
Naveen3-Jul-07 21:10 
GeneralRe: Cross application process Handle [modified] Pin
SNI3-Jul-07 23:46
SNI3-Jul-07 23:46 
QuestionFind computers Pin
IMANTHA3-Jul-07 19:38
IMANTHA3-Jul-07 19:38 
AnswerRe: Find computers Pin
Naveen3-Jul-07 20:03
Naveen3-Jul-07 20:03 
QuestionSorting a user class based CArray Pin
al25003-Jul-07 19:31
al25003-Jul-07 19:31 
Hi,

I know how to sort simple int or String based Carrays using qsort but I'd like to sort a CArray that is composed of a class with mixed variable types. Also, I'd like to sort the CArray based on one member of the base class and have the other members maintain their original association, ie.,

class CMyClass : public CObject
{
int m_A;
double m_B;
CString m_C;
}

CArray <cmyclass, cmyclass&=""> MyClassArray;

as an example say the members in MyClassArray are:

m_A, m_B, m_C
2 2.4 HI
1 5.6 BYE
4 8.3 NO

after sorting on the int field the sorted CArray would look like-


m_A, m_B, m_C
1 5.6 BYE
2 2.4 HI
4 8.3 NO


There is an articleon this site, "QuickSort enabled CArray template class" which describes sorting of user defined class members but it appears to sort the column selected independently without reordering the associated elements.

A very "inelegant" way of doing this would be to copy the sort field to a simple CArray, sort it and then locate the elements in the original array that correspond with the sorted elemnts and rebuild the complex array. I'm hoping there is better way.

Thanks
AnswerRe: Sorting a user class based CArray Pin
Stephen Hewitt3-Jul-07 19:55
Stephen Hewitt3-Jul-07 19:55 
QuestionMy registered activex control is corrupted or missing. Pin
adityarao313-Jul-07 18:35
adityarao313-Jul-07 18:35 
QuestionRTTI option in compiler Pin
vibindia3-Jul-07 17:30
vibindia3-Jul-07 17:30 
AnswerRe: RTTI option in compiler Pin
User 5838523-Jul-07 17:36
User 5838523-Jul-07 17:36 
AnswerRe: RTTI option in compiler Pin
Rajkumar R3-Jul-07 18:22
Rajkumar R3-Jul-07 18:22 
AnswerRe: RTTI option in compiler Pin
Stephen Hewitt3-Jul-07 18:24
Stephen Hewitt3-Jul-07 18:24 
QuestionA Fast Bresenham Type Algorithm For Drawing Ellipse Pin
KienNT783-Jul-07 17:20
KienNT783-Jul-07 17:20 
AnswerRe: A Fast Bresenham Type Algorithm For Drawing Ellipse Pin
Rajkumar R3-Jul-07 19:22
Rajkumar R3-Jul-07 19:22 
GeneralRe: A Fast Bresenham Type Algorithm For Drawing Ellipse [modified] Pin
KienNT783-Jul-07 20:53
KienNT783-Jul-07 20:53 
Questionmonitoring user connections in my PC Pin
m-a-s-a-k-i-t-o-n3-Jul-07 15:35
m-a-s-a-k-i-t-o-n3-Jul-07 15:35 
QuestionRe: monitoring user connections in my PC Pin
David Crow3-Jul-07 18:10
David Crow3-Jul-07 18:10 
AnswerRe: monitoring user connections in my PC Pin
m-a-s-a-k-i-t-o-n3-Jul-07 22:16
m-a-s-a-k-i-t-o-n3-Jul-07 22:16 
QuestionCustom Vector Allocator Pin
miketra3-Jul-07 10:04
miketra3-Jul-07 10:04 
AnswerRe: Custom Vector Allocator Pin
Maximilien3-Jul-07 10:31
Maximilien3-Jul-07 10:31 
GeneralVector Function erase() Pin
miketra3-Jul-07 10:55
miketra3-Jul-07 10:55 
GeneralRe: Vector Function erase() Pin
Stephen Hewitt3-Jul-07 13:59
Stephen Hewitt3-Jul-07 13:59 
QuestionHow to prevent CMainFrame from restores???? Pin
SandipG 3-Jul-07 9:22
SandipG 3-Jul-07 9:22 

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.