Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


OwnerInfo for Smartphone


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-21-2007, 02:16 PM
Junior Member
 
Join Date: Nov 2007
Posts: 17
Default OwnerInfo for Smartphone

I tried to used the Owner info file for smartphone and ran into problems. How does one add Objects since the Visual IDE does not allow it. I added the library but do not know how to add the object.

The First line Reg.New1 can not be added. How does one do this?
Thanks for your help.
Amit

The code is below:


Sub App_Start
Reg.New1 'Registry object is named 'reg'
Main.Show
End Sub


Sub File_Click

If CPPC = false Then Return 'this is not for the desktop

Reg.RootKey(Reg.rtCurrentUser)
buff() =Reg.GetValue("ControlPanel\Owner\","Owner")
For i = 0 To ArrayLen(buff()) -1 Step 2
If buff(i)=0 Then Exit 'Chr(0) separates the name from other owner entries
m = m & Chr(buff(i))
Next

'Msgbox ("Owner name is "& m)
End Sub
Reply With Quote
  #2 (permalink)  
Old 11-21-2007, 03:10 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 575
Default

Tools > Add Object > Registry

... and type Reg into the prompted dialog window.


specci48
Reply With Quote
  #3 (permalink)  
Old 11-21-2007, 03:33 PM
Junior Member
 
Join Date: Nov 2007
Posts: 17
Default Add Object grayed out

For some reason the ADDObject under TOOLs is grayed out and nonfunctional. Why would that be?
Reply With Quote
  #4 (permalink)  
Old 11-21-2007, 04:06 PM
Junior Member
 
Join Date: Nov 2007
Posts: 17
Default Adding Object & other issues

I found out that I have to add DLL file in both Device and desktop to add the object.
After I compile the project and transfer it to the device, I get the following error:
"Invalid CastException"
Reply With Quote
  #5 (permalink)  
Old 11-22-2007, 07:29 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,815
Default

You should add RegistryDesktop to the desktop and RegistryDevice to the device.
This example may help you: Reading com ports information from the registry
Reply With Quote
  #6 (permalink)  
Old 11-23-2007, 01:26 AM
Junior Member
 
Join Date: Nov 2007
Posts: 17
Default OwnerInfo on Smartphone error

Thanks for the information, I eventually figured that out. Now back to the real question, Get Owner Info Working on Smartphone.
I managed to compile the project and transfer it to the device, I get the following error:
"Invalid CastException"
Reply With Quote
  #7 (permalink)  
Old 11-23-2007, 06:15 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,815
Default

This key is not available on all devices.
New devices store this information under: CurrentUser\ControlPanel\Owner\Name
The format is different as well (simple string).
Here is a very nice registry editor: http://www.phm.lu/Products/Smartphone/RegEdit/
Reply With Quote
  #8 (permalink)  
Old 11-23-2007, 08:49 AM
Junior Member
 
Join Date: Nov 2007
Posts: 17
Default Smartphone Owner Name

I checked the registry value with the program you mentioned. And it is indeed "CurrentUser\Control Panel\Owner\Name". However with this change I get an error message:
"An error occured on SubOwner_Click.
Line Number 0.
Error Description: An error occurred retrieving the registry key"
Reply With Quote
  #9 (permalink)  
Old 11-23-2007, 09:32 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,815
Default

What code are you using to read the registry?
Try this:
Code:
  Reg.RootKey(Reg.rtCurrentUser)
msgbox(Reg.GetValue("ControlPanel\Owner\","Name"))
Reply With Quote
  #10 (permalink)  
Old 11-23-2007, 11:26 AM
Junior Member
 
Join Date: Nov 2007
Posts: 17
Default

Thank you very much. The code you suggest worked.
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
Using hw keys in MS Smartphone TomasNM Questions & Help Needed 4 02-25-2008 03:30 PM
Smartphone EXEs corwinckler Bug Reports 1 01-19-2008 09:15 AM
Distribution on Smartphone kshetarpal Questions & Help Needed 2 11-23-2007 02:30 AM
fax with VM5 smartphone giannimaione Questions & Help Needed 4 07-10-2007 07:29 AM
How i can run my programs on smartphone? UnitZ Questions & Help Needed 4 06-03-2007 03:03 PM


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


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