473,386 Members | 1,699 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,386 software developers and data experts.

Const declaration

Hi,
how can i delcare Const HKEY_LOCAL_MACHINE = &H80000002 in vbscript to
VB.net ?
thanks
Jan 28 '06 #1
6 2090
> how can i delcare Const HKEY_LOCAL_MACHINE = &H80000002 in vbscript to
VB.net ?


Const HKEY_LOCAL_MACHINE As Integer = &H80000002
Depending on where you place it, you may want Public or Private at the front.

Jan 28 '06 #2
i am using this for StdRegProv
oreg.CreateKey(HKEY_LOCAL_MACHINE, strKeyPath)
it says that 'Value of type 'Integer' cannot be converted to
'System.UInt32'.

any idea?
"AMercer" <AM*****@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
how can i delcare Const HKEY_LOCAL_MACHINE = &H80000002 in vbscript to
VB.net ?
Const HKEY_LOCAL_MACHINE As Integer = &H80000002
Depending on where you place it, you may want Public or Private at the

front.

Jan 28 '06 #3
> i am using this for StdRegProv
oreg.CreateKey(HKEY_LOCAL_MACHINE, strKeyPath)
it says that 'Value of type 'Integer' cannot be converted to
'System.UInt32'.


Try

Dim HKEY_LOCAL_MACHINE As System.UInt32 =
System.Convert.ToUInt32(&H80000002L)

I used Dim vice Const because the initializer is too complex for a vb const.
Again, depending on context, you may want public or private vice dim.

I used &H80000002L (note trailing L) because int64 is cls compliant and
uint32 is not.

Jan 28 '06 #4
i got this error during compilation:

An unhandled exception of type 'Sytem.managment.managementException' occured
in system.management.dll
Additional information: not found

the code hangs at inParams = classObj.GetMethodParameters("CreateKey")

what could be wrong?

"AMercer" <AM*****@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
i am using this for StdRegProv
oreg.CreateKey(HKEY_LOCAL_MACHINE, strKeyPath)
it says that 'Value of type 'Integer' cannot be converted to
'System.UInt32'.
Try

Dim HKEY_LOCAL_MACHINE As System.UInt32 =
System.Convert.ToUInt32(&H80000002L)

I used Dim vice Const because the initializer is too complex for a vb

const. Again, depending on context, you may want public or private vice dim.

I used &H80000002L (note trailing L) because int64 is cls compliant and
uint32 is not.

Jan 28 '06 #5
> i got this error during compilation:

I don't think so. I think you got it at runtime.
An unhandled exception of type 'Sytem.managment.managementException' occured
in system.management.dll
Additional information: not found
the code hangs at inParams = classObj.GetMethodParameters("CreateKey")


You need to dig into what went wrong, something like this (untested):

Try
inParams = classObj.GetMethodParameters("CreateKey")
Catch e As system.management.ManagementException
' here, examine such things as e.ErrorCode, e.Message, e.Source, etc,
' my guess is you have bumped into a security issue
End Try

Jan 28 '06 #6
MessageBox.Show(e.Message) = not found
MessageBox.Show(e.Source) = Sytem.managment

what does this means?

"AMercer" <AM*****@discussions.microsoft.com> wrote in message
news:5B**********************************@microsof t.com...
i got this error during compilation:
I don't think so. I think you got it at runtime.
An unhandled exception of type 'Sytem.managment.managementException' occured in system.management.dll
Additional information: not found
the code hangs at inParams = classObj.GetMethodParameters("CreateKey")


You need to dig into what went wrong, something like this (untested):

Try
inParams = classObj.GetMethodParameters("CreateKey")
Catch e As system.management.ManagementException
' here, examine such things as e.ErrorCode, e.Message, e.Source,

etc, ' my guess is you have bumped into a security issue
End Try

Jan 28 '06 #7

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

Similar topics

8
by: Sergey Tolstov | last post by:
Hello, I am working with Visual C++ 6.0 compiler. In the following declaration: int const A = 10, B = 10; both A and B are const. However, in declaration
7
by: johny smith | last post by:
Can someone please explain to me the difference between these two: function1( const int a) function2( int const a) Both seemed to compile, but what is the difference between the two above....
0
by: d3x0xr | last post by:
Heh, spelled out in black and white even :) Const is useles... do NOT follow the path of considering any data consatant, because in time, you will have references to it that C does not handle,...
7
by: W Marsh | last post by:
Hi, Could anybody tell me wh the parameter "T val" is not marked const in this Stroustrup code, considering that val is not modified and not non- const methods called? template<class C,...
15
by: akomiakov | last post by:
Is there a technical reason why one can't initialize a cost static non- integral data member in a class?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.