CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: VictorN

Search: Search took 0.49 seconds.

  1. Replies
    36
    Views
    14,529

    Re: Can't intialize C++ Struct with CString in it??

    Well, my VC++6.0 has SP6 installed.
    Besides there is also PSDK from February 2003.

    So I cannot test on the "clean" VC++6.0
  2. Replies
    36
    Views
    14,529

    Re: Can't intialize C++ Struct with CString in it??

    As I wrote you in the post#2 your struct needs a ctor.
    This code compiles in VC++6:
    #include "stdafx.h"

    #define COUNTOF(x) (sizeof(x)/sizeof(x[0]))

    struct print
    {
    int x; //row
    int y; //col
  3. Replies
    36
    Views
    14,529

    Re: Can't intialize C++ Struct with CString in it??

    Again you do not provide enough information about what and how "still won't compile"! Why?

    Well, I can guess that the problem is in Therre is no such a file in VC++6.0.
    In VC++6.0 you have to...
  4. Replies
    36
    Views
    14,529

    Re: Can't intialize C++ Struct with CString in it??

    Well, how could you "initialize" something that you do not have?
    There is no CString objects in your structure! There are only a pointer to CString!
    The answer for pointer is obvious: either you...
  5. Replies
    36
    Views
    14,529

    Re: Can't intialize C++ Struct with CString in it??

    I am answering your question which was:
    So my suggestion was to redesign your structure(s) because your initial design was wrong!

    BTW, what do you mean by "that's what the program calls for"?...
  6. Replies
    36
    Views
    14,529

    Re: Can't intialize C++ Struct with CString in it??

    You seem to not read the answers, instead just to go on your "trial & error" method.... :(
    Why in the world (of MFC!) do you need a plain array of your struct?
    Why do you still use a raw char...
  7. Replies
    36
    Views
    14,529

    Re: Can't intialize C++ Struct with CString in it??

    Well, what prevents you from implementing constructor in your struct?
    And not use CStringArray (or std::vector of CString objects) instead of CString*?
Results 1 to 7 of 7





Click Here to Expand Forum to Full Width

Featured