Shellexecute

Pages: 12
Hey again, i am afraid i am still not following you to 100% in the risk of sounding a burden.

This is what error i get:

1
2
error C2664: 'ShellExecuteA' : cannot convert parameter 3 from 'std::string' to 'LPCSTR'
1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called


And this is how i setup the shellexecute command now:

1
2
3
4
5
6
7
8
9
10
	string url;
	cout << "Please enter URL: ";
	getline( cin, url );

	cout << "Delaying process for 60 minutes.\n" ;
	Sleep( 3600000 );  // (1000 ms)(60 s)(60 min)
	cout << "Done!\n";

	ShellExecuteA( NULL, "open", url, NULL, NULL, SW_SHOW );
	//End 


Identical to your i know. All other around work is just not fitting in my head. The std::copy command it dosent matter how i turn it twist it or try to adapt it or dumb it down it still gives me errors. I am felling like a giant burden right now and i hope this is the last time i ask this but lets take my main full code as an example in its entirety how would i go about changing the function for input, I do understand you have supplied me with material to do so but i just dont understand the order of the parts sort of speak.

And last but not least Thank you for all your great patience with me its greatly appreciated.

Best regards Jonas.
LPCSTR is basically const char *. There's a function that's a member of the string class called c_str() that might help...

http://cplusplus.com/reference/string/string/c_str/

-Albatross
Thanks Albatross. I fixed my code above.
Hey again guys, i have been going through it and now it works properly lots of love to everyone that helped!

If i run into another road block i will let you know but for now i am all set. Btw thanks for all the help links they are greatly appreciated.
Topic archived. No new replies allowed.
Pages: 12