if you use movefile and ofstream the ofstream file won't be made.. :s any way to solve this?

Recommended Answers

All 7 Replies

So you mean this function ?

>>s any way to solve this?
Yes, fix the bug in your program.

movefile is usualy the movefile function..

what operating system and compiler are you using? Do you mean the version in my last link? If not, then provide link to it because there is no standard C or C++ library function.

i use visual express c++. gonna post the part of my code..

#define KEY "C:\\Users\\qeinar\\hmm.exe"

int main(int argc, char **argv)
{
MoveFile(argv[0], KEY);


ofstream fout;
fout.open("hmmgetasynckey.txt");

}

(ofc theres more there but it's alot so.. :P but nothing that would screw over these comands.. since i've tested it elsewhere withotu the rest of the code.. just something abit more simple.. ^^)

>>MoveFile(argv[0], KEY);
That will always fail because you can not move a currently running program, and argv[0] contains the name of the program you are writing.

close/deleate the thread please.. i solved it by changing the fout.open loc.. o.o' stupid me..

>>MoveFile(argv[0], KEY);
That will always fail because you can not move a currently running program, and argv[0] contains the name of the program you are writing.

well wierd 'cus it seems i can.. ^^

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.