473,787 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[MC++] LinkLabel usage

I am having problems getting my LinkLabel hyperlink to work properly.
Every time I click on it, I get the following exception:

System.Componen tModel.Win32Exc eption: The requested lookup key was not found in any active activation context
at System.Diagnost ics.Process.Sta rtWithShellExec uteEx(ProcessSt artInfo startInfo)
at System.Diagnost ics.Process.Sta rt()
at System.Diagnost ics.Process.Sta rt(ProcessStart Info startInfo)
at System.Diagnost ics.Process.Sta rt(String fileName)
I placed the LinkLabel on the form using the Designer and set the Text
property to what I want displayed. Then in the form's constructor,
after the call to InitializeCompo nent(), I set the LinkData property:

linklabel_zlib->Links->Item[0]->LinkData = S"http://www.zlib.net/";

and my LinkLabel Clicked event handler looks like:

System::Void linkLabel_LinkC licked(Object * sender, System::Windows ::Forms::LinkLa belLinkClickedE ventArgs * e)
{
using System::String;
using System::Windows ::Forms::LinkLa bel;

LinkLabel* link = __try_cast<Link Label*>(sender) ;

link->Links->Item[link->Links->IndexOf(e->Link)]->Visited = true;
String* target = __try_cast<Stri ng*>(e->Link->LinkData);
System::Diagnos tics::Process:: Start(target);
}

In the debugger, I have verified that "target" indeed holds the correct
URI.
I have also tried commenting this out and explicitly using the URI:

System::Void linkLabel_LinkC licked(Object * sender, System::Windows ::Forms::LinkLa belLinkClickedE ventArgs * e)
{
System::Diagnos tics::Process:: Start(S"http://www.zlib.net/");
}

but I get the same exception.
Not sure if it's relevant, but my default browser is Mozilla Firefox.
This is on Windows XP Pro SP 2, .NET Framework 1.1, and VS .NET 2003.

Thanks for any hints.

--
Marcus Kwok
Apr 10 '06 #1
1 1745
Marcus Kwok <ri******@gehen nom.net.invalid > wrote:
I am having problems getting my LinkLabel hyperlink to work properly.
Every time I click on it, I get the following exception:

System.Componen tModel.Win32Exc eption: The requested lookup key was not found in any active activation context
at System.Diagnost ics.Process.Sta rtWithShellExec uteEx(ProcessSt artInfo startInfo)
at System.Diagnost ics.Process.Sta rt()
at System.Diagnost ics.Process.Sta rt(ProcessStart Info startInfo)
at System.Diagnost ics.Process.Sta rt(String fileName)


Nevermind, I solved the problem.

--
Marcus Kwok
Apr 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1894
by: tota | last post by:
i'm using windowsApplication to connect to DB made by SQL i need to Display the Data of the first table in the DB as links when click it it openes a table and i navigte between them using buttons my problem is that i need to make the retrieved data as links (similar to objectList in Mobile application) i used LinkLabel to make an array of LinkLabels for (int n=0 ; i<j ; i++) {
2
2515
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a pointer or reference to a derived type of the base class's return type. In .NET the overridden virtual function is similar, but an actual parameter of the function can be a derived reference from the base class's reference also. This dichotomy...
2
1914
by: Lev | last post by:
Hi, I have some code that does reflection on an assembly I load. When I try to get the attributes on one of the methods implemented in the assembly, the MC++ version does not return anything. See code below: Object __gc* memberAttributes = info->GetCustomAttributes(__typeof(EntryPointAttribute), false);
1
5328
by: gabe | last post by:
I am looking for a way to mimic some of the functionality of a web page without writing html (or I am looking to someone to point out something really obvious that I am over looking) Currently I read out some data into a dataset then appending it to a richtextbox. So far so good. Some of the fields that I append are paths to documents. I would like to be able to click on the paths (like a hyperlink) I am able to create a linklabel at...
3
12030
by: vince | last post by:
Hello, I have a ListBox filled with many lines of simply text I want to make few lines be a LinkLabel How can I do this Thanks
0
1608
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is that when I ran it and looked at memory usage (in Windows task manager) it looked as if there was a very slow leak. To isolate the issue:
4
6583
by: David Veeneman | last post by:
I'm creating a UserControl that uses a LinkLabel. For reasons that I won't bore everyone with, I don't want the LinkLable to show the default hand cursor when the mouse enters the control. Should be a simple setting on the LinkLabel.Cursor property, right? Not so simple. I set the property, but still got the default 'hand' cursor. To debug, I added the following event handler to my LinkLabel control: private void...
3
4695
by: bsturg21 | last post by:
Hello, I have a windows form that has a series of linklabels on it, and I need to have each linklabel, when clicked, open a separate windows form that has a single paramter passed into it. The form that has the System.Windows.Forms.LinkLabel controls on it is in a different project and under a different namespace from the file where the LinkLabel_LinkClicked events are, so I can't just do frm.ShowDialog under the LinkClicked method. ...
2
2139
by: prokopis | last post by:
am using c# for windows applications. am using dynamic linklayer array to print some labels in the form.i get some data from the database i add them in the linklabel array and i print it on the screen. my problem is how to make that linklabel to work when i select the label.am using the code below but is not working:) public class Form1 : Form { System.Windows.Forms.LinkLabel linklabel;
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.