With managed C++ what would I have to type on this linkLabel_LinkClicked code in order to make my link go to a website of my choice
#pragma
endregion private: System::Void linkLabel1_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) {}
};
}

linkLabel_LinkClicked
Richard M Malone
ondrej_bohaciak
Soar
Oh, you don't have a platform SDK installed, you're using Express. Express is kind of a half a Windows C++ compiler, IMO. You can use Process.Start instead, which is the .NET way to do things. I guess you've abandoned standard C++ anyhow ( not that ShellExecute is standard C++, it's part of the Windows SDK libraries ).
et3ishak
ok I put that code in and I got these errors:
------ Build started: Project: linktest, Configuration: Debug Win32 ------
Compiling...
linktest.cpp
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(88) : error C2039: 'm_hWnd' : is not a member of 'linktest::Form1'
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(22) : see declaration of 'linktest::Form1'
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(89) : error C2065: 'SW_SHOW' : undeclared identifier
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(88) : error C3861: 'ShellExecute': identifier not found
Build log was saved at "file://c:\Documents and Settings\removed\Desktop\linktest\linktest\Debug\BuildLog.htm"
linktest - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
soccerdude1000
------ Build started: Project: linktest, Configuration: Debug Win32 ------
Compiling...
linktest.cpp
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(88) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(88) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(88) : error C2653: 'Process' : is not a class or namespace name
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(88) : error C3861: 'Start': identifier not found
Build log was saved at "file://c:\Documents and Settings\removed\Desktop\linktest\linktest\Debug\BuildLog.htm"
linktest - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
shark312
Darin Tomack
Did you read the link I gave you It has an example. Process::Start DOES work, the example code on the MSDN site goes over it in depth. System::Uri is unlikely to be what you want.
vky
System::Process::Start doesn't work but how about System::Uri
can you think of anything to type after that, when I type that in I've got a ton of options (too many to list).
Brad King
The most obvious error is that you have not put the URL in quotes. I meant that my example was using a variable that contained the URL.
Beyond that, maybe you need System::Process::Start
Dude987
If you have the PSDK installed and configured, you should have access to ShellExecute
Etherline
OK, I guess it's something that's just core, and not in the SDK, and is still removed from Express. Process.Start is probably better, as you're committing to .NET anyhow. I would just steer people away from .NET if they are using C++, so they learn stuff that can move to non-.NET projects.
sujun
Yes, it probably is Process::Start. To be honest, I use C++ and C# both every day, but I'd never consider using managed C++, so I'm pretty much answering because it's a .NET question, so I gave the C# syntax.
http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessclassstarttopic.asp
Process::Start(myURL);
where myURL is just the URL as a string.
FrenchStudent
http://www.codeproject.com/system/newbiespawn.asp df=100&forumid=3298&exp=0&select=706737
ShellExecute is the answer.
swathi237
This is the code I put in:
#pragma
endregion private: System::Void linkLabel1_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) {Process::Start(
www.google.com);}
};
}
and these are the errors I got:
------ Build started: Project: linktest, Configuration: Debug Win32 ------
Compiling...
linktest.cpp
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(88) : error C2653: 'Process' : is not a class or namespace name
c:\documents and settings\removed\desktop\linktest\linktest\Form1.h(88) : error C3861: 'Start': identifier not found
Build log was saved at "file://c:\Documents and Settings\removed\Desktop\linktest\linktest\Debug\BuildLog.htm"
linktest - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========