• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[C++] Creating an object

Skilled Illusionist
Joined
Jul 1, 2007
Messages
367
Reaction score
1
Hey guys, again!
This time I'm here with some C++ problems (I'm learning, you see).
I'm using Visual C++ 2008 Express just in case it matters.

Basically, I'm trying, on form_load, to create a System::Windows::Forms::WebBrowser object and dock it as System::Windows::Forms::DockStyle::Fill, but have been unsuccessful even with toiling the web.

Do you guys have any ideas? Here is what I have so far (not working, though) if you'd like to tell me where I've gone dramatically wrong.
Code:
private: System::Void Hyper_Load(System::Object^  sender, System::EventArgs^  e) {
			Browser_1 = (gcnew System::Windows::Forms::WebBrowser());
			System::Windows::Forms::WebBrowser^  Browser_1;
			this->Browser_1->Dock = System::Windows::Forms::DockStyle::Fill;
		 }

Thanks, guys.

Edit:
-
I've found a solution, here it is if you were wondering:
Code:
System::Windows::Forms::WebBrowser^  Browser_1 = (gcnew System::Windows::Forms::WebBrowser());

Now I just need to figure out how to add it to a TabPage.

Edit:
-
I've found a solution for adding a tab, I forget a '>' on one of the '->'s, how stupid can you get, aye?
 
Last edited:
Experienced Elementalist
Joined
Dec 27, 2006
Messages
288
Reaction score
4
It's C++/CLI. The only thing it's good for is interop between managed code and native code. It's especially pointless to learn if you don't know C++, that is, standard C++.
 
Back
Top