Solved

Win32 RegSetValue (3)

Posted on 1997-02-26
1
210 Views
Last Modified: 2013-12-04
Hi,
With these function

RegSetValueEx(hKey3, "file", 0, REG_SZ, (CONST BYTE *)m_cnom,
                  m_cnom.GetLength());

exemple is a variable of Class CString


How do I do.

The response doesn't work.
Thanx
0
Comment
Question by:puce020497
1 Comment
 
LVL 1

Accepted Solution

by:
edtmihu earned 10 total points
ID: 1298474
Try this:
RegSetValueEx( hKey3, _T( "file" ), 0, REG_SZ, (CONST BYTE *) (LPCTSTR) m_cnom, m_cnom.GetLength() + 1 );
                                       
You need to include the terminating null in the length.
Regards Michael
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
error email attachment VB2010 5 32
Issue when running a SSIS package (.dts) from an SQL job 21 82
wordpress limitations 4 104
Having a different time zone on your task bar 3 53
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now