Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Foreign Languages > Italian Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Lettura del registry

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2008, 03:01 PM
Junior Member
 
Join Date: Mar 2008
Posts: 46
Default Lettura del registry

Ho scritto queste righe:

Sub Globals
'Declare the global variables here.
Dim number, name, files(0) As string, binary(0) As byte
End Sub

Sub App_Start
reg.New1
reg.RootKey(reg.rtLocalMachine)
number = reg.GetValue("Software\OEM", "SysLang") 'Number Of Items is of type REG_DWORD
name = reg.GetValue("Software\Comm", "AutoRun") 'User Name is of type REG_SZ
files() = reg.GetValue("Software\Drivers\BuiltIn", "IClass") 'Recent file is of type REG_MULTI_SZ (multi - string)
binary() = reg.GetValue("Software\AudioCompressionManager\Dri verCache\msacm.msg711","aFormatTagCache") 'BinaryValue is of type REG_BINARY

Msgbox(number, "DWORD")
Msgbox(name, "STRING")
Msgbox(files(), "MULTISTRING")
Msgbox(binary(), "BINARY")

End Sub


Mi viene restituito l'errore di "chiave non trovata" sulla lettura della DWORD; se provo ad escludere la riga, stessa cosa per la STRING.
La cosa più strana è che ho copiato pari pari l'esempio del Manuale; l'unica variazione è stata effettuata sui path delle variabili del registry da leggere.
Premetto che ho usato una sintassi simile per leggere keys su HKCU (anzichè HKLM) senza problemi di sorta... sono di nuovo costretto a chiedervi aiuto
Attached Files
File Type: sbp TEST.sbp (938 Bytes, 18 views)

Last edited by Raytracer : 04-17-2008 at 03:08 PM.
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 09:41 AM
maXim's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Sesto Fiorentino - Florence (Italy)
Posts: 224
Send a message via MSN to maXim Send a message via Skype™ to maXim
Awards Showcase
Beta Tester 
Total Awards: 1
Post

Ciao Raytracer,

premetto che ho potuto effettuare i test solo sul desktop (l'altro ieri hanno "gattonato" il mio PPC) quindi non so se ti sarò di aiuto ma ecco cosa ho fatto:
  • ho generato delle nuove key con relativi path per effettuare i test
  • ho scaricato la tua procedura di test cambiando i path e le key con i miei nuovi riferimenti
  • ho continuato a avere il solito errore
  • ho verificato le librerie assegnate (da Tools -> Components) e ho scoperto che al desktop è stata assegnata la stessa DLL del device (RegistryDevice.dll invece di RegistryDesktop.dll)
  • ho sostituito la DLL per il desktop con quella appropriata (RegistryDesktop.dll)
  • FUNZIONA!
Fammi sapere...

Saluti,

Massimo

Last edited by maXim : 04-18-2008 at 09:47 AM.
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 10:49 AM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 199
Send a message via Skype™ to giannimaione
Awards Showcase
Beta Tester 
Total Awards: 1
Smile bada come parli ...

Max che significa "gattonato" ?
__________________
Gianni Maione
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 11:07 AM
Filippo's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 906
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Gianni, ma è facile, il ppc è diventato un Gatto!

Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 01:43 PM
Junior Member
 
Join Date: Mar 2008
Posts: 46
Default

A parte l'errata assegnazione della stessa dll anche a desktop, confermo: non funziona...
O quantomeno, non va su PPC: ho provato anche a leggere altre keys, stessi errori.
Chiedo una cortesia a Gianni e/o a Filippo: potreste provare sul vostro PPC se va?
Nel caso in cui anche a voi non dovesse andare, vedo di segnalarlo come possibile bug a Erel.

P.S. - @ Massimo: grazie per il test, e mi dispiace che ti abbiano rubato il tuo PPC...

Last edited by Raytracer : 04-18-2008 at 01:49 PM.
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 02:31 PM
maXim's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Sesto Fiorentino - Florence (Italy)
Posts: 224
Send a message via MSN to maXim Send a message via Skype™ to maXim
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Ciao Raytracer,

come ti avevo accennato non sono più in possesso del mio PPC e quindi non posso verificare quanto ti ho esposto in precedenza...


Ma sei sicuro dei percorsi? Per quello che mi ricordo:
reg.GetValue("Software\Comm", "AutoRun")
dovrebbe essere:
reg.GetValue("\Comm", "AutoRun")
senza "Software\"


E "IClass", per quale driver interroghi la chiave?
reg.GetValue("Software\Drivers\BuiltIn", "IClass")
dovrebbe essere:
reg.GetValue("Drivers\BuiltIn\Battery", "IClass")
Mi sono permesso di porre i suddetti quesiti perché, da quello che credo di aver capito, tutti e due si sta lavorando a dei progetti che prevedono una gestione del registro simile e, visto che mi sono ricordato di essere già passato da una esperienza simile, ho ritenuto opportuno di informarti...

Fammi sapere,

Massimo

P.S. non vedo l'ora di procurarmi un nuovo PPC, mi manca e non solo per fare sperimentazione!
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 02:50 PM
Junior Member
 
Join Date: Mar 2008
Posts: 46
Default

Ciao Massimo,
ho provato anche come suggerivi a eliminare "Software dal codice, purtroppo senza nessun risultato.
Lavorando su Keys sotto HKCU mi sembra comunque di ricordare di aver messo il path completo, verificherò e ti farò sapere. La cosa più strana, infatti, è che riscontro questo problema solo su HKLM... tanto da farmi venire il dubbio che possa trattarsi di una mia grossolana svista o di un bug. Nel dubbio, ho postato lo stesso interrogativo anche nella parte in Inglese del Forum in modo che anche altri possano rispondermi (e se si tratta davvero di un bug, che Erel possa verificarlo).

[Edit]: Ti confermo di aver messo il path completo di "Software operando su keys sotto HKCU, senza riscontrare l'inconveniente.

[OT]Hai trovato utile la segnalazione a proposito di come ottenere l'IMEI? Pensi sia possibile una portabilità del codice VB in codice nativo B4PPC? Ho letto nel Forum Principale molte persone che si interrogavano su come ottenerlo, ma stranamente nessuna risposta nel topic da me aperto...
Capisco il tuo disagio nel non avere un PPC sottomano, una volta che ti abitui ad averli con te difficilmente ne riesci a fare a meno...[OT]

Last edited by Raytracer : 04-18-2008 at 03:18 PM.
Reply With Quote
  #8 (permalink)  
Old 04-18-2008, 06:33 PM
Filippo's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 906
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Ciao Raytracer,

ho modificato un poco il tuo esempio ma non perchè le funzioni siano sbagliate ma perchè quelle chiavi che tu cerchi non esistono, almeno sul mio ppc.

Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________

Last edited by Filippo : 04-18-2008 at 07:21 PM.
Reply With Quote
  #9 (permalink)  
Old 04-19-2008, 12:04 PM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 199
Send a message via Skype™ to giannimaione
Awards Showcase
Beta Tester 
Total Awards: 1
Question errore compilazione device


Ragazzi non riesco a compilare test.sbp , il file postato da Filippo
__________________
Gianni Maione
Reply With Quote
  #10 (permalink)  
Old 04-19-2008, 02:03 PM
HTC HTC is offline
Newbie
 
Join Date: Mar 2008
Location: London
Posts: 9
Default

Hi Raytracer,

maXim is right: Those paths do not exist!
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
WM6.1 Backlight Timeout (Registry) digitaldon37 Open Source Projects 3 11-20-2008 05:23 PM
NullReference error with Registry alfcen Questions (Windows Mobile) 10 04-09-2008 01:50 AM
Registry to Tree View willisgt Questions (Windows Mobile) 0 02-20-2008 05:17 PM
reading and editing registry Dr. Feelgood Questions (Windows Mobile) 3 02-16-2008 08:18 AM
registry bdiscount Questions (Windows Mobile) 4 05-11-2007 03:29 PM


All times are GMT. The time now is 10:10 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0