Search Results

Search found 9 results on 1 pages for 'kobac'.

Page 1/1 | 1 

  • Invalidate (MFC) debug assertion failed error message

    - by kobac
    I've made a custom control, and when I want it to repaint on the screen I call Invalidate(), and afterwards UpdateWindow(), but i get message: debug assertion failed for a file afxwin2.inl in line 150 which is: AFXWIN_INLINE void CWnd::Invalidate(BOOL bErase) { ASSERT(::IsWindow(m_hWnd)); ::InvalidateRect(m_hWnd, NULL, bErase); } The thing is that when I run the same app in release mode, it doesn't report any message! So this clue makes me think it's about some environment configuration I should change. What do you think? Thanks.

    Read the article

  • What are useful functions for drawing text (MFC)?

    - by kobac
    I'm creating a line chart control, and I need to write (or better say draw) the axis names and axis values. I found DrawText and TextOut functions, but the text they show is flickering and don't know how to set the font and text orientation (I will need vertical text orientation as well as horizontal). Are there any other functions you could recoommend or how to use these stated above and get the results I need? Thanks in advance. Cheers.

    Read the article

  • Problem with array of elements of a structure type

    - by kobac
    I'm writing an app in Visual Studio C++ and I have problem with assigning values to the elements of the array, which is array of elements of structure type. Compiler is reporting syntax error for the assigning part of the code. Is it possible in anyway to assign elements of array which are of structure type? typedef struct { CString x; double y; } Point; Point p[3]; p[0] = {"first", 10.0}; p[1] = {"second", 20.0}; p[2] = {"third", 30.0};

    Read the article

  • deleting dynamically allocated object that contains vector in C++ STL

    - by kobac
    I have a class class ChartLine{ protected: vector<Point> line; // points connecting the line CString name; //line name for legend CPen pen; //color, size and style properties of the line }; where Point is a structure struct Point{ CString x; double y; }; In main() I dynamically allocate objects of type ChartLine with new operator. If I use delete afterwards, will default destructor ~ChartLine() properly dealocate (or clear) member ChartLine::line(which is vector btw) or I would have to clear that vector in ~ChartLine() manually? Thanks in advance. Cheers.

    Read the article

  • sending address of a variable declared on the stack?

    - by kobac
    I have a doubt concerning declaring variables, their scope, and if their address could be sent to other functions even if they are declared on the stack? class A{ AA a; void f1(){ B b; aa.f2(&b); } }; class AA{ B* mb; f2(B* b){ mb = b; //... } }; Afterwards, I use my AA::mb pointer in the code. So things I would like to know are following. When the program exits A::f1() function, b variable since declared as a local variable and placed on the stack, can't be used anymore afterwards. What happens with the validity of the AA::mb pointer? It contains the address of the local variable which could not be available anymore, so the pointer isn't valid anymore? If B class is a std::<vector>, and AA::mb is not a pointer anymore to that vector, but a vector collection itself for example. I would like to avoid copying all of it's contents in AA::f2() to a member AA::mb in line mb = b. Which solution would you recommend since I can't assign a pointer to it, because it'll be destroyed when the program exits AA::f2()

    Read the article

  • How to create and add a custom made component to a Dialog based app (MFC)?

    - by kobac
    I want to make a custom made component (a line chart), that would be used in other applications. I don't know 2 things: 1) Where should I use (within component class!) the methods for drawing, like FillRect or PolyLine? In OnPaint handler that I should define and map it in MESSAGE MAP? Will it (OnPaint handler) be called from OnPaint handler of the dialog of the application or where from? 2)How to connect the component, once it is made, to the test application, which will for example be dialog based? Where should I instantiate that component? From an OnCreate method of the MyAppDialog.cpp? I started coding in MFC few days ago and I'm so confused about it. Thanks in advance, Cheers.

    Read the article

1