Click here to Skip to main content
15,899,474 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pDoc and push_back problem Pin
perlmunger4-Oct-02 15:09
perlmunger4-Oct-02 15:09 
GeneralRe: pDoc and push_back problem Pin
nss4-Oct-02 15:15
nss4-Oct-02 15:15 
GeneralRe: pDoc and push_back problem Pin
perlmunger4-Oct-02 16:10
perlmunger4-Oct-02 16:10 
GeneralRe: pDoc and push_back problem Pin
nss4-Oct-02 17:13
nss4-Oct-02 17:13 
GeneralRe: pDoc and push_back problem Pin
Neville Franks4-Oct-02 22:49
Neville Franks4-Oct-02 22:49 
GeneralRe: pDoc and push_back problem Pin
nss5-Oct-02 1:24
nss5-Oct-02 1:24 
GeneralUsing a BHO to Insert Menu Into IE Pin
perlmunger4-Oct-02 14:48
perlmunger4-Oct-02 14:48 
Generala very weird problem regarding globals... Pin
nss4-Oct-02 14:47
nss4-Oct-02 14:47 
My apps been working fine, but to my horror I have found that some of my globals are declared before the messagemap, some after...and they are still global!! Is this weird ?

Also if I declare a vector
std::vector<CString> vec;
before the msgmap, the linker groans, but after the msgmap and theres no problem. Heres the situation:

(format explanation: my angled brackets have vanished in the post, but I do have the types for the maps etc where they should be in angled brackets)

Is this weird ?or are things still global no matter if they are before or
after the mesagemap?

#include <iostream>
#include <fstream>
#include <atlconv.h>
extern CTrain1App theApp;
#define BIF_NONEWFOLDERBUTTON  0x0200
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
using namespace std;
BOOL g_FlagNoPhotoDB;
BOOL g_fResetToFullDB;  char* xDontCare;
std::vector<CString> vec; ///////doesnt work here

IMPLEMENT_DYNCREATE(CTrain1View, CFormView)

BEGIN_MESSAGE_MAP(CTrain1View, CFormView)
 //{{AFX_MSG_MAP(CTrain1View)
 ON_COMMAND(ID_SELECTDATABASE, OnSelectdatabase)

 )
 //}}AFX_MSG_MAP
 ON_MESSAGE (KEYWORDS_READY, OnKeyWordsReady)
 ON_UPDATE_COMMAND_UI(ID_INDICATOR_TEST, OnUpdateIndicatorTest)
 // Standard printing commands
 ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
 ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
 ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()

std::map<int,CImages> imageMap;

std::map<CString,CTrio> trioMap;

std::vector<CString> vec;  ///works here
CString gDatabaseName;

CString gImageFolderLoc;

int globaln_popDisplayFlag =1;
PALETTETYPE globalPaletteType = OriginalPaletteType;
RGBQUAD* pGlobalPalette = 0;
int globalZoomFactor = 100;

double globalBaselineImageWidth = 20;


float globalBright = 0.5;

float globalContrast = 0.5;


// a new class starts: 
CImages::CImages(void)
{
 imageSize = 0;



There are globals at the start, like they should be. Then there a bunch of
globals AFTER the messagemap, If I make a global vector there(after msgmaps)
it compiles, but making it before the messagemaps it doesnt
compile.

Generalmediaplayer Pin
moloko4-Oct-02 14:30
moloko4-Oct-02 14:30 
GeneralRe: mediaplayer Pin
Shog94-Oct-02 16:24
sitebuilderShog94-Oct-02 16:24 
GeneralHmmm...Error ! Pin
Nick Parker4-Oct-02 12:34
protectorNick Parker4-Oct-02 12:34 
GeneralRe: Hmmm...Error ! Pin
Joshua Nussbaum4-Oct-02 13:19
Joshua Nussbaum4-Oct-02 13:19 
GeneralRe: Hmmm...Error ! Pin
Nick Parker4-Oct-02 13:33
protectorNick Parker4-Oct-02 13:33 
Generalration button Pin
Michael Liu4-Oct-02 12:07
Michael Liu4-Oct-02 12:07 
GeneralRe: ration button Pin
Dimitri Rochette4-Oct-02 12:36
Dimitri Rochette4-Oct-02 12:36 
QuestionWeird CListView behavior, Bug? Pin
Anonymous4-Oct-02 10:49
Anonymous4-Oct-02 10:49 
AnswerNever mind Pin
Anonymous4-Oct-02 11:15
Anonymous4-Oct-02 11:15 
GeneralBeginner problem: drawing button in activex ctrl Pin
Daelus4-Oct-02 10:43
Daelus4-Oct-02 10:43 
GeneralColoured button Pin
User 98854-Oct-02 9:43
User 98854-Oct-02 9:43 
GeneralRe: Coloured button Pin
Chris Hambleton4-Oct-02 10:05
Chris Hambleton4-Oct-02 10:05 
GeneralRe: Coloured button Pin
User 98854-Oct-02 10:35
User 98854-Oct-02 10:35 
GeneralRe: Coloured button Pin
User 98854-Oct-02 10:37
User 98854-Oct-02 10:37 
GeneralMixing MSVCRT and MSVCRTD Pin
Aaron Schaefer4-Oct-02 9:36
Aaron Schaefer4-Oct-02 9:36 
Questionsorting CMenu items ? Pin
Anonymous4-Oct-02 9:09
Anonymous4-Oct-02 9:09 
GeneralCPropertyPage and modeless dialog Pin
Gero Gerber4-Oct-02 9:02
Gero Gerber4-Oct-02 9:02 

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.