Hello,

i am searching for way, to open web page with C++ and after that to control its elements. I know that i can do this in Delphi, with WebBrowser.OleObject.Document and TWebBrowser. Do you know similar way that i can use in C++?

Hello,

i am searching for way, to open web page with C++ and after that to control its elements. I know that i can do this in Delphi, with WebBrowser.OleObject.Document and TWebBrowser. Do you know similar way that i can use in C++?

I searched on net and found some solution. Though i havent tried it, it might help you to start. Please find code below

#include <iostream>
#include <windows.h>
#include <string>
using namespace std;

int main()
{
    char* google("http://www.google.com");  //initial link
    char* temp;
    
   cout<<"Give name: ";      //the thing i want to add after
   cin>>temp;
   strcat(google,temp);       //concat link with the name and
   strcat(google,".jpg");     //put the jpg to see the image
   ShellExecute(NULL, "open",google,NULL, NULL, SW_SHOWNORMAL); //this script is from a snippet in this side
}

This code gives me error:

error C2664: 'ShellExecuteW' : cannot convert parameter 2 from 'const char [5]' to 'LPCWSTR'

ShellExecute has nothing to do with HTML Elements.
Just use Win32 COM. Ses MS samples

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.