Programm stürtzt ab!



  • Also hier erstmal meine Funktion um etwas hinzuzufügen:

    bool InsertListViewEntry (HWND hListView, 
                              LPTSTR lpEntryValue, 
                              int iRowID, 
                              int iColID) 
    { 
        int iStatus; 
        LVITEM lvi; 
    
        lvi.mask = LVIF_TEXT; 
        lvi.iItem = iRowID; 
        lvi.iSubItem = iColID; 
        lvi.pszText = lpEntryValue; 
        lvi.cchTextMax = MAX_PATH; 
    
        if (iColID == 0) 
            iStatus = ListView_InsertItem (hListView, &lvi); 
        else 
            iStatus = ListView_SetItem (hListView, &lvi); 
    
        return (iStatus != -1 || iStatus != false); 
    }
    

    und hier noch WM_NOTIFY:

    case WM_NOTIFY: 
    		{
    			switch (((LPNMHDR) lParam)->code) {
    
    				case NM_DBLCLK:
    					{
    						LPNMITEMACTIVATE  lpnmitem = (LPNMITEMACTIVATE) lParam;
    
    						if(lpnmitem->iItem < multi_vec.size());
    						{
    							if(lpnmitem->iItem != -1)
    							{
    								mom_select = lpnmitem->iItem;
    								show = CreateWindow( 
    											L"Show",
    											L"Modellauto Anzeige",
    											WS_VISIBLE|WS_SYSMENU | WS_BORDER | WS_MINIMIZEBOX |WS_CLIPCHILDREN,
    											CW_USEDEFAULT,
    											CW_USEDEFAULT,
    											640,
    											650,
    											NULL,
    											NULL,
    											hInstanceg,
    											NULL);
    							}
    						}
    						return 0;
    					}
    
    			}
    			return 0;
    		}
    

    Ich weiß nicht ob es jetzt umbedingt am Clicken liegt. Es hängt sich manchmal auch auf wenn ich scrolle usw..



  • ich habe mir angewöhnt jegliche Art von Strukturen immer mit 0 zu initailisieren

    memset(lvi, 0, sizeof(lvi));
    

    Das sollte in deinem Fall zwar nicht ins Gewicht fallen, da du als mask nur LVIF_TEXT benutzt, aber es schadet nicht sich das anzugewöhnen.
    Würde dein Programm auch craschen, wenn du eine falsche iRowID oder eine zu hohe iColID gewollt verwendest, nur um zu sehen ob es crasht? Also vieleicht ein ListView_GetItemCount(...); einbauen und sicherstellen, daß:

    if(ListView_GetItemCount(...) > (iRowID - 1)){
    	Messagebox(....);
    	return FALSE;
    }
    

    Bei deinem Event NM_DBLCLK, den du im Eventhandler des Parent abfängst, macht du keine Unterscheidung ob der Doubleclick auch wirklich vom Listviewfenster und nicht von einem anderen Child kommt, ich weiss nicht ob's was ausmacht, schadet aber auch hier nicht einen Check einzubauen.



  • ups Fehler

    memset(&lvi, 0, sizeof(lvi));
    


  • Ohne den Code jetzt betrachtet zu haben, ein immer wieder gerngemachter Fehler bei ListView und Konsorten: Pointer auf irgendwelche lokalen Datenstrukturen auf dem Stack übergeben.



  • @..... hat leider nichts gebracht. Trotzdem Danke
    @berniebµtt könntest du mir da mal ein Beispiel geben, wie es zum Beispiel zu so einem Fehler kommen könnte?



  • Vielleicht hilf euch ja noch eine genauere Beschreibung des Problems.
    Hab sogar zwei Videos gemacht:
    http://www.myvideo.de/watch/6723239
    http://www.myvideo.de/watch/6723394

    Wenn ich ein bischen im ListVie rumklicke dann wird der geklickte Eintrag irgendwann nicht mehr markiert und das ListView bleibt hängen (Ich kann nicht mehr scrollen, auf nichts mehr klicken). Wenn ich nun ein Child-Fenster öffne(klick auf Button), dann öffnet es sich kurtz und ist dann sofort verschwunden. Es ist aber noch in der Taskbar zu sehen.

    Ich bin echt am verzweifeln...

    MfG Tim



  • Hat wirklich keiner noch eine Ahnung woran das liegen könnte?

    MfG Tim



  • bau mal ein minimal programm was das problem reproduziert, 'n dialog mit dem listview oder so und poste das hier als datei+src. dann fix ichs dir kurz.



  • Ok ich setzt mich gleich dran.. Hoffe ich bekomm den gleichen Effeckt wieder hin...



  • So ich habe es mal versucht.. aber ich habe es nicht so hinbekommen, dass es genau die gleichen "Symptome" aufweist wie mein richtiges Programm. Trotzdem hängt sich das ListView nach Doppelklick usw. auf. Am besten ihr/du schaust es dir mal an:

    Main.h

    #ifndef main_h
    #define main_h
    #include <windows.h>
    #include <commctrl.h>
    #include <string.h>
    #include <vector>
    #include "resource.h"
    extern HWND hListView;
    extern std::vector <std::vector <std::wstring> >  multi_vec;
    LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
    #endif /* main_h */
    

    GlobaleVariablen.cpp

    #include "Main.h"
    HWND hListView;
    std::vector <std::vector <std::wstring> >  multi_vec;
    

    Main.cpp

    #if defined _M_IX86 
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 
    #elif defined _M_IA64 
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") 
    #elif defined _M_X64 
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 
    #else 
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 
    #endif
    #include "Main.h"
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                       PSTR szCmdLine, int iCmdShow)
    {
    
    	InitCommonControls();
    	MSG          msg;
    	HWND hWnd;
    	WNDCLASS     wc;
    
    	const wchar_t szAppName[] = L"Modellauto-Sammlung";
    	wc.cbClsExtra         = 0;
    	wc.cbWndExtra         = 0;
    	wc.hbrBackground      = (HBRUSH) COLOR_BACKGROUND ;
    	wc.hCursor            = LoadCursor(NULL, IDC_ARROW);
    	wc.hIcon              = NULL;
    	wc.hInstance          = hInstance;
    	wc.lpfnWndProc        = WndProc;
    	wc.lpszClassName      = szAppName;
    	wc.lpszMenuName       = 0;
    	wc.style              = CS_HREDRAW | CS_VREDRAW;
    
    	RegisterClass(&wc);
    
    	hWnd = CreateWindow( 
    						szAppName,
    						szAppName,
    						WS_SYSMENU | WS_BORDER | WS_MINIMIZEBOX |WS_CLIPCHILDREN,
    						GetSystemMetrics(SM_CXSCREEN)/2-400,
    						GetSystemMetrics(SM_CYSCREEN)/2-350,
    						800,
    						600,
    						NULL,
    						NULL,
    						hInstance,
    						NULL);
    
    	while(GetMessage(&msg, NULL, 0, 0)) 
        { 
            if(IsDialogMessage(hWnd, &msg) == 0) 
            { 
                TranslateMessage(&msg); 
                DispatchMessage(&msg); 
            } 
        } 
    
        return msg.wParam; 
    }
    

    MainCallback.cpp

    #include "Main.h"
    
    bool InsertListViewColumn (HWND hListView, 
                               LPTSTR lpColumnName, 
                               int iWidth, 
                               int iSubItem, 
                               DWORD dwStyle = NULL) 
    { 
        int iStatus; 
        LV_COLUMN lvc; 
    	memset(&lvc, 0, sizeof(lvc));
        lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; 
        lvc.fmt = LVCFMT_LEFT | dwStyle; 
        lvc.cx = iWidth; 
        lvc.pszText = lpColumnName; 
        lvc.cchTextMax = 100; 
        lvc.iSubItem = iSubItem; 
    
        iStatus = ListView_InsertColumn (hListView, iSubItem, &lvc); 
    
        return (iStatus != -1); 
    }
    
    bool InsertListViewEntry (HWND hListView, 
                              LPTSTR lpEntryValue, 
                              int iRowID, 
                              int iColID) 
    { 
        int iStatus; 
        LVITEM lvi; 
    	memset(&lvi, 0, sizeof(lvi));
        lvi.mask = LVIF_TEXT; 
        lvi.iItem = iRowID; 
        lvi.iSubItem = iColID; 
        lvi.pszText = lpEntryValue; 
        lvi.cchTextMax = MAX_PATH; 
    
        if (iColID == 0) 
            iStatus = ListView_InsertItem (hListView, &lvi); 
        else 
            iStatus = ListView_SetItem (hListView, &lvi); 
    
        return (iStatus != -1 || iStatus != false); 
    }
    
    LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
    
    	switch(message)
    	{
    	case WM_CREATE:
    		{
    			SetWindowPos(hWnd, NULL,0,0,0,0, //-43 und -35 damit der Mauscursor nach dem verschieben wieder über dem Button ist. 
                        SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE); 
    			hListView = CreateWindow (WC_LISTVIEW, L"", 
                                  WS_CHILD | WS_VISIBLE| WS_BORDER|LVS_NOSORTHEADER|LVS_SHOWSELALWAYS| LVS_REPORT| LVS_SINGLESEL, 
                                  10, 10, 775, 500,
                                      hWnd,
                                      NULL,
                                      ((LPCREATESTRUCT) lParam) -> hInstance,
                                      NULL);
    			SendMessage(hListView, LVM_SETEXTENDEDLISTVIEWSTYLE, (WPARAM)0, (LPARAM)LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
    			InsertListViewColumn (hListView, L"Hersteller", 195, 0,0); 
    			InsertListViewColumn (hListView, L"Artikelnummer", 100, 1,0); 
    			InsertListViewColumn (hListView, L"Type", 100, 2,0); 
    			InsertListViewColumn (hListView, L"Organisation", 100, 3,0); 
    			InsertListViewColumn (hListView, L"Beschreibung", 100, 4,0); 
    			InsertListViewColumn (hListView, L"Fahrzeugmarke", 100, 5,0); 
    			InsertListViewColumn (hListView, L"Preis", 60, 6,0); 
    			InsertListViewColumn (hListView, L"gekauft von", 100, 7,0); 
    			InsertListViewColumn (hListView, L"Bemerkung", 100, 8,0); 
    			InsertListViewColumn (hListView, L"Bild", 100, 9,0); 
    			InsertListViewColumn (hListView, L"Lagerung", 100, 10,0); 
    
    			FILE * datei1;
    			char zeile1 [200];
    			datei1 = fopen("Autos.csv", "rt");
    			int zeilen_anzahl = 0;
    			if (datei1 != NULL) {
    			while(fgets(zeile1, sizeof(zeile1), datei1) != NULL) 
    			{
    				zeilen_anzahl++;
    			}
    			}
    			fclose(datei1);
    			multi_vec.resize(zeilen_anzahl);
    
    			for(unsigned int i	= 0;i	< multi_vec.size();i++)
    			{multi_vec[i].resize(11);} 
    
    			FILE * datei;
    
    			wchar_t zeile [2211];
    
    			wchar_t hersteller[201];
    			wchar_t artikelnummer[201];
    			wchar_t type[200];
    			wchar_t organisation[201];
    			wchar_t beschreibung[201];
    			wchar_t fahrzeugtype[201];
    			wchar_t preis[201];
    			wchar_t gekauft_von[201];
    			wchar_t bemerkung[201];
    			wchar_t bild[201];
    			wchar_t lagerung[201];
    			datei = fopen("Autos.csv", "rt");
    			if (datei != NULL) {
    				int f = zeilen_anzahl-1;
    			while(fgetws(zeile, sizeof(zeile), datei) != NULL) {
    
    			swscanf(zeile, L"%[^;];%[^;];%[^;];%[^;];%[^;];%[^;];%[^;];%[^;];%[^;];%[^;];%[^;]", hersteller,artikelnummer,type,organisation,beschreibung,fahrzeugtype,preis,gekauft_von,bemerkung,bild,lagerung);
    			const unsigned int a = 3;
    
    			multi_vec[f][0] = hersteller;
    			multi_vec[f][1] = artikelnummer;
    			multi_vec[f][2] = type;
    			multi_vec[f][3] = organisation;
    			multi_vec[f][4] = beschreibung;
    			multi_vec[f][5] = fahrzeugtype;
    			multi_vec[f][6] = preis;
    			multi_vec[f][7] = gekauft_von;
    			multi_vec[f][8] = bemerkung;
    			multi_vec[f][9] = bild;
    			multi_vec[f][10] = lagerung;
    			if (multi_vec[f][0].compare(L" ") == 0)
    				multi_vec[f][0] = L"";
    
    			if (multi_vec[f][1].compare(L" ") == 0)
    				multi_vec[f][1] = L"";
    
    			if (multi_vec[f][2].compare(L" ") == 0)
    				multi_vec[f][2] = L"";
    
    			if (multi_vec[f][3].compare(L" ") == 0)
    				multi_vec[f][3] = L"";
    
    			if (multi_vec[f][4].compare(L" ") == 0)
    				multi_vec[f][4] = L"";
    
    			if (multi_vec[f][5].compare(L" ") == 0)
    				multi_vec[f][5] = L"";
    
    			if (multi_vec[f][6].compare(L" ") == 0)
    				multi_vec[f][6] = L"";
    
    			if (multi_vec[f][7].compare(L" ") == 0)
    				multi_vec[f][7] = L"";
    
    			if (multi_vec[f][8].compare(L" ") == 0)
    				multi_vec[f][8] = L"";
    
    			if (multi_vec[f][9].compare(L" ") == 0)
    				multi_vec[f][9] = L"";
    
    			if (multi_vec[f][10].compare(L" ") == 0)
    				multi_vec[f][10] = L"";
    
    			InsertListViewEntry (hListView, hersteller, 0, 0);
    			InsertListViewEntry (hListView, artikelnummer, 0, 1);
    			InsertListViewEntry (hListView, type, 0, 2);
    			InsertListViewEntry (hListView, organisation, 0, 3);
    			InsertListViewEntry (hListView, beschreibung, 0, 4);
    			InsertListViewEntry (hListView, fahrzeugtype, 0, 5);
    			InsertListViewEntry (hListView, preis, 0, 6);
    			InsertListViewEntry (hListView, gekauft_von, 0, 7);
    			InsertListViewEntry (hListView, bemerkung, 0, 8);
    			InsertListViewEntry (hListView, bild, 0, 9);
    			InsertListViewEntry (hListView, lagerung, 0, 10);
    
    			hersteller[0] = L'\0';
    			type[0] = L'\0';
    			artikelnummer[0] = L'\0';
    			beschreibung[0] = L'\0';
    			fahrzeugtype[0] = L'\0';
    			preis[0] = L'\0';
    			gekauft_von[0] = L'\0';
    			bemerkung[0] = L'\0';
    			bild[0] = L'\0';
    			lagerung[0] = L'\0';
    			organisation[0] = L'\0';
    			f--;
                    }
    			}
    			/*Datei schliessen*/
    			fclose(datei);
    			SetWindowPos(hWnd, HWND_TOP,0,0,0,0, 
    						SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE);
    
    			return 0;
    		}
    	case WM_NOTIFY: 
    		{
    			switch (((LPNMHDR) lParam)->code) {
    
    				case NM_DBLCLK:
    					{
    						LPNMITEMACTIVATE  lpnmitem = (LPNMITEMACTIVATE) lParam;
    						if(lpnmitem->hdr.hwndFrom == hListView)
    						{
    						if(lpnmitem->iItem < multi_vec.size());
    						{
    							if(lpnmitem->iItem != -1)
    							{
    								MessageBox(NULL,L"TEst",NULL,NULL);
    							}
    							return 0;
    						}
    						return 0;
    						}
    					}
    
    			}
    			return 0;
    		}
    
    	case WM_PAINT:
    		{
    			return 0;
    		}
    	case WM_DESTROY:
    		{ 
    			PostQuitMessage(0);
    			return 0;
    		}  
    	}
    
    	return DefWindowProc(hWnd, message, wParam, lParam);
    }
    

    und hier ist noch die Datei aus der die Einträge ausgelesen werden:
    http://rapidshare.com/files/259521366/Autos.csv.html

    Schonmal Danke für deine Hilfe
    MfG Tim



  • pack das mal als VS Projekt in ne zip datei und upload das irgendwo.

    Compiling...
    MainCallback.cpp
    k:\dev\win32\n00bster\maincallback.cpp(61) : error C2664: 'CreateWindowExA' : cannot convert parameter 3 from 'unsigned short [1]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(63) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [11]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(64) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [14]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(65) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [5]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(66) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [13]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(67) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [13]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(68) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [14]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(69) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [6]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(70) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [12]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(71) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [10]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(72) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [5]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(73) : error C2664: 'InsertListViewColumn' : cannot convert parameter 2 from 'unsigned short [9]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(163) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(164) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(165) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [200]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(166) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(167) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(168) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(169) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(170) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(171) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(172) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(173) : error C2664: 'InsertListViewEntry' : cannot convert parameter 2 from 'unsigned short [201]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\maincallback.cpp(207) : warning C4390: ';' : empty controlled statement found; is this the intent?
    k:\dev\win32\n00bster\maincallback.cpp(210) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [5]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    Main.cpp
    k:\dev\win32\n00bster\main.cpp(28) : error C2440: '=' : cannot convert from 'const unsigned short [20]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    k:\dev\win32\n00bster\main.cpp(47) : error C2664: 'CreateWindowExA' : cannot convert parameter 2 from 'const unsigned short [20]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    GlobaleVariablen.cpp
    c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned s
    hort,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,
    std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >' : identifier was truncated to '255' characters in the debug information
            c:\program files\microsoft visual studio\vc98\include\vector(39) : while compiling class-template member function '__thiscall std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned s
    hort> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short>
     >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,
    std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::
    allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >(const std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,
    std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > &)'
    c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::reverse_iterator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<
    unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > const *,std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned sho
    rt,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<
    unsigned short>,std::allocator<unsigned short> > > > const &,std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned sho
    rt>,std::allocator<unsigned short> > > > const *,int>' : identifier was truncated to '255' characters in the debug information
            c:\program files\microsoft visual studio\vc98\include\vector(39) : while compiling class-template member function '__thiscall std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned s
    hort> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short>
     >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,
    std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::
    allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >(const std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,
    std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > &)'
    c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::reverse_iterator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<
    unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > *,std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std
    ::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsign
    ed short>,std::allocator<unsigned short> > > > &,std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::all
    ocator<unsigned short> > > > *,int>' : identifier was truncated to '255' characters in the debug information
            c:\program files\microsoft visual studio\vc98\include\vector(39) : while compiling class-template member function '__thiscall std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned s
    hort> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short>
     >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,
    std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::
    allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >(const std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,
    std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > &)'
    c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,
    std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::' : identifier was truncated to '255' characters in the debug information
            c:\program files\microsoft visual studio\vc98\include\vector(39) : while compiling class-template member function '__thiscall std::vector<class std::vector<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class 
    std::allocator<unsigned short> >,class std::allocator<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > > >,class std::allocator<class std::vector<class std::basic_string<unsigned s
    hort,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,class std::allocator<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > > > > >::std::vector<class
     std::vector<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,class std::allocator<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocat
    or<unsigned short> > > >,class std::allocator<class std::vector<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,class std::allocator<class std::basic_string<unsigned short,struct 
    std::char_traits<unsigned short>,class std::allocator<unsigned short> > > > > >(const class std::allocator<class std::vector<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,class 
    std::allocator<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > > > > &)'
    c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: '~vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short
    ,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std:' : identifier was truncated to '255' characters in the debug information
            c:\program files\microsoft visual studio\vc98\include\vector(39) : while compiling class-template member function '__thiscall std::vector<class std::vector<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class 
    std::allocator<unsigned short> >,class std::allocator<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > > >,class std::allocator<class std::vector<class std::basic_string<unsigned s
    hort,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,class std::allocator<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > > > > >::std::vector<class
     std::vector<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,class std::allocator<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocat
    or<unsigned short> > > >,class std::allocator<class std::vector<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,class std::allocator<class std::basic_string<unsigned short,struct 
    std::char_traits<unsigned short>,class std::allocator<unsigned short> > > > > >(const class std::allocator<class std::vector<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,class 
    std::allocator<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > > > > &)'
    c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned s
    hort,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,
    std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >' : identifier was truncated to '255' characters in the debug information
            c:\program files\microsoft visual studio\vc98\include\vector(39) : while compiling class-template member function '__thiscall std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned s
    hort> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short>
     >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,
    std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::
    allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >(const std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,
    std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > &)'
    c:\program files\microsoft visual studio\vc98\include\vector(231) : warning C4786: 'std::reverse_iterator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > const *,std::basic_string<unsigned short,std
    ::char_traits<unsigned short>,std::allocator<unsigned short> >,std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > const &,std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocato
    r<unsigned short> > const *,int>' : identifier was truncated to '255' characters in the debug information
            c:\program files\microsoft visual studio\vc98\include\vector(230) : while compiling class-template member function 'void __thiscall std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsi
    gned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned 
    short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::_Destroy(std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short>
     >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > *,std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<
    std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > *)'
    c:\program files\microsoft visual studio\vc98\include\vector(231) : warning C4786: 'std::reverse_iterator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > *,std::basic_string<unsigned short,std::char
    _traits<unsigned short>,std::allocator<unsigned short> >,std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > &,std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned s
    hort> > *,int>' : identifier was truncated to '255' characters in the debug information
            c:\program files\microsoft visual studio\vc98\include\vector(230) : while compiling class-template member function 'void __thiscall std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsi
    gned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned 
    short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::_Destroy(std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short>
     >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > *,std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<
    std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > *)'
    c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned s
    hort,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,
    std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::cha
    r_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_tra
    its<unsigned short>,std::allocator<unsigned short> > > > > >' : identifier was truncated to '255' characters in the debug information
    c:\program files\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned s
    hort,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,
    std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::~vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::ch
    ar_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_tr
    aits<unsigned short>,std::allocator<unsigned short> > > > > >' : identifier was truncated to '255' characters in the debug information
    c:\program files\microsoft visual studio\vc98\include\vector(231) : warning C4786: 'std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned 
    short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short
    ,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >::_Destroy' : identifier was truncated to '255' characters in the debug information
    c:\program files\microsoft visual studio\vc98\include\xmemory(64) : warning C4786: 'std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsign
    ed short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > >::deallocate' : identifier was truncated to '255' characters in the debug information
    warning C4786: 'std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >::`sc
    alar deleting destructor'' : identifier was truncated to '255' characters in the debug information
    c:\program files\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::ch
    ar_traits<unsigned short>,std::allocator<unsigned short> > > >::~vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned shor
    t>,std::allocator<unsigned short> > > >' : identifier was truncated to '255' characters in the debug information
    c:\program files\microsoft visual studio\vc98\include\xmemory(64) : warning C4786: 'std::vector<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned 
    short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >,std::allocator<std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short
    ,std::char_traits<unsigned short>,std::allocator<unsigned short> > > > > >' : identifier was truncated to '255' characters in the debug information
    Error executing cl.exe.
    
    n00bster.exe - 26 error(s), 16 warning(s)
    




  • Ist schon gut möglich, daß es sich nach einem Doppelklick aufhaufhängt, denn NM_DBLCLK muss mit dem lParam auf eine Struktur LPNMHDR und nicht wie bei dir auf LPNMITEMACTIVATE zeigen. Ich denke mal da liegt der Hase im Pfeffer. Wenn sonst kein Fehler mehr drin ist müsste es dann gehen.



  • case WM_PAINT:
    		{
    			return 0;
    		}
    

    Du mußt entweder WM_PAINT auch bearbeiten, wenn du es abfängst und 0 zurückgibst, oder du lässt es durch DefWindowProc bearbeiten.

    Mach daraus also entweder:

    case WM_PAINT:
    		{
    			PAINTSTRUCT ps;
    			BeginPaint(hWnd, &ps);
    			/* irgendwas zeichnen */
    
    			EndPaint(hWnd, &ps);
    			return 0;
    		}
    

    Oder wenn du da eh nix drin hast, lass es ganz weg.



  • Das mit dem WM_PAINT stimmt natürlich... In meiner richtigen Anwendung hab ich das auch gemacht. Nur spackt es da immer noch rum...
    Zum NM_DBLCLK: In der MSDN steht das aber so drin?

    LPNMITEMACTIVATE lpnmitem = (LPNMITEMACTIVATE) lParam;
    

    http://msdn.microsoft.com/en-us/library/bb774867(VS.85).aspx?ppud=4

    Hat vielleicht noch jemand eine Idee oder könnte vielleicht einer einmal meinen kompletten Source durchschauen...??

    MfG Tim



  • in deinem geposteten prog funzt es wenn man WM_PAINT behoben hab. zeig mal das ganze prog.



  • So....
    Erst mal VIELEN VIELEN DANK euch allen und speziell euch beiden.
    Ich hab es jetzt gelöst. Es lang an einer Font die ich falsch initialisiert habe...:)

    MfG Tim


Anmelden zum Antworten