Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Bug Reports
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.


ControlType() and library objects


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-21-2007, 01:13 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,704
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default ControlType() and library objects

I don't know if this is a wishlist item or a bug so I plumped for a bug!

ControlType("object") returns "Other.SwrapObject" for any objects from a library. It would be nice if it returned the Class name from the library - which B4PPC already knows.
Reply With Quote
  #2 (permalink)  
Old 11-22-2007, 08:26 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

You could use object.ToString to get the class name.
Reply With Quote
  #3 (permalink)  
Old 11-22-2007, 09:46 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,704
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

The problem is that this only works on objects from external libraries. If I iterate the controls returned by GetControls(""), which are a mixture of B4PPC native control and library objects it fails on the native controls. Please consider this for the next release. It is impressive that the treatment of external objects is so orthogonal with that of native controls (AddEvent, Control(), AddObject) but this is the one thing that I have found (so far ) that I can't work round.
Reply With Quote
  #4 (permalink)  
Old 11-22-2007, 09:57 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

Here is a workaround:
Code:
c = "someobject"
If ControlType(c) = "Other.SWrapObject" Then
       Msgbox(Control(c).ToString)
Else
      Msgbox(ControlType(c))
End If
The object must first be created (using New).
This will be fixed in the next version.
Reply With Quote
  #5 (permalink)  
Old 11-22-2007, 12:00 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,704
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
This will be fixed in the next version.
Thank you Erel.

I have already tried that workaround but it is not precise enough identification. I wanted to know the actual type of a control but I can work around it for time being.


You obviously realised what I was after but of course my previous post
Quote:
it fails on the native controls
Should have been "fails on the library controls"
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ControlType for ArrayList glook Bug Reports 2 02-18-2008 11:31 AM
Table objects? LineCutter Questions & Help Needed 2 02-08-2008 08:41 AM
Cannot (always) use Objects as parameters Woinowski Bug Reports 12 01-07-2008 11:36 AM
Help about variables/objects skipper Questions & Help Needed 6 12-19-2007 04:45 PM
Classes and objects emidio78 Basic4ppc Wishlist 2 09-28-2007 01:21 PM


All times are GMT. The time now is 10:50 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0