Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Foreign Languages > Italian Forum
Home Register FAQ Members List Search Today's Posts Mark Forums Read


Lettura del registry


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2008, 02:01 PM
Junior Member
 
Join Date: Mar 2008
Posts: 35
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, 6 views)

Last edited by Raytracer : 04-17-2008 at 02:08 PM.
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 08:41 AM
maXim's Avatar
Senior Member
 
Join Date: May 2007
Location: Florence, Italy
Posts: 129
Send a message via MSN to maXim
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 08:47 AM.
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 09:49 AM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 116
Send a message via Skype™ to giannimaione
Smile bada come parli ...

Max che significa "gattonato" ?
__________________
Gianni Maione
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 10:07 AM
Filippo's Avatar
Senior Member
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 184
Default

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

Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
PDA: Psion Serie 5 mx Pro
______________________
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 12:43 PM
Junior Member
 
Join Date: Mar 2008
Posts: 35
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 12:49 PM.
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 01:31 PM
maXim's Avatar
Senior Member
 
Join Date: May 2007
Location: Florence, Italy
Posts: 129
Send a message via MSN to maXim
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, 01:50 PM
Junior Member
 
Join Date: Mar 2008
Posts: 35
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 02:18 PM.
Reply With Quote
  #8 (permalink)  
Old 04-18-2008, 05:33 PM
Filippo's Avatar
Senior Member
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 184
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
Attached Files
File Type: sbp TEST.sbp (1.1 KB, 1 views)
__________________
PPC: MDA Pro, 2GB SD
PDA: Psion Serie 5 mx Pro
______________________

Last edited by Filippo : 04-18-2008 at 06:21 PM.
Reply With Quote
  #9 (permalink)  
Old 04-19-2008, 11:04 AM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 116
Send a message via Skype™ to giannimaione
Question errore compilazione device


Ragazzi non riesco a compilare test.sbp , il file postato da Filippo
Attached Images
File Type: jpg errore-test.JPG (33.9 KB, 5 views)
__________________
Gianni Maione
Reply With Quote
  #10 (permalink)  
Old 04-19-2008, 01: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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
NullReference error with Registry alfcen Questions & Help Needed 10 04-09-2008 12:50 AM
Registry to Tree View willisgt Questions & Help Needed 0 02-20-2008 04:17 PM
reading and editing registry Dr. Feelgood Questions & Help Needed 3 02-16-2008 07:18 AM
Reload registry after change? mcflaytasche Questions & Help Needed 8 06-13-2007 07:50 PM
registry bdiscount Questions & Help Needed 4 05-11-2007 02:29 PM


All times are GMT. The time now is 05:47 PM.


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