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

RegCreateKeyEx functionality, specify class(object type) of a key, with .NET?

The RegCreateKeyEx() API provides a parameter to specify the
class(object type) of the a key. (lpClass in the definition below)

LONG RegCreateKeyEx(
HKEY hKey,
LPCTSTR lpSubKey,
DWORD Reserved,
LPTSTR lpClass,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
)

The RegistryKey class in the .NET framework do not provide this
functionality.
How do I do this in .NET?
Nov 22 '05 #1
3 3103
Truth. I've never seen someone use that parameter and don't even know
what it does.

Solution. You could write a interop function that calls the
RegCreateKeyEx Win32 API directory.

Hope this helps,

Randy
http://www.kbcafe.com

sa***@hotmail.com (Saby) wrote in message news:<84**************************@posting.google. com>...
The RegCreateKeyEx() API provides a parameter to specify the
class(object type) of the a key. (lpClass in the definition below)

LONG RegCreateKeyEx(
HKEY hKey,
LPCTSTR lpSubKey,
DWORD Reserved,
LPTSTR lpClass,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
)

The RegistryKey class in the .NET framework do not provide this
functionality.
How do I do this in .NET?

Nov 22 '05 #2
Truth. I've never seen someone use that parameter and don't even know
what it does.

Solution. You could write a interop function that calls the
RegCreateKeyEx Win32 API directory.

Hope this helps,

Randy
http://www.kbcafe.com

sa***@hotmail.com (Saby) wrote in message news:<84**************************@posting.google. com>...
The RegCreateKeyEx() API provides a parameter to specify the
class(object type) of the a key. (lpClass in the definition below)

LONG RegCreateKeyEx(
HKEY hKey,
LPCTSTR lpSubKey,
DWORD Reserved,
LPTSTR lpClass,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
)

The RegistryKey class in the .NET framework do not provide this
functionality.
How do I do this in .NET?

Nov 22 '05 #3
Thanks.
I used the following... Works great.

[DllImport("advapi32.dll")]
public static extern int RegCreateKeyEx(
uint hKey,
string lpSubKey,
int Reserved,
string lpClass,
int dwOptions,
int samDesired,
ref int lpSecurityAttributes,
ref uint phkResult,
ref int lpdwDisposition
);

uint hKey = 0;
int disp = 0;
int reserved = 0;
int ret = 0;
uint root = 0x80000002; //HKLM
ret = SomeClass.RegCreateKeyEx(root, "SOFTWARE\\test1", 0,
"Parameter", 0,0,ref reserved, ref hKey, ref disp);

rm****@kbcafe.com (Randy Charles Morin) wrote in message news:<a4*************************@posting.google.c om>...
Truth. I've never seen someone use that parameter and don't even know
what it does.

Solution. You could write a interop function that calls the
RegCreateKeyEx Win32 API directory.

Hope this helps,

Randy
http://www.kbcafe.com

Nov 22 '05 #4

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

Similar topics

2
by: Krzysztof Stachlewski | last post by:
I tried to run the following piece of code: Python 2.3.4 (#53, May 25 2004, 21:17:02) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> o = object() >>> o.a...
106
by: A | last post by:
Hi, I have always been taught to use an inialization list for initialising data members of a class. I realize that initialsizing primitives and pointers use an inialization list is exactly the...
2
by: Saby | last post by:
The RegCreateKeyEx() API provides a parameter to specify the class(object type) of the a key. (lpClass in the definition below) LONG RegCreateKeyEx( HKEY hKey, LPCTSTR lpSubKey, DWORD...
9
by: justanotherguy63 | last post by:
Hi, I am designing an application where to preserve the hierachy and for code substitability, I need to pass an array of derived class object in place of an array of base class object. Since I...
1
by: ypjofficial | last post by:
Dear All, According to OOPs , a base class pointer can to point to derived class object....call this as fact1 But somehow I am not comfortable while understanding this concept. The explanaition...
6
by: Brad | last post by:
I am creating a class (not a control) which implements IStateManager. I've created the class and all of the implementations (LoadView, SaveViewState, etc...). My Question is: How do I...
3
by: Tony Johansson | last post by:
Hello!! You may correct me if I have made any wrong assumptions. Below I have some simple classes. When you have this t.ToString() below it's the ToString() method in Object class that is...
13
by: docschnipp | last post by:
Hi, I have a bunch of object derived from the same base class. They all share the same constructor with some parameters. Now, instead of using a large switch() statement where I call every...
1
by: archana | last post by:
Hi all, I am confuse in concept of inheritance. I am having following 2 classes class base1 { public void abc() { System.Console.WriteLine("base1 abc"); }
13
by: Rahul | last post by:
Hi Everyone, I was just playing around virtual functions and landed up with the following, class Base1 { public: virtual void sample() { printf("base::sample\n");
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.