Click here to Skip to main content
16,007,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: constant expression in case Pin
Andrew Quinn AUS20-May-04 22:54
Andrew Quinn AUS20-May-04 22:54 
GeneralRe: constant expression in case Pin
Ernesto D.21-May-04 0:09
Ernesto D.21-May-04 0:09 
GeneralA note Pin
bikram singh21-May-04 3:42
bikram singh21-May-04 3:42 
GeneralRe: constant expression in case Pin
Curi0us_George21-May-04 2:43
Curi0us_George21-May-04 2:43 
GeneralRe: constant expression in case Pin
toxcct21-May-04 3:07
toxcct21-May-04 3:07 
GeneralRe: constant expression in case Pin
Curi0us_George21-May-04 3:53
Curi0us_George21-May-04 3:53 
GeneralRe: constant expression in case Pin
Gary R. Wheeler23-May-04 12:48
Gary R. Wheeler23-May-04 12:48 
GeneralRe: constant expression in case Pin
Ernesto D.21-May-04 10:40
Ernesto D.21-May-04 10:40 
Heres the REAL deal

in a file (appconsts.cpp)
#include "appconsts.h"<br />
const int COLID_PLV_NAME =  0<br />
const int COLID_PLV_PHONE = 1<br />
const int COLID_PLV_REP =   2

and in another file (appconsts.h) wich is included everywhere...
extern const int COLID_PLV_NAME;<br />
extern const int COLID_PLV_PHONE;<br />
extern const int COLID_PLV_REP;


and finally, in the LVN_COLUMNCLICK handler of one of my views (appconsts.h included here of course)...
switch(ColIdx)<br />
{<br />
   case COLID_PLV_NAME:<br />
      // do something here<br />
      break;<br />
   case COLID_PLV_PHONE:<br />
      // more code here also<br />
      break;<br />
   case COLID_PLV_REP:<br />
      // and more code<br />
      break;<br />
   default:<br />
      return 0; // we dont care about other cols.<br />
}
Looks right no?, but it gives me...
C:\DEV\PROJECTS\BOLETAJE\1.0_CURRENT\ProvidersView.cpp(204) : error C2051: case expression not constant
C:\DEV\PROJECTS\BOLETAJE\1.0_CURRENT\ProvidersView.cpp(207) : error C2051: case expression not constant
C:\DEV\PROJECTS\BOLETAJE\1.0_CURRENT\ProvidersView.cpp(210) : error C2051: case expression not constant
i just dont get it!
GeneralRe: constant expression in case Pin
Gary R. Wheeler23-May-04 12:41
Gary R. Wheeler23-May-04 12:41 
GeneralCComboBox Pin
closecall20-May-04 22:36
closecall20-May-04 22:36 
GeneralRe: CComboBox Pin
closecall20-May-04 22:43
closecall20-May-04 22:43 
GeneralRe: CComboBox Pin
Andrew Quinn AUS20-May-04 22:51
Andrew Quinn AUS20-May-04 22:51 
GeneralOdd effect in .net 2003 using c++forms Pin
hjimmy20-May-04 22:15
hjimmy20-May-04 22:15 
GeneralIdenfy a PC Pin
ivax20-May-04 22:06
ivax20-May-04 22:06 
GeneralRe: Idenfy a PC Pin
Andrew Quinn AUS20-May-04 23:30
Andrew Quinn AUS20-May-04 23:30 
GeneralRe: Idenfy a PC Pin
Dennis Gourjii21-May-04 3:00
Dennis Gourjii21-May-04 3:00 
GeneralSerial Port - overlapped I/O - WaitCommEvent/SetCommMask/ReadFile/etc questions Pin
AnotherProgrammer20-May-04 21:50
AnotherProgrammer20-May-04 21:50 
GeneralRe: Serial Port - overlapped I/O - WaitCommEvent/SetCommMask/ReadFile/etc questions Pin
Paul Ranson21-May-04 7:37
Paul Ranson21-May-04 7:37 
GeneralC++ object pointers Pin
Anonymous20-May-04 21:47
Anonymous20-May-04 21:47 
GeneralRe: C++ object pointers Pin
Steve S21-May-04 0:20
Steve S21-May-04 0:20 
GeneralRe: C++ object pointers Pin
mirex21-May-04 1:16
mirex21-May-04 1:16 
General"int" to "CY" Pin
Hing20-May-04 21:26
Hing20-May-04 21:26 
GeneralRe: &quot;int&quot; to &quot;CY&quot; Pin
Maxwell Chen20-May-04 21:43
Maxwell Chen20-May-04 21:43 
GeneralRe: &quot;int&quot; to &quot;CY&quot; Pin
Hing20-May-04 21:44
Hing20-May-04 21:44 
GeneralRe: "int" to "CY" Pin
Maxwell Chen20-May-04 23:50
Maxwell Chen20-May-04 23:50 

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.