Click here to Skip to main content
15,908,675 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Radio Buttons, Lots of them Pin
golfbird8-Sep-15 13:46
golfbird8-Sep-15 13:46 
AnswerRe: Radio Buttons, Lots of them Pin
Peter Leow8-Sep-15 4:56
professionalPeter Leow8-Sep-15 4:56 
AnswerRe: Radio Buttons, Lots of them Pin
David Crow8-Sep-15 9:13
David Crow8-Sep-15 9:13 
GeneralRe: Radio Buttons, Lots of them Pin
golfbird8-Sep-15 9:33
golfbird8-Sep-15 9:33 
QuestionCreate CBitmap from another CBitmap Pin
_Flaviu3-Sep-15 1:49
_Flaviu3-Sep-15 1:49 
AnswerRe: Create CBitmap from another CBitmap Pin
Jochen Arndt3-Sep-15 2:23
professionalJochen Arndt3-Sep-15 2:23 
GeneralRe: Create CBitmap from another CBitmap Pin
_Flaviu3-Sep-15 22:29
_Flaviu3-Sep-15 22:29 
QuestionWriting a Generic Function Pin
Donguy19762-Sep-15 12:17
Donguy19762-Sep-15 12:17 
XML
I have 3 functions that do sorting on a CArray.

CArrays are declared in header file:

CArray<int*, int*>m_Integer;
CArray<string*, string*>m_String;
CArray<double*, double*>m_Double;

void sortIntegers()
{

// Do sorting for m_Integer here
}

void sortStrings()
{
// DO sorting for m_String
}

void sortDouble()
{
// Do sorting for m_Double
}

Now what i want to do is, have one generic function and then pass the CArray to that.

So far what i did is,

in Header file:

void sortAll(CArray<void*, void*> m_Array);

in CPP file:

void sortAll(CArray<void*, void*> m_Array)
{
    int size = m_Array.GetSize();

    ............
    ............
    ............

    m_Array.GetAt(0); // Error here
    ................
    ................
}

The error is that, it needs a class type and not a void type.

I am not sure how to proceed with writing a generic function to handle all different data types in one.

Any help is welcome!

AnswerRe: Writing a Generic Function Pin
Richard MacCutchan2-Sep-15 21:06
mveRichard MacCutchan2-Sep-15 21:06 
Questionproblems with std::bind in VS2015 Pin
Member 85340352-Sep-15 5:11
Member 85340352-Sep-15 5:11 
QuestionCFileDialog strange GetFileName Pin
_Flaviu1-Sep-15 23:18
_Flaviu1-Sep-15 23:18 
AnswerRe: CFileDialog strange GetFileName Pin
Jochen Arndt2-Sep-15 0:10
professionalJochen Arndt2-Sep-15 0:10 
GeneralRe: CFileDialog strange GetFileName Pin
_Flaviu2-Sep-15 0:58
_Flaviu2-Sep-15 0:58 
QuestionSet focus automatically to the last focus item after clossinga modal dialog Pin
aks.1-Sep-15 22:02
aks.1-Sep-15 22:02 
QuestionRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan2-Sep-15 2:55
mveRichard MacCutchan2-Sep-15 2:55 
AnswerRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.3-Sep-15 2:36
aks.3-Sep-15 2:36 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan3-Sep-15 3:42
mveRichard MacCutchan3-Sep-15 3:42 
QuestionRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
David Crow3-Sep-15 4:54
David Crow3-Sep-15 4:54 
AnswerRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.7-Sep-15 4:07
aks.7-Sep-15 4:07 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan7-Sep-15 6:50
mveRichard MacCutchan7-Sep-15 6:50 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.8-Sep-15 22:23
aks.8-Sep-15 22:23 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan8-Sep-15 22:27
mveRichard MacCutchan8-Sep-15 22:27 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.9-Sep-15 7:16
aks.9-Sep-15 7:16 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan9-Sep-15 7:49
mveRichard MacCutchan9-Sep-15 7:49 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
David Crow9-Sep-15 9:33
David Crow9-Sep-15 9:33 

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.