• Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    so tell me, if you can: how MFC do for use these 'events': void classname::functionname(...) ???? (like i said, i'm less than bigginer with MFC. but i remember that i …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    sorry, but when i said"without re-declare it inside of Cow class", i mean avoid these line: class Cow : public Animal { void Speak(); //i need avoid these line }; …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    but we can do something like that with MFC, right? (i'm less than bigginer with MFC.. so sorry if i fail in something) how can i validate the Speak() function …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    i only see 1 'problem'(for my objective) in Cow and Cat. why? because i must re-declare the Speak() function. class Cow : public Animal { }; void Cow::Speak() { cout …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    sorry i understand that isn't the 1st time that i ask... and you always helped me... thanks for all. but i continue thinking that something like these is possible with …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    yes.. the line 11 was my mistake.. sorry. i continue confuse on how can i resolve that problem :( like we have seen in MFC, it's possible be done, but …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    #include <iostream> using namespace std; class test { public: void print(string message); }; class a:test { }; void a::print(string message) { printf("hello %s",message); } error message: "no 'void a::print(std::string)' member …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    but how can i create a class dirived from other, without redeclare the functions?
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    sorry if i mistake something.. now i remember the MFC(98) that i used, with windows messages, i created a new class. but how these class are done? because we use …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to Moschops in about '::' and MFC

    Not quite. `CMyAxUICtrl` is the name of a class. To use this function, you would have to create an object of the class type first: `CMyAxUICtrl beansOnToast;` and then use …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about '::' and MFC

    my objective is understand that function header, for do the same in C++ ;)
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - how changing the window\DC backcolor?

    if the code is cool, try these functions: COLORREF GetWindowBackColor(HDC WindowDC) { return GetDCBrushColor (WindowDC); } void SetWindowBackColor(HDC WindowDC, COLORREF BackColor) { HWND HandleWindow= WindowFromDC(WindowDC); RECT WindowClientRectangle; GetClientRect(HandleWindow,&WindowClientRectangle); SelectObject(WindowDC, GetStockObject(DC_BRUSH)); …
  • Member Avatar for cambalinho
    cambalinho

    Created about '::' and MFC

    "MFC is not a language; it is a native (unmanaged) class library which is a thin wrapper around the Win32 API." now see these header function: void CMyAxUICtrl::OnDraw(CDC* pdc, const …
  • Member Avatar for cambalinho
    cambalinho

    Began Watching about '::' and MFC

    "MFC is not a language; it is a native (unmanaged) class library which is a thin wrapper around the Win32 API." now see these header function: void CMyAxUICtrl::OnDraw(CDC* pdc, const …
  • Member Avatar for cambalinho
    cambalinho

    Marked Solved Status for [win32] - how changing the window\DC backcolor?

    the WindowClass.hbrBackground=(HBRUSH) CreateSolidBrush(RGB(0,255,0)); change the all windows backcolor, registed with these class(WindowClasss). and for change the DC\window backcolor we need use WM_ERASEBKGND or other messages for do it(i don't remember …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to nullptr in [win32] - how changing the window\DC backcolor?

    Something like this? hbrBackground = CreateSolidBrush(RGB(241, 245, 251)); // case WM_PAINT: { LPPAINTSTRUCT lpps = new PAINTSTRUCT; HDC hdc = BeginPaint(hWnd, lpps); FillRect(hdc, &lpps->rcPaint, hbrBackground); // other code }
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to nullptr in [win32] - how changing the window\DC backcolor?

    This may be what you're after. LPPAINTSTRUCT lpps = new PAINTSTRUCT; HDC hdc = BeginPaint(hWnd, lpps); SelectObject(hdc, GetStockObject(DC_BRUSH)); SetDCBrushColor(hdc, RGB(180, 0, 0)); Rectangle(hdc, lpps->rcPaint.left, lpps->rcPaint.top, lpps->rcPaint.right, lpps->rcPaint.bottom); //
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - how changing the window\DC backcolor?

    heres my actual code in WM_PAINT message: case WM_PAINT: HDC hdc; RECT rect, textrect; PAINTSTRUCT a; HGDIOBJ original; GetClientRect(hwnd,&rect); //getting the actual client rectangle hdc=BeginPaint(hwnd,&a); //for getting DC for start …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - how changing the window\DC backcolor?

    thanks, but can you give me a nice link about SetDCBrushColor() and SetDCPenColor()? anotherthing: if we use SelectObject(), we must DeleteObject(), right?
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [win32] - how changing the window\DC backcolor?

    it's a nice thot ;) but i belive the FillRect(), isn't the same of backcolor, right?
  • Member Avatar for cambalinho
    cambalinho

    Created [win32] - how changing the window\DC backcolor?

    the WindowClass.hbrBackground=(HBRUSH) CreateSolidBrush(RGB(0,255,0)); change the all windows backcolor, registed with these class(WindowClasss). and for change the DC\window backcolor we need use WM_ERASEBKGND or other messages for do it(i don't remember …
  • Member Avatar for cambalinho
    cambalinho

    Began Watching [win32] - how changing the window\DC backcolor?

    the WindowClass.hbrBackground=(HBRUSH) CreateSolidBrush(RGB(0,255,0)); change the all windows backcolor, registed with these class(WindowClasss). and for change the DC\window backcolor we need use WM_ERASEBKGND or other messages for do it(i don't remember …
  • Member Avatar for cambalinho
    cambalinho

    Marked Solved Status for about DrawText(): how use new lines\tabs in vertical center of the rect?

    the DrawText() function is for draw text with a rectangle size. but if the DT_VCENTER is used with DT_SINGLELINE, how can i use the "\n" and "\t" strings formats?
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about DrawText(): how use new lines\tabs in vertical center of the rect?

    problem resolved: 1 - we must get the hdc and the string(with DT_CALRECT flag) rectangle: RECT rect, textrect; GetClientRect(hwnd,&rect); DrawText(hdc,"hello world\nhi\thello mother\nhello my dog",-1, &textrect, DT_CALCRECT); now we change the …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about DrawText(): how use new lines\tabs in vertical center of the rect?

    see these sample: case WM_PAINT: HDC hdc; SIZE TextRect; RECT rect; GetClientRect(hwnd,&rect); PAINTSTRUCT a; hdc=BeginPaint(hwnd,&a); SetBkMode(hdc,TRANSPARENT); DrawText(hdc,"hello world\nhi",-1, &rect, DT_CENTER | DT_EXPANDTABS | DT_VCENTER); EndPaint(hwnd,&a); return 0; i get the …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in about DrawText(): how use new lines\tabs in vertical center of the rect?

    yes, but it can't be combined with DT_VCENTER: "Centers text vertically. This value is used only with the DT_SINGLELINE value." i read it: msdn.microsoft.com/en-us/library/windows/desktop/dd162498(v=vs.85).aspx
  • Member Avatar for cambalinho
    cambalinho

    Created about DrawText(): how use new lines\tabs in vertical center of the rect?

    the DrawText() function is for draw text with a rectangle size. but if the DT_VCENTER is used with DT_SINGLELINE, how can i use the "\n" and "\t" strings formats?
  • Member Avatar for cambalinho
    cambalinho

    Began Watching about DrawText(): how use new lines\tabs in vertical center of the rect?

    the DrawText() function is for draw text with a rectangle size. but if the DT_VCENTER is used with DT_SINGLELINE, how can i use the "\n" and "\t" strings formats?
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    thanks.. i did that ;)
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to Ancient Dragon in some questions about these code

    >ut why the double don't accept integers? It has to do with what the compiler pushes on the stack. Integers are 4 bytes on the stack while doubls are 8 …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to Ancient Dragon in some questions about these code

    >the _vsntprintf() link isn't working You're right -- I must have copied the wrong url into the clipboard. >but why use it? what means? I don't use it. there may …
  • Member Avatar for cambalinho
    cambalinho

    Marked Solved Status for some questions about these code

    i'm learning win32 from Programming Windows Fifth Edition book, but i need ask something about these code: /*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− SCRNSIZE.C −− Displays screen size in a message box (c) Charles Petzold, …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    yes i have the C extension that's why i get that warning. thanks for all. thanks for correct me. thanks for all
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to Ancient Dragon in some questions about these code

    line 54 is sending 3 integers, not 3 doubles. Make them doubles and see if that solves the problem. `double a=average(3,10.0,50.0,6.0);`
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    yes... works. but why the double don't accept integers? my code, give me, only, these warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C [enabled by …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    see these entire code: /*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− SCRNSIZE.C −− Displays screen size in a message box (c) Charles Petzold, 1998 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/ #include <windows.h> #include <tchar.h> #include <stdio.h> #include <string.h> int CDECL MessageBoxPrintf …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    i see i'm doing several errors. double average ( int num, ... ) { va_list arguments; // A place to store the list of arguments double sum = 0; va_start …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    true... sorry. but even so the for loop isn't correct :( i'm testing the sum value with prinf and i continue with 0(zero)
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    now i change the function and works, but i always get 0 (zero) :( double MessageBoxSum(double number,...) { double sum=0; va_list ArgumentList; va_start ( ArgumentList, number ); int x = …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    sorry, you have right. is these line: _vscprintf(text,sizeof (text) / sizeof (char),"%f",sum); but i continue with errors :(
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    ok.... thanks anotherthing: i'm trying understand more the arguments list: double MessageBoxSum(double number,...) { double sum; va_list ArgumentList; va_start ( ArgumentList, number ); int x = 0; for ( x=0; …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in some questions about these code

    the exemple that you give me is diferent, because uses the for loop... but maybe it's the same. the _vsntprintf() link isn't working: http://msdn.microsoft.com/en-us/library/1kt27hek.aspx "_cdecl is the default calling convention …
  • Member Avatar for cambalinho
    cambalinho

    Gave Reputation to Ancient Dragon in some questions about these code

    _cdecl is the default calling convention for Micosoft Visual Studio. There is no need to explicitly use CDECL. _vsntprintf() -- wrong. ([link](_vsntprintf )). How is _vsntprintf() supposed to know the …
  • Member Avatar for cambalinho
    cambalinho

    Edited some questions about these code

    i'm learning win32 from Programming Windows Fifth Edition book, but i need ask something about these code: /*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− SCRNSIZE.C −− Displays screen size in a message box (c) Charles Petzold, …
  • Member Avatar for cambalinho
    cambalinho

    Created some questions about these code

    i'm learning win32 from Programming Windows Fifth Edition book, but i need ask something about these code: /*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− SCRNSIZE.C −− Displays screen size in a message box (c) Charles Petzold, …
  • Member Avatar for cambalinho
    cambalinho

    Began Watching some questions about these code

    i'm learning win32 from Programming Windows Fifth Edition book, but i need ask something about these code: /*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− SCRNSIZE.C −− Displays screen size in a message box (c) Charles Petzold, …
  • Member Avatar for cambalinho
    cambalinho

    Created [VB6] - why the mask edit box control isn't updated with data?

    i'm using the data control with mask edit box control. when i click on next button, the mask edit box isn't updated. but why show us the 1st element from …
  • Member Avatar for cambalinho
    cambalinho

    Began Watching [VB6] - why the mask edit box control isn't updated with data?

    i'm using the data control with mask edit box control. when i click on next button, the mask edit box isn't updated. but why show us the 1st element from …
  • Member Avatar for cambalinho
    cambalinho

    Replied To a Post in [C++ 11] - my own properties code

    1 question: can i do the copy constructor in my property class or must be inside of property test?
  • Member Avatar for cambalinho
    cambalinho

    Created about the pointer class(this)

    i have 1 class that have members dependents of the class pointers. when i do the Copy Construtor with assignment operator, how can i use the instance class this, instead …

The End.