|
Hi
i alter the code
fwrite( &,lpBuf, 1, dwRead, FilePtr );
even the data was not write in the Text file,only text file was creating with empty. In Debug mode it cross the Write file Line then also it was not written in file
thanks
shakumar
shakumar
|
|
|
|
|
usually according to the naming convention lpBuf is already a pointer to buffer , your usage of &lpBuf seems using the address of operator two times. What is the type of lpBuf?
|
|
|
|
|
Do you check (with the debugger) dwRead value?
As Rajkumar R suggested, probably you haven't to take lpBuff address. How is it declared?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
message was altered pls gothrough the modified message
thanks
shakumar
shakumar
|
|
|
|
|
Please give more info (i.e. what error message you get, if you get one; what is the dwRead value and so on).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
No error Message.
Text File was Creating but no data was writing.
dwRead value on Debug was "0"(zero).
shakumar
|
|
|
|
|
hey, what is this, "char * lpBuf = "";"
where is the buffer allocated to get the data read into it.
and you used fwrite(&lpBuf..), that is why you didn't get access violation.
as i suspected, you used address of operator on a pointer.
just for testing, try
char lpBuf[1024];
ReadFile(, lpBuf,..) not &lpBuf
fwrite(lpBuf,..) not &lpBuf
And you are not using the pointers correctly, join the "Book-Buying Band"[^], two already there.
|
|
|
|
|
After creating and switching into 2 to 3 desktops using CreateDesktop in Windows Vista we used the 3d flip state keys (windows key + tab key) to switch between active windows... it is not working... it works fine in windows xp but not in vista... (3d flip state is when many applications are opened we can toggle between active windows minimized 3d bars in the taskbar... when doing so you can see the toggling of the minimized state of all windows)... can anyone help us with this...
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
I port my application in vc++ 2005 to vc++ 2008. it works proper other than registry entry code. Is this is bug of visual studio 2008?
|
|
|
|
|
Have you tried debugging? Did the registry function succeed? Did you checked the return value?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks for your replay.
It works in xp But shows problem in vista.
|
|
|
|
|
vicky00000 wrote: It works in xp But shows problem in vista.
I am sorry, I forgot my telescope today and am unable to see your monitor.
Can you please elaborate more on what the problem exactly is? How exactly are you dealing with the registry and what exactly does the registry function returns?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks for your replay.
I wrote an applcation in vc++ 2005,in which I create a new registry key and set some value. This one work proper in xp and vista. I port the same code to vc++ 2008. It works in xp, but not in vista.
I hope you can understand my problem.
Thanks.
|
|
|
|
|
vicky00000 wrote: I wrote an applcation in vc++ 2005,in which I create a new registry key and set some value. This one work proper in xp and vista. I port the same code to vc++ 2008. It works in xp, but not in vista.
Aren't you using some function which would create the new registry key? What is that function returning when you say it wasn't working?
vicky00000 wrote: I hope you can understand my problem.
I bet nobody can.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks for ur replay.
long lRet = RegCreateKeyEx(HKEY_LOCAL_MACHINE,_T("Some Path"), 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey,
&dwDisposition);
lRet is 5 in the case vc++ 2008 and in the case vc++ 2005 lRet is 0
|
|
|
|
|
vicky00000 wrote: lRet is 5 in the case vc++ 2008 and in the case vc++ 2005 lRet is 0
The documentation for RegCreateEx says a non-zero value is returned, when the function fails. 5 is a non-zero value AFAIK.
The documentation also says: use FormatMessage()[^] with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I would suspect it's an access denied error since you're writing to HKEY_LOCAL_MACHINE.
Your app needs to run with elevated privileges to do that.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery,
Yes, this is access denied error, could you please explain how to overcome this problem.
Thanks in advance.
|
|
|
|
|
Writing to HKEY_LOCAL_MACHINE requires the code to run with administrator rights/elevated privileges.
Does it work if you run your app as an administrator?
Why do you need to write to HKEY_LOCAL_MACHINE? That should generally only be done at install time
(running elevated).
If you have common application data that needs to be shared between users, then you should store that at the
recommended application shared data folder, not in the registry.
Unless, of course, all users of your app have no problem running the app as an administrator.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Awesome!
Thanks for the update!
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i have a dialog box which shows a video and some controls now i want to implement a graph. what is the procedure to create a graph dynamically? i also need to read data from the file and plot it into the graph. guess that is the second part.. not thinking about that.. priority is to create a graph.
|
|
|
|
|
See if this[^] helps.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
1) by searching google
2) by searching codeproject articles
3) by searching again and again...
|
|
|
|
|
well i was expecting something like this from somebody.. and yes i am doing what u have told me... .. the last point has been really taken into consideration...
|
|
|
|