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

C / C++ / MFC

 
QuestionStop Service Pin
BabyGuru18-Jun-06 23:04
BabyGuru18-Jun-06 23:04 
AnswerRe: Stop Service Pin
Maxwell Chen18-Jun-06 23:56
Maxwell Chen18-Jun-06 23:56 
QuestionRegarding iTunes SDK for c++ Pin
Halid Niyaz18-Jun-06 22:53
Halid Niyaz18-Jun-06 22:53 
AnswerRe: Regarding iTunes SDK for c++ [modified] Pin
Laxman Auti18-Jun-06 23:00
Laxman Auti18-Jun-06 23:00 
Questionconnect command in mfc [modified] Pin
amit.code18-Jun-06 22:46
amit.code18-Jun-06 22:46 
AnswerRe: connect in mfc Pin
_AnsHUMAN_ 18-Jun-06 22:49
_AnsHUMAN_ 18-Jun-06 22:49 
AnswerRe: connect in mfc Pin
capricious_00118-Jun-06 22:51
capricious_00118-Jun-06 22:51 
QuestionIssue with strcpy [modified] Pin
capricious_00118-Jun-06 22:43
capricious_00118-Jun-06 22:43 
Hi guys,

I have a function where I am passing a value by reference. Below is the prototype:

bool retrieveLogFileLocation(LPSTR&);



Now within the body of the function definition I have the following function as well.

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

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

    strcpy(value, lszValue);
}


The problem I am receiving is that whenever my program runs, it crashes instantly, and I know for sure it is an issue with strcpy(value, lszValue). I have tried in multiple ways through type-casting and such to resolve the issue, but I'm perplexed as to whats causing the problem.

Any help would be appreciated Big Grin | :-D

Robbie

-- modified at 4:53 Monday 19th June, 2006

PS: I only included bits and pieces of the function definition simply because the actual function definition is very long. :P
AnswerRe: Issue with strcpy Pin
Laxman Auti18-Jun-06 22:53
Laxman Auti18-Jun-06 22:53 
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 
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 

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.