Click here to Skip to main content
15,899,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to download the file using HTTP while the file is being uploaded using FTP? Pin
Jyo200719-Jun-07 21:28
Jyo200719-Jun-07 21:28 
AnswerRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
Iain Clarke, Warrior Programmer19-Jun-07 23:46
Iain Clarke, Warrior Programmer19-Jun-07 23:46 
GeneralRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
Jyo200720-Jun-07 0:53
Jyo200720-Jun-07 0:53 
QuestionRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
David Crow20-Jun-07 2:39
David Crow20-Jun-07 2:39 
AnswerRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
programmer8120-Jun-07 3:10
programmer8120-Jun-07 3:10 
GeneralRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
David Crow20-Jun-07 4:51
David Crow20-Jun-07 4:51 
AnswerRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
Hamid_RT20-Jun-07 9:10
Hamid_RT20-Jun-07 9:10 
QuestionProblem in opening the windows registery Pin
Neeraj Sinha19-Jun-07 21:24
Neeraj Sinha19-Jun-07 21:24 
Hi

I have to retrieve the registery value through RegQueryValueEx().Before
doing this I am using RegOpenKeyEx() to open the registery.But the return value of RegOpenKeyEx() I am getting is 998 i.e the function is not able to successfully open the windows registery.Although,I have tried to map the error code of getlasterror() with the help of FormatMessage(),the return value of
getlasterror() is 0 i.e. "operation completed successfully".

Here is the code:

PHKEY m_htKey;
const char* lpSubKey = "SOFTWARE\\MyProduct\\N K software\\1.5";
long* lpcbValue = NULL;

DWORD valueType = 0;
DWORD dwBufLen = 0;
const char* valueName = "NKSDir";

long res = RegOpenKeyEx(HKEY_CURRENT_USER ,lpSubKey,0,KEY_ALL_ACCESS,m_htKey);
DWORD dw = GetLastError();

LPVOID lpMsgBuf;
FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_IGNORE_INSERTS, NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,0,NULL);

//Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );

// Free the buffer.
LocalFree( lpMsgBuf );

if (res != ERROR_SUCCESS)
return TRUE;
else
{
printf("hi");
res = RegQueryValueEx((HKEY)m_htKey,valueName,NULL,&valueType,NULL,&dwBufLen);
}

Now in the above code, the if condition is getting true and it's returning true.The control is not going into the else condition.

Can you please suggest me what could be the reason behind it that RegOpenKeyEx() is returning non zero value?

With Regards

Neeraj Sinha

AnswerRe: Problem in opening the windows registery Pin
Cedric Moonen19-Jun-07 21:34
Cedric Moonen19-Jun-07 21:34 
GeneralRe: Problem in opening the windows registery Pin
Neeraj Sinha19-Jun-07 21:48
Neeraj Sinha19-Jun-07 21:48 
AnswerRe: Problem in opening the windows registery Pin
Jonathan [Darka]19-Jun-07 21:41
professionalJonathan [Darka]19-Jun-07 21:41 
AnswerRe: Problem in opening the windows registery Pin
Jhony george19-Jun-07 21:47
Jhony george19-Jun-07 21:47 
GeneralRe: Problem in opening the windows registery Pin
Neeraj Sinha19-Jun-07 22:16
Neeraj Sinha19-Jun-07 22:16 
AnswerRe: Problem in opening the windows registery Pin
Hamid_RT20-Jun-07 9:06
Hamid_RT20-Jun-07 9:06 
QuestionControl problem Pin
hanlei000000000919-Jun-07 21:07
hanlei000000000919-Jun-07 21:07 
AnswerRe: Control problem Pin
Jonathan [Darka]19-Jun-07 21:42
professionalJonathan [Darka]19-Jun-07 21:42 
AnswerRe: Control problem Pin
toxcct20-Jun-07 1:37
toxcct20-Jun-07 1:37 
QuestionHow to calculate vertical scroll bar's width Pin
Peter, Chan19-Jun-07 21:06
Peter, Chan19-Jun-07 21:06 
AnswerRe: How to calculate vertical scroll bar's width Pin
Nibu babu thomas19-Jun-07 21:35
Nibu babu thomas19-Jun-07 21:35 
GeneralRe: How to calculate vertical scroll bar's width Pin
Peter, Chan19-Jun-07 22:19
Peter, Chan19-Jun-07 22:19 
AnswerRe: How to calculate vertical scroll bar's width Pin
Hamid_RT20-Jun-07 9:09
Hamid_RT20-Jun-07 9:09 
QuestionThread Question {MOD} Pin
Programm3r19-Jun-07 20:59
Programm3r19-Jun-07 20:59 
AnswerRe: Thread Question {MOD} Pin
Cedric Moonen19-Jun-07 21:22
Cedric Moonen19-Jun-07 21:22 
QuestionRe: Thread Question {MOD} Pin
Programm3r19-Jun-07 21:30
Programm3r19-Jun-07 21:30 
AnswerRe: Thread Question {MOD} Pin
Cedric Moonen19-Jun-07 21:43
Cedric Moonen19-Jun-07 21:43 

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.