Click here to Skip to main content
16,011,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Funny C++ Pin
Tim Smith20-Feb-04 4:31
Tim Smith20-Feb-04 4:31 
GeneralRe: Funny C++ Pin
jbarton20-Feb-04 3:22
jbarton20-Feb-04 3:22 
Questionhow to open file Pin
Goh Hui Beng20-Feb-04 0:24
Goh Hui Beng20-Feb-04 0:24 
AnswerRe: how to open file Pin
rw10420-Feb-04 1:56
rw10420-Feb-04 1:56 
GeneralRe: how to open file Pin
Goh Hui Beng20-Feb-04 5:20
Goh Hui Beng20-Feb-04 5:20 
GeneralRe: how to open file Pin
rw10420-Feb-04 5:44
rw10420-Feb-04 5:44 
GeneralRe: how to open file Pin
Goh Hui Beng21-Feb-04 16:22
Goh Hui Beng21-Feb-04 16:22 
Generalvector<CString> *pvecString ?? :confused: Pin
Nirav Doshi19-Feb-04 23:30
Nirav Doshi19-Feb-04 23:30 
Hello,

I'm trying the following code in an MFC project, which is causing a compiler error. I hope you can guide me with any error/mistake in my code:

My Code:
...
#include <MyClass.h>
#include <vector>
...
vector<CString> *g_pvecStrings;
...
void g_MyOtherFunction(void);           // Global Function Prototype
...
void CMyClass::MyFunction(void)
{
    vector<CString> vecStrings;
    ...
/// Both the statements below are causing different compiler errors.
    g_pvecStrings = vecStrings;         // :confused:       // (1)
//  g_pvecStrings = &vecStrings;        //  :~
    ...
    g_MyOtherFunction();
    ...
    vecStrings.clear();
}

void g_MyOtherFunction(void)
{
    CString csMyStr;
    ...                                  // Filling the csMyStr
    g_pvecStrings->push_back(csMyStr);
    ...
}


The MSVC++ 6.0 (SP5) compiler error for the statement marked as (1) above:
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class std::vector<class CString,class std::allocator<class CString> >' (or there is no acceptable conversion)


Please reply on this...

Thanks,
Rgds,

Nirav Doshi

* Don't wish it was easier, wish you were better! *
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
Andrew Walker19-Feb-04 23:34
Andrew Walker19-Feb-04 23:34 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
Nirav Doshi19-Feb-04 23:43
Nirav Doshi19-Feb-04 23:43 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
Henrik Stuart20-Feb-04 0:03
Henrik Stuart20-Feb-04 0:03 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
Nirav Doshi20-Feb-04 1:52
Nirav Doshi20-Feb-04 1:52 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
John M. Drescher20-Feb-04 2:44
John M. Drescher20-Feb-04 2:44 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
Nirav Doshi20-Feb-04 3:51
Nirav Doshi20-Feb-04 3:51 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
Tim Smith20-Feb-04 4:37
Tim Smith20-Feb-04 4:37 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
Robert A. T. Káldy20-Feb-04 6:52
Robert A. T. Káldy20-Feb-04 6:52 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
Nirav Doshi20-Feb-04 7:24
Nirav Doshi20-Feb-04 7:24 
GeneralRe: vector&lt;CString&gt; *pvecString ?? :confused: Pin
John M. Drescher24-Feb-04 16:15
John M. Drescher24-Feb-04 16:15 
GeneralProblem with jpg Pin
Jay.Jay19-Feb-04 22:47
Jay.Jay19-Feb-04 22:47 
Generalassembly and c++ code problem please help Pin
dj_felix19-Feb-04 22:12
dj_felix19-Feb-04 22:12 
GeneralRe: assembly and c++ code problem please help Pin
Maxwell Chen19-Feb-04 22:23
Maxwell Chen19-Feb-04 22:23 
GeneralRe: assembly and c++ code problem please help Pin
Anonymous19-Feb-04 22:37
Anonymous19-Feb-04 22:37 
GeneralRe: assembly and c++ code problem please help Pin
Maxwell Chen19-Feb-04 22:49
Maxwell Chen19-Feb-04 22:49 
GeneralRe: assembly and c++ code problem please help Pin
Anonymous19-Feb-04 23:37
Anonymous19-Feb-04 23:37 
GeneralRe: assembly and c++ code problem please help Pin
John M. Drescher20-Feb-04 2:46
John M. Drescher20-Feb-04 2:46 

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.