473,699 Members | 2,612 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing binary data from registry key

Hi Everyone,

I have a managed C++ web service and I'm trying to access the registry
key that contains a binary data.

Can someone tell me how to convert object __gc* to byte[]?

I've got some code:

-----------------------------------------------------------------------
RegistryKey *pIdentityKey;
RegistryKey *pRootKey;

pRootKey = Registry::Local Machine->OpenSubKey("SO FTWARE",false);

pIdentityKey = pRootKey->OpenSubKey("Pr oj\\identity\\A SPNET_SETREG");

byte userNameBytes[255];
userNameBytes = (byte[]) pIdentityKey->GetValue("user Name");
-----------------------------------------------------------------------
the compiler complains on the last line that:

c:\Documents and Settings\sharon \My Documents\Visua l Studio
Projects\TestMa nagedC++WS\Test ManagedC++WSCla ss.cpp(32): error C2440:
'type cast' : cannot convert from 'System::Object __gc *' to 'byte []'
Can someone tell me how I can get the registry key in byte[] format?

Thank you!

Sharon
Nov 17 '05 #1
0 1131

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

Similar topics

3
8149
by: Daniel Pope | last post by:
Hello Everybody, I'm preparing for doing a daunting task: to access Out look Microsoft Outlook Express(regardles the operating system and Outlook version) from a Java applet (after the client (user) acknowleges to run this applet on his machine). The user has to read the existent user Microsoft Outlook users accounts and to setup another Microsoft Outlook user accont. As I know so far, that the only way is to access from the applet a...
8
10662
by: Saradhi | last post by:
Can any one put me a piece of code to write binary data into Registry?
6
16015
by: John Hoffman | last post by:
Reading registry: .... RegistryKey rksub = rkey.OpenSubKey(s); String valstr = rksub.GetValueNames(); foreach (String vs in valstr) { String vstr = rksub.GetValue(vs).ToString(); OR String vstr = rksub.GetValue(vs);
2
1667
by: Daniel Bass | last post by:
I've found this article on how to get ASP.Net to read/write from the server's registry, but it got heavily critted as being something that you should not do... http://www.wwwcoder.com/main/parentid/263/site/2281/68/default.aspx what's the problem with a server side application reading data from a server
4
2457
by: Wolfgang Kaml | last post by:
I came accross the need to store binary data in the registry. The binary data to be saved is kept within a string in the code segment. If I write that string to a registry, not all of the data is kept. There are some certain chars included within that string, which the registry SetValue function cannot handle and therefore the string is being cut off. Instead of storing that string with special characters as a string in the registry, I am...
1
5832
by: Steve Bostedor | last post by:
I'm trying to use the RegistryKey to write a hex number into the registry as a binary type. I know see that in DotNet, the RegistryKey tries to interprate what registry type to create depending on the type of structure the variable was dimmed as. I dimmed it as a character array, then dumped each value into that character array, then wrote it to the registry and sure enough, it created a binary entry of it .... but .... The problem...
3
1921
by: mark.jerrom | last post by:
I'm fairly new to this Web Service game so please feel free to suggest something different if it looks like i'm completely off track! I'm trying to write an application that runs on a Pocket PC that is accessing data stored in a SQL server database on a seperate server (not on the pocket pc). This wil be deployed to lots of customers sites so I can't hard-code the location of the database in the program. I wrote a seperate little app...
0
12083
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the likelihood of CRM success from less than 20 percent to 60 percent. WHITEPAPER :
1
1625
by: David Schrader | last post by:
Hello all, Let me start by saying that I'm not certain whether this belongs here, in this notes group, or another more developmentally oriented one. I'll try starting here then go elsewhere if you decide otherwise. (Already forwarded here, sort-of, from: microsoft.public.windowsnt.registry.) I'm writing a Visual Basic program which stores and retrieves data in the registry - no big thing, I've got all that code written
0
8705
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8941
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7785
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6549
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3071
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.