Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Listboxline

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Listboxline
#13005
Posted by: Michael S 2009-06-16 23:38:25
I have the following code in a generalized startup script for GUI applications

  /* The str arg must be at least as large as the longest line in your listbox. 
   	 Here, we use 500. */
	FUNCDEF('ListboxLine', '32u, void, 32u, 32u, str[500] stor', 'user32', 'SendMessage')

I just ran into a problem whereby RPC crashed on the following line

DO
  bla-bla-bla
  /* No stem passed - get the next line in the progress control */
  listboxline(handle, 393, i - 1, myline)

After a bit, I realized it was because the value in the FUNCDEF (500 in this case) wasn't big enough. Is there some CATCH option that would, well, CATCH such an error ? As it is, RPC simply crashes with no warning or indication of what is incorrect.
Message2.
#13007
Posted by: Jeff Glatt 2009-06-18 01:26:42
The crash is in the OS function "SendMessage" because you passed an inadequately sized buffer. Reginald doesn't know that the second 32u arg is supposed to be the size of the fourth arg character buffer. You need to do your own error checking when passing args directly to an OS function.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-4-19  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0