Need Help w/ VC6 Code

Hello, I am creating a program that will read all lines in a file until EOF and when I enter the code that will terminate the program names in a file it shows an error, The error is below
1
2
3
4
5
6
7
Compiling...
main.cpp
D:\xxxxxxx\main.cpp(41) : error C2664: 'KillProcessByName' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'char *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.

xxxxxxx.exe - 1 error(s), 0 warning(s)




The Code below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
int main(int argc, char* argv[]){
	if(argc > 1){
		KillProcessByName(argv[1]);
	}else{

		SetConsoleTitle("KillFakeAVProc");
	
   cout << "Terminating Fake Antivirus Processes...." << endl ;
    
    std::ifstream file( "rfaproc.dat" ) ;
    std::string line ;
    while( std::getline( file, line ) )
    {
	sleep(90);
    // parse the line which was just read
	cout << "Detecting & Terminating Process: " << line << " \n " ;
	
/*	KillProcessByName(line); //declare tostring stuck!!!! */

    }
KillProcessByName(line); //here is the error.....
	//	KillProcessByName("notepad.exe");
	}
	system ("pause");
	return 0;
}


Note: The code is not complete Ive cut it

and please help me how to create a loading(progress bar) in VC6
/-|\ <=that is what i mean
assuming you are using a std::string you need to look in to std::string.c_str() function of the std::string class. Using it would eliminate your problem if used properly.

Are you sure you are using VC6? The stl wasn't part of vc6.

Where do we want the process bar?
i dont know what youre talking about?
yes, i am using MS VC6 Standard Edition
the progress look like this
\
-
|
/
Topic archived. No new replies allowed.