Click here to Skip to main content
15,898,999 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to make Spin MFC control to increment or decrement a value in 0.1 in each step ? Pin
Yanshof26-Dec-07 20:06
Yanshof26-Dec-07 20:06 
AnswerRe: How to make Spin MFC control to increment or decrement a value in 0.1 in each step ? Pin
ThatsAlok26-Dec-07 23:55
ThatsAlok26-Dec-07 23:55 
GeneralChallenging GotW 66's moral Pin
George_George26-Dec-07 19:53
George_George26-Dec-07 19:53 
GeneralRe: Challenging GotW 66's moral Pin
peterchen27-Dec-07 1:51
peterchen27-Dec-07 1:51 
GeneralRe: Challenging GotW 66's moral Pin
George_George27-Dec-07 1:57
George_George27-Dec-07 1:57 
GeneralRe: Challenging GotW 66's moral Pin
peterchen27-Dec-07 8:50
peterchen27-Dec-07 8:50 
GeneralRe: Challenging GotW 66's moral Pin
George_George27-Dec-07 18:02
George_George27-Dec-07 18:02 
GeneralRe: Challenging GotW 66's moral Pin
peterchen28-Dec-07 2:38
peterchen28-Dec-07 2:38 
Hi George,

You are nto giving up - that's good Smile | :)

I overlooked the comment for extra code that might throw exceptions.

With that code, you got yourself in a very ugly situation:
If you catch the (...) exception, where was it thrown? by a base class, or a member constructor? IUn that case, you cannot even legally test p!=0 (it is likely randomly initialized, anyway, and the compiler might generate code that causes an access violation at runtime).

What you need to do is this:

class A
{
  private:
    int* p;
  public:    
  A() try    // deal with exceptions from abse class constructor or member constructors
  {
    try  // deal with constructor body exceptions
    {
       p = NULL;
       p = new int[10];        
       // ... there are some other exceptions here
    }
    catch (...)
    {
      // you can re-throw the exception, or recover and let the object be created
    }
  }    
  catch (...)
  {
     // here, the object cannot be created, no matter what you do.
     // you can log an error, translate the exception, etc.
  }    
}


We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
My first real C# project | Linkify!| FoldWithUs! | sighist


GeneralRe: Challenging GotW 66's moral Pin
George_George28-Dec-07 3:40
George_George28-Dec-07 3:40 
GeneralRe: Challenging GotW 66's moral Pin
Member 75496028-Dec-07 10:42
Member 75496028-Dec-07 10:42 
GeneralRe: Challenging GotW 66's moral Pin
George_George28-Dec-07 19:05
George_George28-Dec-07 19:05 
GeneralRe: Challenging GotW 66's moral Pin
Member 75496028-Dec-07 20:32
Member 75496028-Dec-07 20:32 
GeneralRe: Challenging GotW 66's moral Pin
George_George28-Dec-07 23:28
George_George28-Dec-07 23:28 
GeneralRe: Challenging GotW 66's moral Pin
Member 75496029-Dec-07 4:47
Member 75496029-Dec-07 4:47 
GeneralRe: Challenging GotW 66's moral Pin
George_George29-Dec-07 19:52
George_George29-Dec-07 19:52 
GeneralPlease let me ask again about creating unicode file. Pin
xanagan66626-Dec-07 19:07
xanagan66626-Dec-07 19:07 
GeneralRe: Please let me ask again about creating unicode file. Pin
Maxwell Chen26-Dec-07 20:17
Maxwell Chen26-Dec-07 20:17 
GeneralRe: Please let me ask again about creating unicode file. Pin
xanagan66626-Dec-07 22:59
xanagan66626-Dec-07 22:59 
GeneralRe: Please let me ask again about creating unicode file. Pin
Maxwell Chen26-Dec-07 23:10
Maxwell Chen26-Dec-07 23:10 
GeneralDetailed view Pin
john563226-Dec-07 19:07
john563226-Dec-07 19:07 
GeneralRe: Detailed view Pin
CPallini26-Dec-07 21:21
mveCPallini26-Dec-07 21:21 
GeneralRe: Detailed view Pin
Nishad S26-Dec-07 22:59
Nishad S26-Dec-07 22:59 
Questioncan anybody tell me why the size of the class is 16 Pin
philiptabraham26-Dec-07 18:59
philiptabraham26-Dec-07 18:59 
AnswerRe: can anybody tell me why the size of the class is 16 Pin
Maxwell Chen26-Dec-07 19:47
Maxwell Chen26-Dec-07 19:47 
AnswerRe: can anybody tell me why the size of the class is 16 Pin
Haroon Sarwar26-Dec-07 21:44
Haroon Sarwar26-Dec-07 21:44 

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.