![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I've checked all the examples on the forum which included treeview, but all examples have the same issue (or appear to have it)
I'm writing an application where the user can select a file (just the path) I tried to do this with FileOpen but that only allows me access to the memory card, Treeview was the next option, the examples on the forum all have the same problem , they give an error when I try to compile them: "Unknown control type Use Control (Name,Type) instead" Line XXX : Control(node).addnewnode (SubString(s,c,StrLength(s)-c)) changing this to Control(node,treeview).addnew....etc. Seems to solve it in the EDI but when I run the compiled program I get the attached error.. (this is for the desktop version, the ppc version also has errors) Any help is appreciated Thanks |
|
|||
|
Quote:
I also tried Form, listbox and arraylist but no dice :-( |
|
|||
|
Well thats the weird thing, i didn't change anything from the downloaded application, since i didn't know how to use treeview I downloaded an example
to see if i could figure out how it worked, but when i test the examples they give me errors, i'm trying to find out why so i can use treeview in my own application. What happens if you try this example from Erel: Treeview - different pics for nodes? When I run it using the IDE I get the Controle(node) message... Do you get the same one? Otherwise it could be my instalations (Desktop & PPC) |
|
||||
|
It works for me with this modified code
Code:
Sub FindFolders (path, node) 'Finds all folders in a specific path WaitCursor(true) al1.clear DirSearch(al1,path) c = StrLength(path) For I =0 To al1.count - 1 s=al1.item(i) Control(node, treeview).addnewnode (SubString(s,c,StrLength(s)-c)) Next al1.Clear FileSearch(al1,path) For I =0 To al1.count - 1 s=al1.item(i) node2.Value = Control(node,treeview).addnewnode (SubString(s,c,StrLength(s)-c)) node2.ImageIndex = 2 node2.SelectedImageIndex = 2 Next Control(node,treeview).expandall WaitCursor(false) End Sub The code is misleading in that the parameter named node is actually a TreeView object! I needed three Control(node, treeview) edits. |
|
||||
|
Hi guys,
the reason for is error is the "optimized compilation". During debug in the IDE or without "optimized compilation" basic4ppc casts the objects treeview and node as needed. So the example was always right up to version 5.8. To speed up the executables with "optimized compilation" ( ) the programmer now has always to declare the right type (treeview or node), even you have to code some routines twice... ![]() specci48 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| identifying a node in treeview | BjornF | Questions & Help Needed | 3 | 05-29-2008 04:47 PM |
| Specified cast is not valid | skipper | Questions & Help Needed | 7 | 03-12-2008 07:17 AM |
| Object Reference not set to an instance of an object | monster9999 | Questions & Help Needed | 9 | 01-15-2008 09:56 PM |
| treeview color (node) | tvrman | Questions & Help Needed | 2 | 08-04-2007 05:57 PM |