Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Compile errors Pin
steven1120-Mar-05 8:35
steven1120-Mar-05 8:35 
GeneralRe: Compile errors Pin
steven1120-Mar-05 8:52
steven1120-Mar-05 8:52 
Generalproblem using Select() on multicast server Pin
eli1502197919-Mar-05 21:10
eli1502197919-Mar-05 21:10 
QuestionPower control ? Pin
Still learning how to code19-Mar-05 20:03
Still learning how to code19-Mar-05 20:03 
AnswerRe: Power control ? Pin
ThatsAlok20-Mar-05 18:06
ThatsAlok20-Mar-05 18:06 
GeneralCPropertyPage and CDialog Pin
Yaron Abershitz19-Mar-05 19:43
Yaron Abershitz19-Mar-05 19:43 
GeneralRe: CPropertyPage and CDialog Pin
Renjith Ramachandran20-Mar-05 16:06
Renjith Ramachandran20-Mar-05 16:06 
GeneralVisual C++.Net - Alternative to Large Switch Case Pin
JSadleir19-Mar-05 13:42
JSadleir19-Mar-05 13:42 
Hi All

I know little about Visual C++.net programming and would be grateful for any insights into solving the following problem. For one function, ideally I would like a Switch Case that has 10000 case entries as follows:

Switch (Product_Case)<br />
{<br />
Case 1 : Price = 1.07; break;<br />
Case 2 : Price = 1.07; break;<br />
...<br />
Default Case<br />
}


Using a Switch case in this way would achieve my aim of being able to get a price corresponding to a product, but presumably a 10000 case switch would cause memory problems and and be slow. How would an experienced programmer handle this? Would they create an .mdb with the Product and corresponding Price entries and then read from that file using pointers and SQL? As I want this data embedded in an .XLL, what type of header/source/resource do I use in Visual C++.net?

Any ideas would be gratefully accepted.


Jeremy
GeneralRe: Visual C++.Net - Alternative to Large Switch Case Pin
Member 30761219-Mar-05 20:22
Member 30761219-Mar-05 20:22 
GeneralRe: Visual C++.Net - Alternative to Large Switch Case Pin
Mike Dimmick19-Mar-05 22:53
Mike Dimmick19-Mar-05 22:53 
GeneralRe: Visual C++.Net - Alternative to Large Switch Case Pin
Ravi Bhavnani20-Mar-05 5:41
professionalRavi Bhavnani20-Mar-05 5:41 
GeneralRe: Visual C++.Net - Alternative to Large Switch Case Pin
Blake Miller21-Mar-05 5:36
Blake Miller21-Mar-05 5:36 
GeneralRe: Visual C++.Net - Alternative to Large Switch Case Pin
Ravi Bhavnani21-Mar-05 6:40
professionalRavi Bhavnani21-Mar-05 6:40 
GeneralJabber protocol Pin
Anonymous19-Mar-05 12:42
Anonymous19-Mar-05 12:42 
GeneralRe: Jabber protocol Pin
ThatsAlok20-Mar-05 18:22
ThatsAlok20-Mar-05 18:22 
QuestionUsing command-line? Pin
dSolariuM19-Mar-05 10:34
dSolariuM19-Mar-05 10:34 
AnswerRe: Using command-line? Pin
gamitech19-Mar-05 23:39
gamitech19-Mar-05 23:39 
QuestionHi~ How use CodeProject?? Pin
KonyangUni19-Mar-05 7:41
KonyangUni19-Mar-05 7:41 
GeneralTrackbar Pin
henry12819-Mar-05 5:57
henry12819-Mar-05 5:57 
GeneralDigital Signature Pin
pranavamhari19-Mar-05 3:10
pranavamhari19-Mar-05 3:10 
GeneralRe: Digital Signature Pin
Michael Dunn20-Mar-05 6:00
sitebuilderMichael Dunn20-Mar-05 6:00 
GeneralRe: Digital Signature Pin
pranavamhari20-Mar-05 14:56
pranavamhari20-Mar-05 14:56 
GeneralAPI: which enlists the devices Pin
brilliant10119-Mar-05 1:33
brilliant10119-Mar-05 1:33 
GeneralRe: API: which enlists the devices Pin
Alexander M.,19-Mar-05 4:41
Alexander M.,19-Mar-05 4:41 
GeneralSetting System Time Pin
gopalkr19-Mar-05 0:13
gopalkr19-Mar-05 0:13 

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.