|
do you actually want to open the file to write or read something?
or are you looking to open the file in notepad automatically.
|
|
|
|
|
|
to write data into file,use
FILE * fp;
fp=fopen("filename.txt","w");
fprintf("hello");
fclose(fp);
to open the file automatically, use
system("notepad filename.txt");
|
|
|
|
|
|
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For second section of your question see CFileFind Class .
and for first section are you sure you have this file on the correct path?
|
|
|
|
|
p_ wrote: but it could not open the gg file
Why not? Are you for sure that the file exists? Have you tried to pass a CFileException* when calling Open() method?
p_ wrote: 2)i want that when i write a name of file on edit box and click on button
it search file in c drive and open it
If the edit control also contains the file's path, no searching is required. Just use CFile or CStdioFile to open the file.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Visual Studio 2005 and Visual Studo 6 - can they be installed side-by-side?
|
|
|
|
|
|
|
Why Can't I download the source code?
I want to download the follow source code: http://www.codeproject.com/dialog/skinstyle.asp
I hope give me a reply.
thanks very muce!
|
|
|
|
|
|
tanhongwen wrote: I want to download the follow source code: http://www.codeproject.com/dialog/skinstyle.asp
So did you bother to click the Download source files - 175 Kb link?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I've put a slider control into my window and set a range (min/max). I've also set a TickFreq.
The Ticks are also correctly displayed, but it is still possible to drag the thumb to any position on the slider, not only where the ticks are (btw: auto ticks is on).
I've found not method to force the slider use only the positions where the ticks are. Is there any? Or do I have to code that stuff for myself.. ( I cannot believe that ).
Thx, Shi
|
|
|
|
|
If you had a slider from 0 to 100, and ticks every 10, then the slider will give the user 100 positions it can be.
Or, set a slider from 0 to 10, tick at intervals of 1, then just multiply the position by 1 internally.
Tada!
Iain.
|
|
|
|
|
|
Hopefully somebody might be able to help me with this before the weekend sets in.
I'm trying to manipulate the memory of another process. So far I can change the protection, read and write data. But two of the APIs VirtualAllocEx() and VirtualFreeEx() fail nomatter what I try to do.
I am doing nothing out of the ordinary, I simply create a process in suspended state, get the base address of it's memory and manipulate it; similar to most code injection articles.
Is there anything special I should be doing before I use these?
|
|
|
|
|
WalderMort wrote: I'm trying to manipulate the memory of another process.
Training for the black-hat-olympics?
Whatever you do, it *should* not work. If it does, it is a temporary faiure in Windows security.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
You may need to enable debug privledges.
Something like this:
LUID luid;
HANDLE hToken;
TOKEN_PRIVILEGES tp, otp;
DWORD dwSize = sizeof(TOKEN_PRIVILEGES);
if(OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,&hToken))
{
if(LookupPrivilegeValue(NULL,SE_SYSTEMTIME_NAME,&luid))
{
SecureZeroMemory(&tp,sizeof(tp));
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if (AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES),&otp, &dwSize))
{
}
}
CloseHandle(hToken);
}
Best regards,
-David Delaune
|
|
|
|
|
Sorry, I forgot to mention I had already done that.
Through trial and error, I have found that I must let the system decide where to allocate the memory. Though calls to VirtualAllocEx() with MEM_DECOMMIT still fail, as does VirtualFreeEx(). I'm guessing this must be some type of security feature and only the caller to VirtualAlloc may de-commit or free.
|
|
|
|
|
has any body worked on retrieving the unique ID of a computer. other than LAN card ID.
please suggest.
|
|
|
|
|
You can use hard disk drive volume number.
- NS -
|
|
|
|
|
thank you
how to retrieve it.
|
|
|
|
|
See GetVolumeInformation
- NS -
|
|
|
|
|
It isn't 'Unique' ... it can be changed formatting the HDD, or programmatically
Russell
|
|
|
|