Hello. I am required to write a script to launch the default browser from a DOS program, with a specified url. I am using Borland C++ 5.02 on Windows XP Home Edition, with Service Pack 2. Which function should I use?
Hello. I am required to write a script to launch the default browser from a DOS program, with a specified url. I am using Borland C++ 5.02 on Windows XP Home Edition, with Service Pack 2. Which function should I use?
The problem is, the url is variable, i.e. it is generated by the program. I tried using system to launch Internet Explorer directly with a URL. It used to work fine on Windows 98. Now, the problem is that after system(path) launches the browser, the program freezes. Any idea what I can do about it?
ShellExecute doesn't seem to be available in the Compiler, I checked the documentation. I tried using spawnl, but I don't seem to be able to use it to specify a URL directly.
Code:strcpy(url,"http://www.icq.com/whitepages/search_result.php?search_type=&fname="); strcat(url,inputfirstname); strcat(url,"&lname="); strcat(url,inputlastname); strcat(url,"&nickname=&gender=&age_group=&home_country_code=&email="); strcat(url,inputemail); strcpy(path,"c:\\progra~1\\intern~1\\iexplore.exe \""); strcat(path,url); strcat(path,"\""); system(path);
Ok, I got a perfect way to launch the default browser, but again, it is using system. I was wondering is there was any other way (perhaps using spawnl or something), because system causes the program to freeze under Windows XP. The same program runs fine on Windows 98.
Use the technique in the link I posted or use ShellExecute[Ex].
Get a new development environment, like Dev-C++ if you current one doesn't support the Win32 API.
gg