Thread: string::operand+ usage problem (with WIN32 data types)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User flashbaz-pi's Avatar
    Join Date
    Nov 2008
    Posts
    7

    string::operand+ usage problem (with WIN32 data types)

    I'm using DevC++ as compiler and this is a Win32 program...

    Code:
    LRESULT CALLBACK Efendi(HWND anaPen, UINT msj,WPARAM wParam, LPARAM lParam){
            int metKrkSys;
            LPTSTR metMetin;
            HWND hMet;
            hMet = GetDlgItem( anaPen, id_met);
            switch (msj) {
                   case WM_COMMAND:
                        metKrkSys = GetWindowTextLength(hMet);
                        GetWindowText( hMet, metMetin, metKrkSys+1);
                        switch (LOWORD(wParam)){
                               case id_rakam0:
                                    metMetin = metMetin + "abc";
                                    MessageBox( anaPen, metMetin, "KarakterSayısı", MB_OK);
                                    break;            
                        }
                        break;
                   case WM_CLOSE:
                        DestroyWindow(anaPen);
                        break;
                   case WM_DESTROY:
                        PostQuitMessage(0);
                        break;
                   default:
                   return DefWindowProc(anaPen, msj, wParam, lParam);      
            }
            return 0;
    }
    anaPen is my main window.
    hMet (id_met) is an edit control.
    metMetin is the text in this edit control.
    id_rakam0 is a button's id.

    This program wants to do this: getting the text in the edit control, adding it "abc" string then showing in a MessageBox...

    When I compile:

    39 D:\Denemeler\c++\win32_winprog\HesapMakinesi\main. cpp invalid operands of types `TCHAR*' and `const char[3]' to binary `operator+'

    So what's the problem exactly and what should I do?
    Last edited by flashbaz-pi; 11-01-2008 at 05:29 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  2. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  3. Replies: 4
    Last Post: 06-14-2005, 05:45 AM
  4. [question]Analyzing data in a two-dimensional array
    By burbose in forum C Programming
    Replies: 2
    Last Post: 06-13-2005, 07:31 AM
  5. Server recv data problem! Please help!
    By hyaku_ in forum Networking/Device Communication
    Replies: 15
    Last Post: 01-28-2005, 02:35 PM