Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: Treeview key is invalid for some value
Message
From
01/09/2003 09:10:32
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
BUG: Treeview key is invalid for some value
Miscellaneous
Thread ID:
00825036
Message ID:
00825036
Views:
55
Hi,

if you try to add a node to one ActiveX MS Treeview, you can get a error
"Invalid key".

This occurs for string key with a combination of this characters:
CHR(0)
CHR(9)
CHR(10)
CHR(11)
CHR(12)
CHR(13)
CHR(32)
CHR(128)
CHR(160)
&+-0123456789
Char setting for decimal point on Windows international settings
If ActiveX MS Treeview version change, the invalid set of key change
( i try VS6 SP4 and VS6 SP6 ).

Example:
   PUBLIC ox
   ox=NewObject("test")
   ox.Show

   DEFINE CLASS test AS form

      Caption = "Form1"
      Name = "Form1"

      ADD OBJECT olecontrol1 AS olecontrol WITH ;
         OleClass = "MSComCtlLib.TreeCtrl.2", ;
         DragMode = 1, ;
         Top = 24, ;
         Left = 36, ;
         Height = 180, ;
         Width = 276, ;
         Name = "Olecontrol1"

      PROCEDURE olecontrol1.Init
      this.nodes.add(,,"1","Test 1")
      this.nodes.add(,,CHR(9)+"1"+CHR(160)+CHR(0),"Test 2")
      this.nodes.add(,,CHR(128)+"1."+CHR(0)+CHR(0),"Test 3")
      this.nodes.add(,,"1.0+-","Test 4")           && <-- No number -> OK
      this.nodes.add(,,"1.0"+CHR(0)+"+-","Test 5") && <-- CHR(0) cut right chars -> number -> Invalid
      this.nodes.add(,,"-1","Test 6")
      
   ENDPROC

   ENDDEFINE 
The ActiveX Treeview evaluate the key for get a number, if it get a
valid number, then it return a Invalid key.

It is incredible why a MS developer invents one of the sort what.

It invents this because it supposes idiot me and if use a numerical key, I can confuse the key with the index?
But i'm not idiot.

Fabio
Next
Reply
Map
View

Click here to load this message in the networking platform