From: <jos...@ya...> - 2001-04-10 14:46:43
|
Christian, > void main(void) If you want to learn C++ you should do it right from the beginning. It is int main() Now that we speak the same language here is the reason > scanf("%s", &c_prg); > > ShellExecute(GetDesktopWindow(), "open", &c_prg, NULL, NULL, > SW_NORMAL); > > if i enter a windows prg. this prog terminate with an error (access > violation). > > > WHY ? The name of the program need to be enclosed between inverted commas, but the variable c_prg doesn't have them. BTW: Don't think you can use Win API functions in this fancy way. Perhaps you can encounter some severe problems. I suggest you to learn the basics of C++ and start to learn Windows programming as a complement. Hope this clarifies. Chemanuel __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |