Click here to Skip to main content
15,883,928 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help me to convert all to C++ (stdio.h) Pin
Victor Nijegorodov7-Jul-21 4:30
Victor Nijegorodov7-Jul-21 4:30 
AnswerRe: Help me to convert all to C++ (stdio.h) Pin
Dave Kreskowiak7-Jul-21 5:46
mveDave Kreskowiak7-Jul-21 5:46 
AnswerRe: Help me to convert all to C++ (stdio.h) Pin
Maximilien7-Jul-21 9:41
Maximilien7-Jul-21 9:41 
AnswerRe: Help me to convert all to C++ (stdio.h) Pin
Stefan_Lang7-Jul-21 21:16
Stefan_Lang7-Jul-21 21:16 
QuestionBase types and pointer arrays Pin
Richard Andrew x645-Jul-21 18:26
professionalRichard Andrew x645-Jul-21 18:26 
AnswerRe: Base types and pointer arrays Pin
Daniel Pfeffer5-Jul-21 20:56
professionalDaniel Pfeffer5-Jul-21 20:56 
GeneralRe: Base types and pointer arrays Pin
Richard Andrew x646-Jul-21 3:55
professionalRichard Andrew x646-Jul-21 3:55 
AnswerRe: Base types and pointer arrays Pin
Richard MacCutchan5-Jul-21 20:59
mveRichard MacCutchan5-Jul-21 20:59 
What are the definitions of CGsTypeBase and CGsUCharType?

[edit]
I built this short program and it compiled and linked successfully:
C++
struct CGsTypeBase
{
    char foo[8];
};
struct CGsUCharType : CGsTypeBase
{
    wchar_t foo[8];
};

struct CGsUShortType : CGsTypeBase
{
    uint16_t foo[8];
};
struct CGsULongType : CGsTypeBase
{
    long foo[8];
};


int main(
    int		argc,
	char*   argv[]
	)
{
    int m_MemberCount = 7;

    CGsUCharType* m_s_b1 = new CGsUCharType();  // All of these "Type" classes are derived from CGsTypeBase
    CGsUCharType* m_s_b2 = new CGsUCharType();
    CGsUCharType* m_s_b3 = new CGsUCharType();
    CGsUCharType* m_s_b4 = new CGsUCharType();

    CGsUShortType* m_s_w1 = new CGsUShortType();
    CGsUShortType* m_s_w2 = new CGsUShortType();
    CGsULongType* m_S_addr = new CGsULongType();

    CGsTypeBase** m_Members = new CGsTypeBase*[m_MemberCount]; // Yes, this is the correct way to create an array of pointers

    m_Members[0] = m_s_b1;
    m_Members[1] = m_s_b2; // No warnings here
    m_Members[2] = m_s_b3;
    m_Members[3] = m_s_b4;
    m_Members[4] = m_s_w1;
    m_Members[5] = m_s_w2;
    m_Members[6] = m_S_addr;

	return 0;
}

So how does that differ from your code?

[/edit]

modified 6-Jul-21 3:54am.

GeneralRe: Base types and pointer arrays Pin
Richard Andrew x646-Jul-21 3:56
professionalRichard Andrew x646-Jul-21 3:56 
AnswerRe: Base types and pointer arrays Pin
CPallini5-Jul-21 21:03
mveCPallini5-Jul-21 21:03 
GeneralRe: Base types and pointer arrays Pin
Richard Andrew x646-Jul-21 3:57
professionalRichard Andrew x646-Jul-21 3:57 
AnswerRe: Base types and pointer arrays Pin
jschell17-Jul-21 10:09
jschell17-Jul-21 10:09 
GeneralRe: Base types and pointer arrays Pin
Richard Andrew x6417-Jul-21 13:39
professionalRichard Andrew x6417-Jul-21 13:39 
QuestionLiteral for a short Pin
Richard Andrew x645-Jul-21 11:47
professionalRichard Andrew x645-Jul-21 11:47 
AnswerRe: Literal for a short Pin
Greg Utas5-Jul-21 12:24
professionalGreg Utas5-Jul-21 12:24 
GeneralRe: Literal for a short Pin
Richard Andrew x645-Jul-21 12:55
professionalRichard Andrew x645-Jul-21 12:55 
QuestionDebug Application from Service Pin
Richard Andrew x643-Jul-21 14:16
professionalRichard Andrew x643-Jul-21 14:16 
AnswerRe: Debug Application from Service Pin
Daniel Pfeffer3-Jul-21 17:24
professionalDaniel Pfeffer3-Jul-21 17:24 
AnswerRe: Debug Application from Service Pin
Richard MacCutchan3-Jul-21 21:11
mveRichard MacCutchan3-Jul-21 21:11 
AnswerRe: Debug Application from Service Pin
Joe Woodbury4-Jul-21 17:14
professionalJoe Woodbury4-Jul-21 17:14 
GeneralRe: Debug Application from Service Pin
Richard Andrew x645-Jul-21 6:25
professionalRichard Andrew x645-Jul-21 6:25 
QuestionMultiple view ports in single window using opengl and c++ Pin
Member 107421151-Jul-21 23:15
Member 107421151-Jul-21 23:15 
SuggestionRe: Multiple view ports in single window using opengl and c++ Pin
CHill601-Jul-21 23:16
mveCHill601-Jul-21 23:16 
AnswerRe: Multiple view ports in single window using opengl and c++ Pin
Richard MacCutchan1-Jul-21 23:59
mveRichard MacCutchan1-Jul-21 23:59 
QuestionNative VS Debugger Question - SOLVED Pin
Richard Andrew x6428-Jun-21 10:39
professionalRichard Andrew x6428-Jun-21 10:39 

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.