Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Issue with strcpy Pin
capricious_00118-Jun-06 23:04
capricious_00118-Jun-06 23:04 
GeneralRe: Issue with strcpy Pin
Kevin McFarlane18-Jun-06 23:16
Kevin McFarlane18-Jun-06 23:16 
GeneralRe: Issue with strcpy Pin
capricious_00118-Jun-06 23:36
capricious_00118-Jun-06 23:36 
GeneralRe: Issue with strcpy Pin
Kevin McFarlane18-Jun-06 23:57
Kevin McFarlane18-Jun-06 23:57 
AnswerRe: Issue with strcpy Pin
Weiye Chen18-Jun-06 22:58
Weiye Chen18-Jun-06 22:58 
AnswerRe: Issue with strcpy Pin
_AnsHUMAN_ 18-Jun-06 23:05
_AnsHUMAN_ 18-Jun-06 23:05 
GeneralRe: Issue with strcpy Pin
capricious_00118-Jun-06 23:14
capricious_00118-Jun-06 23:14 
GeneralRe: Issue with strcpy [modified] Pin
Weiye Chen18-Jun-06 23:49
Weiye Chen18-Jun-06 23:49 
I just did a test using your code(with some modifications in bold) except without the reference and it works fine.:

void somefunc()
{
   char cBuffer[400];
   retrieveLogFileLocation(cBuffer);
}

bool retrieveLogFileLocation(LPSTR value)
{
    char lszValue[255];
    HKEY hKey = HKEY_LOCAL_MACHINE;
    LONG returnStatus;
    DWORD dwType = REG_SZ;
    DWORD dwSize =255;
    bool success = true;

    RegQueryValueEx(hKey, "InstallationPath", NULL, &dwType, (LPBYTE)&lszValue, &dwSize);

    strcpy(value, lszValue);

    return true;
}
I set hKey just for testing purposes. It could be a problem with your key.
Last modified: Monday, June 19, 2006 4:57:58 AM --

GeneralRe: Issue with strcpy Pin
David Crow19-Jun-06 2:54
David Crow19-Jun-06 2:54 
QuestionRe: Issue with strcpy Pin
David Crow19-Jun-06 2:56
David Crow19-Jun-06 2:56 
QuestionHow to ShellExecute notepad.exe to show a CString? Pin
Tcpip200518-Jun-06 22:28
Tcpip200518-Jun-06 22:28 
AnswerRe: How to ShellExecute notepad.exe to show a CString? Pin
Hamid_RT18-Jun-06 22:36
Hamid_RT18-Jun-06 22:36 
GeneralRe: How to ShellExecute notepad.exe to show a CString? Pin
David Crow19-Jun-06 2:58
David Crow19-Jun-06 2:58 
GeneralRe: How to ShellExecute notepad.exe to show a CString? Pin
Hamid_RT19-Jun-06 4:18
Hamid_RT19-Jun-06 4:18 
AnswerRe: How to ShellExecute notepad.exe to show a CString? Pin
Viorel.18-Jun-06 22:38
Viorel.18-Jun-06 22:38 
Questiona problem in visual C++ Pin
mt_samiei18-Jun-06 22:09
mt_samiei18-Jun-06 22:09 
AnswerRe: a problem in visual C++ Pin
Viorel.18-Jun-06 22:17
Viorel.18-Jun-06 22:17 
AnswerRe: a problem in visual C++ Pin
Laxman Auti18-Jun-06 22:21
Laxman Auti18-Jun-06 22:21 
AnswerRe: a problem in visual C++ Pin
ThatsAlok18-Jun-06 22:35
ThatsAlok18-Jun-06 22:35 
AnswerRe: a problem in visual C++ Pin
Hamid_RT18-Jun-06 22:52
Hamid_RT18-Jun-06 22:52 
Questioncan we apply socket program to parent and child Pin
happy_ram18-Jun-06 22:07
happy_ram18-Jun-06 22:07 
AnswerRe: can we apply socket program to parent and child Pin
_AnsHUMAN_ 18-Jun-06 22:13
_AnsHUMAN_ 18-Jun-06 22:13 
GeneralRe: can we apply socket program to parent and child Pin
happy_ram18-Jun-06 22:15
happy_ram18-Jun-06 22:15 
AnswerRe: can we apply socket program to parent and child Pin
Laxman Auti18-Jun-06 22:25
Laxman Auti18-Jun-06 22:25 
GeneralRe: can we apply socket program to parent and child Pin
_AnsHUMAN_ 18-Jun-06 22:26
_AnsHUMAN_ 18-Jun-06 22:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.