English
Forum

GetItemText not working

 
Hi,

The function GetItemText does not work for me, if I the LV not the Mainwindow (%hWnd) create.
CompileMarkSeparation ->
CompileMarkSeparation
LV2& = CreateListView(Dialog&,%hInstance,GetSysColor(23),GetSysColor(24),-1,$31)
>
->

I have the same Completed: v1.6 and v1.7.

Why can the lying? - make I what wrong?

thanks for Your Mithilfe
Thomas
 
10/12/05  
 




Frank
Abbing
Hi,

unfortunately can I momentarily not testing - having Systemzusammenbruch and kompletten Datenverlust. Perhaps can someone other the time try.
 
10/12/05  
 



Hello Thomas - could You one Minimalbeispiel post - then can it rather understand...

Thank you!
 
10/12/05  
 




CompileMarkSeparation
LV2 erstellen
lvAuftrag& = CreateListView(%hWnd,%HInstance,GetSysColor(23),GetSysColor(24),-1,$21)
InsertColumn lvAuftrag&,"Beschreibung",0,0
InsertColumn lvAuftrag&,"Art.-Nr."    ,0,0
.
.
.
InsertColumn lvAuftrag&,"Bestellmenge",0,2
.
* Daten einlesen, dann LV anzeigen
ShowListview(lvAuftrag&,Width(%hWnd) /100 *4,Height(%hWnd) /100 *34,Width(_GB2%) /100 *94,Height(_GB2%) /100 *80)
* bestimmte Sätze markieren
*  markierte  Sätze auslesen, z.B. zum Drucken, Speichern usw.
GetItemText(lvAuftrag&,_lvLineMem#,1,_jj%)
_prArtNr$ = Trim$(String$(_lvLineMem#,0))
Die Variable _prArtNr$ enthält den korrekten Eintrag
Werden die Befehle jetzt auf GB2& (Handle einer GroupBox) umgeschrieben:
LV2 erstellen
lvAuftrag& = CreateListView(GB2&,%HInstance,GetSysColor(23),GetSysColor(24),-1,$21)
InsertColumn lvAuftrag&,"Beschreibung",0,0
InsertColumn lvAuftrag&,"Art.-Nr."    ,0,0
.
InsertColumn lvAuftrag&,"Bestellmenge",0,2
.
* Daten einlesen, dann LV anzeigen
ShowListview(lvAuftrag&,Width(GB2&) /100 *4,Height(GB2&) /100 *34,Width(GB2&) /100 *94,Height(GB2&) /100 *80)
* bestimmte Sätze markieren
*  markierte  Sätze auslesen, z.B. zum Drucken, Speichern usw.
GetItemText(lvAuftrag&,_lvLineMem#,1,_jj%)
_prArtNr$ = Trim$(String$(_lvLineMem#,0)<
)

remaining The Variable _prArtNr$ empty (Content: , Len(_prArtNr$) = 0)

the understand I do not!

Thomas

P.s. _jj% is a pure Zählvariable, 0 ~ GetLines(LV) -1

P.P.s.: circa code-day extended of Michael Wodrich
 
10/13/05  
 



Nachtrag:
the List view becomes in both Make correctly filled with
SetItem lvAuftrag&,cItemData_0$,...,cItemData_n$
The display of Listviews is in both entrapments correctly.

but Raise Line() functions too only, if as lever %hWnd indicated becomes.
too to one change the MessageHandllings over InitMessage(GB2&) works not How expects...

thanks
 
10/13/05  
 




Michael
Wodrich
How becomes because GB2& initialized.. (this Codeteil missing here).

rather is always one small lauffähiges Codeteil, even if defective.

...and Codes Please possible in code-Tags settle, there recognize one More...
(straight with longer Codes important)

Best wishes
Michael Wodrich
 
Programmieren, das spannendste Detektivspiel der Welt.
10/13/05  
 




Frank
Abbing
Hi,

i think, it forget just the Dialog-Window To initieren.

[quote:f145ca6078]InitMessages(F)

Initiert the Subclassing for all verwendeten Listviews in the Window F.

F : Long - lever the Fensters, in the one List view prepares watts, z.B.(%HWND).

first through these function becomes The automatic Sorting and the request angeklickter or markierter Items possible.
InitMessages() must not for each List view uses go, must but for each Window called go, in the at least one List view is used.
Mehrfachaufrufe for a and the same thing Window are not permits and make for Fehlern!
InitMessages() zapft any Messages for a Window ex, before tappt im dunkeln there gelangen. defined Messages then for Own tack mißbraucht or changed.
best is it, first any Listviews aufzubauen and Text To fill, and to that Schluss for each Window, in the itself (at least) one List view befindet, InitMessages() to execute.
exits becomes The function with CloseMessages(), best, short before The List view.dll again entladen becomes.

InitMessages(%HWND)
InitMessages(DIALOGFENSTER%). [/quote:f145ca6078]
 
10/13/05  
 



first time thanks for Your Answer.

@Frank: How already written, helps the on the MessageHandling nothing...

@Michael: How bschrieben is GB2& a GroupBox, prepares with Create(Groupbox,%hWnd,Text,0.0.100,100)

greeting
Thomas
 
10/14/05  
 




Michael
Wodrich
[quote:cc5b333cb1=Gast]
@Michael: How bschrieben is GB2& a GroupBox, prepares with Create(Groupbox,%hWnd,Text,0.0.100,100)[/quote:cc5b333cb1]
The problem is Yes simply, that we your Sourcecode not see can. so is naturally a Help you don't say so. here have You z.B. simply a Tippfehler (spots instead of Kommata) made.
How the in the real code looks - well Yes...

there become You then well time debuggen must. simply for each element, the involved is a Datenausgabe write. is the supplied lever really mismatched zero etc.
On these manner must You yourself then on whom Error herantasten. Evtl. instead of the code-Einfügungen too whom right Debugger using - moreover is it Yes there...

Best wishes
Michael Wodrich
 
Programmieren, das spannendste Detektivspiel der Welt.
10/14/05  
 




Frank
Abbing
so, Guest Thomas.

now could ichs testing. GetItemText() functions correct too with Dialogfenstern!
You make means somewhere a others Error, probably whom Syntaxfehler, How it Michael already described having.

Poste Please nächstes time always a kompletten Minimalsource, the the trouble aufweist, that you report want. otherwise is a Fehlersuche simply not nachvollziehbar.
 
10/15/05  
 



OK, OK.

a Syntaxfehler can I definitiv exclude, because if I GB2& against %hWnd swaps, funktionierts! Also go Syntaxfehler gemeldet, but here have I one kurzes Listing prepared:
CompileMarkSeparation
declare GB1&,GB2&,GB3&,GB4&,LV1&,LV2&,lvdll&
declare ende&,btn&,txt1&,txt2&
declare LVmarked&,LineMarked&,IsMarked&
declare LV_Mem#,LVItemText$
dim LV_Mem#,256
CLS
ListView DLL & Funktionen bereitstellen
lvdll& = UseDLL("Listview.dll")
 $I LV_FUNCTION.INC
InitMessages(%HWnd)
InitMessages(GB2&)
Bildschirmmaske aufbauen
GB1&  = Create("Groupbox",%hWnd," Groupbox #1 - Handle des LV auf %hWnd ", 10, 10,300,180)
GB2&  = Create("Groupbox",%hWnd," Groupbox #2 - Handle des LV auf GB2& " , 10,210,300,180)
GB3&  = Create("Groupbox",%hWnd,""                                       ,310,140,160, 50)
GB4&  = Create("Groupbox",%hWnd,""                                       ,310,340,160, 50)
txt1& = Create("TEXT"    ,GB3& ,"..."                                    , 10, 12,140, 30)
txt2& = Create("TEXT"    ,GB4& ,"..."                                    , 10, 12,140, 30)
btn&  = Create("Button"  ,%hWnd,"DATEN WERDEN EINGELESEN..."             , 10,400,620, 30)
ende& = Create("Button"  ,%hWnd,"Beenden"                                ,530, 10,100,380)
EnableWindow btn& ,0
EnableWindow ende&,0
LV erstellen
dieses LV wird auf dem Hauptfenster erstellt
LV1& = CreateListView(%hWnd,%HInstance,RGB(0,0,0),RGB(0,127,127),-1,$25)
InsertColumn LV1&," "       ,40,0
InsertColumn LV1&,"LS- Nr." ,90,0
InsertColumn LV1&,"Art.-Nr.",90,0
und dieses auf der Groupbox, die auf dem Hauptfenster erstellt wurde
LV2& = CreateListView(GB2&,%HInstance,RGB(0,0,0),RGB(127,127,127),-1,$25)
InsertColumn LV2&," "       ,40,0
InsertColumn LV2&,"LS- Nr." ,90,0
InsertColumn LV2&,"Art.-Nr.",90,0
Einlesen der DB
LS_NR und ART_NR sind alphanumerisch (C,10)
dbOPEN(#1,"LS")
dbUse(#1)
Einlesen

WhileNot %dbEOF

    dbGo(&Loop -1)
    SetItem LV1&,"",Trim$(dbGet$("LS_NR")),Trim$(dbGet$("ART_NR")),Str$(&LOOP +1)
    SetItem LV2&,"",Trim$(dbGet$("LS_NR")),Trim$(dbGet$("ART_NR")),Str$(&LOOP +1)

WEnd

dbClose(#1)
Anzeigen der LVs
ShowListView(LV1&,20,30,252,150)
ShowListView(LV2&,10,20,252,150)
Beginn des Auslesens
SetText btn&,"Zum Auslesen markieren, dann hier klicken..."
EnableWindow ende&,1
EnableWindow btn& ,1

While 1

    CLEAR LV_Mem#,LVmarked&,LineMarked&,IsMarked&,LVItemText$
    WaitInput

    If %GetFocus = ende&

        Beenden
        break

    endif

    If %GetFocus = btn&

        Wurde in einem LV markiert?
        GetChecked(Addr(LVmarked&),Addr(LineMarked&),Addr(IsMarked&))

        If IsMarked&

            GetItemText(LVmarked&,LV_Mem#,2,LineMarked&)
            LVItemText$ = String$(LV_Mem#,0)

            If LVmarked& = LV1&

                SetText txt1&,LVItemText$
                SetText txt2&,"..."

            Else

                SetText txt1&,"..."
                SetText txt2&,LVItemText$

            EndIf

            SetCheckboxState(LVmarked&,LineMarked&,0)

        EndIf

    EndIf

WEnd

Handling abschalten
CloseMessages(GB2&)
CloseMessages(%HWnd)
Speicher aufräumen
Dispose clv1#
Dispose clv2#
Dispose clvall#
Dispose lvitem#
DLL entladen
FreeDLL lvdll&
the wars!
END

here can I of course in GB2 The Mark settle / delete, but ausgewertet becomes tappt im dunkeln not...

mfG
Thomas

P.s. On wish mail I The DB as ZIP To.
 
10/16/05  
 



@Thomas: my wish would the The Leuz here in the Community the vorgesehene
CompileMarkSeparation Tags.

salvo.
 
10/16/05  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.351 Views

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie