Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to tell when a view loses focus when the user has the right mouse button down and moves out of the view? Pin
Code-o-mat15-Nov-10 10:05
Code-o-mat15-Nov-10 10:05 
GeneralRe: How to tell when a view loses focus when the user has the right mouse button down and moves out of the view? Pin
Paul Belikian15-Nov-10 11:14
Paul Belikian15-Nov-10 11:14 
GeneralRe: How to tell when a view loses focus when the user has the right mouse button down and moves out of the view? Pin
Code-o-mat15-Nov-10 11:40
Code-o-mat15-Nov-10 11:40 
GeneralRe: How to tell when a view loses focus when the user has the right mouse button down and moves out of the view? Pin
Paul Belikian15-Nov-10 13:04
Paul Belikian15-Nov-10 13:04 
GeneralRe: How to tell when a view loses focus when the user has the right mouse button down and moves out of the view? Pin
Code-o-mat15-Nov-10 21:33
Code-o-mat15-Nov-10 21:33 
Question_unresolved external symbol error?? Pin
AmbiguousName15-Nov-10 9:20
AmbiguousName15-Nov-10 9:20 
AnswerRe: _unresolved external symbol error?? Pin
«_Superman_»15-Nov-10 9:26
professional«_Superman_»15-Nov-10 9:26 
AnswerRe: _unresolved external symbol error?? Pin
Stephen Hewitt15-Nov-10 18:34
Stephen Hewitt15-Nov-10 18:34 
As «_Superman_» said, you've got lots of problems here. Firstly note these lines:
LPTSTR Array[];
//using loop I added data to it..like
Arrar[index] = StudentName;//StudentName = some var


You haven't allocated any storage for the array! Ask youself how big it is! You really should use a std::vector[^] (as «_Superman_» suggested), especially since you don't seem to have a grasp of basic memory managment. Try something like this:
 
MyClass.h
-----------
// ...
#include <string>
#include <vector>
// ...
extern std::vector<std::string> Array;
// ...
 
MyClass.cpp
-----------
// ...
#include "MyClass.h"
// ...
std::vector<std::string> Array;
// ...
 
MyProjDlg.cpp
-------------
// ...
#include "MyClass.h"
// ...
BOOL CMyProjDlg::OnInitDialog()
{
     // How to add to the array.
     Array.push_back("String 1");
     Array.push_back("String 2");
 
     // Using the array.
     Listbox.AddString(Array[index].c_str());
         // NOTE: I have to use string::c_str() because MFC's list box needs raw C-strings (it isn't aware of <code>std::string</code>s).
}

Steve

GeneralRe: _unresolved external symbol error?? Pin
AmbiguousName16-Nov-10 2:12
AmbiguousName16-Nov-10 2:12 
QuestionFloat value Pin
john563215-Nov-10 4:44
john563215-Nov-10 4:44 
AnswerRe: Float value Pin
Cedric Moonen15-Nov-10 4:57
Cedric Moonen15-Nov-10 4:57 
AnswerRe: Float value Pin
Dr.Walt Fair, PE15-Nov-10 5:14
professionalDr.Walt Fair, PE15-Nov-10 5:14 
AnswerRe: Float value Pin
David Crow15-Nov-10 5:41
David Crow15-Nov-10 5:41 
GeneralRe: Float value Pin
Sauro Viti15-Nov-10 9:12
professionalSauro Viti15-Nov-10 9:12 
AnswerRe: Float value Pin
Rick York17-Nov-10 7:36
mveRick York17-Nov-10 7:36 
QuestionProblem with HtmlHelp API Pin
msr_codeproject15-Nov-10 0:03
msr_codeproject15-Nov-10 0:03 
AnswerRe: Problem with HtmlHelp API Pin
Randor 15-Nov-10 2:28
professional Randor 15-Nov-10 2:28 
QuestionCompilation Error Pin
john563214-Nov-10 20:24
john563214-Nov-10 20:24 
AnswerRe: Compilation Error Pin
Cedric Moonen14-Nov-10 20:45
Cedric Moonen14-Nov-10 20:45 
GeneralRe: Compilation Error Pin
CPallini14-Nov-10 21:17
mveCPallini14-Nov-10 21:17 
GeneralRe: Compilation Error Pin
Cedric Moonen14-Nov-10 21:20
Cedric Moonen14-Nov-10 21:20 
AnswerRe: Compilation Error Pin
Richard MacCutchan14-Nov-10 23:07
mveRichard MacCutchan14-Nov-10 23:07 
QuestionHow can access the same port by diffreant threads at same time? Pin
Le@rner14-Nov-10 20:12
Le@rner14-Nov-10 20:12 
AnswerRe: How can access the same port by diffreant threads at same time? PinPopular
Cedric Moonen14-Nov-10 20:49
Cedric Moonen14-Nov-10 20:49 
GeneralRe: How can access the same port by diffreant threads at same time? Pin
Le@rner14-Nov-10 21:22
Le@rner14-Nov-10 21: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.