473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to retrieve string values (where i made a mistake?)

When i'm trying to retrieve string key from registry that was never written,
i've got a trash string and error that "Cast from string ""?????????" to
type 'Double' is not valid.

It's everytime, that key was never use (defined).
In key is value "Brak tekstu". Where is a problem?

Function LegalNoticeCaption(ByVal strKomputer As String)
Dim oreg
oreg = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\" &
strKomputer & "\root\default:StdRegProv")
Dim dwValue = Nothing
Dim vLegalNoticeCaption = Nothing
Dim strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Policie s\System"
Dim strValueName = "LegalNoticeCaption"
oreg.getStringValue(HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue)
If dwValue Is Nothing Then
vLegalNoticeCaption = "empty"
Else
dwValue = vLegalNoticeCaption
End If
MsgBox(dwValue)
End Function
Nov 21 '05 #1
1 995
Leszek,

The most simple method is to use the default when there is something brak,
Reg = Registry.CurrentUser.CreateSubKey("Software\Moje\L eszek")

pFormWidth = CInt(Reg.GetValue("Width", 700))

pFormHeight = CInt(Reg.GetValue("Height", 400))

I hope this helps?

Cor


Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Salvani Langosta | last post by:
In an Access 97 database, I use serveral global variables that hold information about the database, for example: gstrFileServer - holds the server root where the database is stored...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
3
by: Li Zhang | last post by:
I know I can use controlName.Value to retrieve the form fields value if I am in that page. But if I am out of the page, for example I am in a HttpModule, I want to retrieve a hidden filed value, Is...
0
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a...
13
by: no.mail.pls | last post by:
Hiya, How do i retreive fields with similar values from 2 tables? I tried to use (1) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like '%p.name%'"; but it retrieves nothing at...
3
by: CrimeMaster | last post by:
Hi i have made a Key under the HKEY_LOCAL_MACHINE\Software\My Toolbar\Setting. i have placed some values under the Setting key. i m trying to access the values under that key and want to map them...
14
by: Mosfet | last post by:
Hi, what is the most efficient way of doing a case insensitive comparison ? I am trying to write a universal String class and I am stuck with the case insensitive part : TCHAR is a char in...
4
by: Archanak | last post by:
Hi, I have table like this: select * from sampletest; | title ...
9
by: gavy7210 | last post by:
hello friends i am new to struts. i want to add the user information in the database and then display it back to him. i am using struts 1.2,Eclipse Platform Version: 3.4.2,mySql 5.0.1,jdk...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.