What about using MoveFileEx? (I can wait for reboot)
The problem with this is that I can't delete folder (where the program is located) because I have other files that need to be deleted as well,and...
Type: Posts; User: markiz
What about using MoveFileEx? (I can wait for reboot)
The problem with this is that I can't delete folder (where the program is located) because I have other files that need to be deleted as well,and...
thanks Niara.
Elysia, I just need.
Self-delete
Like an unistaller
Win32 project - VC++
How can I self-delete program I run?
OK, thank you very much!
P.S.
Thanks Elysia. You're a programming master! How the hell do you know every thing?
:)
Done that, is it possible to insert new line between 2 last lines, without copying the last line??
Because the operation must be very fast and I can't recopy last time each time.
I still can't make it work:
After I've created new file via CreateFile,
I set pointer:
SetFilePointer(file, 0, 0, FILE_END);
Now how to continue from here?
Will it allow to do it by multi process?
And after I get the position, how do I write to file from this position?
I see. Now some code questions:
As I wrote I use WriteFile function.
How do I set new position to write from (I mean how to write backwards to wanted position and then write from this position)?
I am not sure I understand.
, what do you mean by this?
123
ABC
###
Between ABC and ###?
What data? The last line (###) or all other data (123,ABC)?
If I wite this data to file I'll get...
I create file like this: (I need it shared...)
if ( (file = CreateFile(file_name.c_str(), GENERIC_WRITE , FILE_SHARE_WRITE ,NULL,OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL,NULL)) == INVALID_HANDLE_VALUE...
Ok, now the event us triggered when new process is created.
How Do I get the file name and path of this process?
#define _WIN32_DCOM- what it for? Why do i need to include it?
Ok, the COINIT_MULTITHREADED error was fixed by adding #define _WIN32_DCOM to stdafx.h, why it's needed there?
What kind of project did you create?
Me too.
If it compiles to you maybe you send this code to me?
By email or upload it to some web-storage.
using namespace std; this one I already have.
#define _WIN32_WINNT 0x400; didn't help
I still get COINIT_MULTITHREADED error! Though I've included:
#include <windows.h>
#include <objbase.h>
Maybe, if it's not to hard, you can compile it yourself?
other errors:
Error 1 error...
I thought it's a full source.
<objbase.h> didn't help! still same error.
P.s. total count 46 errors!
Maybe I should Create another type of project?
Why it wasn't included in the example?
Now I have other "include" errors:
Error 1 error C2065: 'COINIT_MULTITHREADED' : undeclared identifier
At first it complained about "stdafx.h" , so I included it.
Now it complains about:
Error 1 error C2065: 'HRESULT' : undeclared identifier
strange, cause example should have all includes,...
Thanks,
But I have problems compiling the code from the example, though I didn't change anything.
(Environment: Visual studio 2005, Visual C++ win32 console application)