473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[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.ComponentModel.Win32Exception: The requested lookup key was not found in any active activation context
at System.Diagnostics.Process.StartWithShellExecuteEx (ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(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 InitializeComponent(), 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_LinkClicked(Object * sender, System::Windows::Forms::LinkLabelLinkClickedEventA rgs * e)
{
using System::String;
using System::Windows::Forms::LinkLabel;

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

link->Links->Item[link->Links->IndexOf(e->Link)]->Visited = true;
String* target = __try_cast<String*>(e->Link->LinkData);
System::Diagnostics::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_LinkClicked(Object * sender, System::Windows::Forms::LinkLabelLinkClickedEventA rgs * e)
{
System::Diagnostics::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 1730
Marcus Kwok <ri******@gehennom.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.ComponentModel.Win32Exception: The requested lookup key was not found in any active activation context
at System.Diagnostics.Process.StartWithShellExecuteEx (ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(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
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...
2
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...
2
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....
1
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...
3
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
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...
4
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...
3
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.