Re: Win32lib setText
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Nov 11, 2003
- 528 views
----- Original Message ----- From: "H.W Overman" <euman at bellsouth.net> To: <EUforum at topica.com> Subject: Re: Win32lib setText > > > >From: "Derek Parnell" <ddparnell at bigpond.com> > > >> ----- Original Message ----- > >> From: "H.W Overman" <euman at bellsouth.net> > > > > Hey all, > > > > > > Using Win32lib v.59.1 I seem to have an issue with setText to SLE Edit > > > controls. > > > If I specifically send a string sequence e.g; setText(Diag[i],"work") > > > this seems fine but, if I return a string sequence from a buffer it > doesnt > > > work correctly. > > > > > > Has anyone else ran across this? > > > > <soapbox>Please be a LOT more explicit when asking for help. This request > is *way* to vague for anyone to guess correctly what your problem > is.</soapbox> > > > > There must be more than one way to retrieve a string from a buffer, I know > of only one way... > sorry for not being specific. > > > Its not much use just saying "it doesnt work correctly" because that does > not give us any information to help you. > > No (0) string is inserted into the SLE. > > >For example, is it displaying nothing or displaying strange characters? > > No (0) string is inserted into the SLE. (nothing displayed) > > >And what does "return a string sequence from a buffer" actually mean? > >I guess you are using an API functon which is returning a zero-terminated > string at a RAM location and you are getting that string out of RAM and > converting it to >a sequence then using setText(). > > Your a very good guess Derek, > I need to know how to convert the z-string to a sequence suitable for use > with setText > > >Can you see what is in the sequence-string before calling setTExt() using > the trace or even the '?' method? What is the contents? > >Are you sure you are fetching the string correctly from RAM? What is the > API routine you are using? > >Is it just this API routine or all API routines that return a RAM string? > >Can you display the sequence string in a console window? > > YES! The string /s do show up in a console window, this makes me think there > may be something wrong with setText or, > Im not sure how I need to convert the z-string to acceptable sequence > suitable for use with setText > > > -- > > Derek > I continue to no problem with this on my system. Here is some example code... --------------------- without warning include win32lib.ew integer Win, TPath, Btn Win = create(Window, "Temporary File Path", 0, 0,0, 400, 200, 0) TPath = create(SleText, "NOTHING HERE YET", Win, 10, 10, 350, 25, 0) Btn = create(Button, "Get Path", Win, 10, 55, 100, 25, 0) procedure Click_Btn(integer self, integer event, sequence parms) atom addr sequence temp_path integer len len = 255 addr = allocate(len) if w32Func(xGetTempPath, {len, addr}) then temp_path = peek_string(addr) else temp_path = ".\\" end if free(addr) setText(TPath, temp_path) end procedure setHandler(Btn, w32HClick, routine_id("Click_Btn")) WinMain( Win, Normal) --------------------- Again, I ask ... What does the sequence contain? In other words, can you show me, in a reply email, the elements that make up the sequence you are trying to set the SLE to? -- Derek