|
Hello!
I have one solution file that consist of three project.
One project that build a user control dll. In this user control we have a class called B
One project that build a class library dll. In this class library we have a class called C
In the user control project I have a project reference to the class library. I build the user control dll and this class library successfully.
This user control dll is added to the Toolbox. In the constructor for this class B is a call to instansiate a class C in the class library.
When I add this user control to the Toolbox I use directory obj/debug to select the user control dll. So adding the user control works fine.
When I drag this user control from the Toolbox into a form that exist in the project that build the exe file object B will be instansiated and another object which is class C will also be instansiated that exist in the class library. Like this.
public B()
{
InitializeComponent();
Last.C last = new Last.C();
last.foo();
}
In design mode when we want to design a form that exist in the project that build the exe file
we have one dependency the user control is dependent of the class library because an instance of class C will be instansiated as I mentioned before.
Now to my problem when I try to drag the user control from the toolbox into a form that exist in the project that build the exe file which search path is used to locate the class library dll because I get this error
"An exception occured while trying to create an instance of
WindowsControlLibrary.B. The execption was "?"." probably because the class library can't be found.
Where should I look and what should I do?
I'm rather new to using user control dll and class library.
One more additional information is when I drag the use control into a form a get the error message and at the same time two references are added which is the class library dll and the user control dll
If I look at the reference path for the class library that was added I
discover that my class library exist in this directory.
If I look at the reference path for the user control library that was added
I discover that my user control library exist in this directory. The two added reference path are the same.
//Tony
|
|
|
|
|
I am trying to create an ASP.net runtime from a cd rom. I am having a problem with 2 declarations.
private Server srv;
&
public Browser(Server srv)
For both "Server" parts it says : The type or namespace name 'Server' could not be found (are you missing a using directive or an assembly reference?)
I am using a tutorial to do this, but it does not mention anything about this. It just says
"add this private attribute to the class:
private Server srv; "
&
"The next task is to change the constructor of the Browser class by changing the constructor of the class like this:
public Browser(Server srv)"
Its a bit vauge I know, but any help would be appreciated. The full code snippet is below.
public class Browser : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
private AxSHDocVw.AxWebBrowser internetExplorer;
private Server srv;
public Browser(Server srv)
{
InitializeComponent();
this.srv = srv;
}
|
|
|
|
|
Hi all,
I have a form window which does not have a frame border and also i have set ShowInTaskbar to false.
I want my window to always stay on the desktop behind all the windows. What happens, as of now, is that whenever i press Show Desktop button, all windows are minimized. Since the window is not present in the taskbar, i cannot get it back.
Please help me out with this.
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Why don't you press the button once again?
In that case all windows that where hidden would be displayed as they were...
And programatically, you cans send a WinLogo+D keyboard input....
Hope this helps..
|
|
|
|
|
Hey, thanks for the reply.
Well, thats not the main idea. I am not concerned about the rest of the windows. What i want is that my window should not be disturbed by Minimize all command. There must be some way in which i can make the window to stay at the back of all windows and stay up on the desktop.
Anyway, thanks for your help.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Hi
I am using a datalist to display images that are retrieved form a database in a gallery format (with numerous rows and columns). I have made the images selectable, but now I want to display the details of the image in a popup window when the image is selected. I need to display the selected image, the title, the category the image came from and the code of the image in popup window. How do I go about doing this? All the details, including the image iteself, are retrieved from a database.
Which event handler do I use? The onItemCommand or SelectedIndexChanged? How do I display the slected item and its details in a popup window? When the event occurs do I need to bind the data back to the control?
Thanks
|
|
|
|
|
My code is this:
System.Diagnostics.Process start = new System.Diagnostics.Process();<br />
start.StartInfo.FileName = pathToEXE;<br />
start.StartInfo.Arguments = someArguments;<br />
start.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;<br />
start.StartInfo.UseShellExecute = false;<br />
start.Start();<br />
start.WaitForExit();
However, when the application starts, I get the following message:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission,
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
How can I aasign security permissions to the started application? I should mention that when I start the application by itself, it works just fine - it doesn't need any rights.
What's the 'catch'?
Thanks
|
|
|
|
|
If the pathRoEXE is a UNC path then it will be run in the "Intranet Zone" which does not permit .NET applications to run by default.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Yes, it is a UNC path. But there must be a way to start a .NET application! How do I do that?
|
|
|
|
|
sandrina wrote: Yes, it is a UNC path. But there must be a way to start a .NET application! How do I do that?
Use Administrative Tools-->Microsoft .NET Framework x.x Configuration (where x.x is the version of the .NET framework your application is written in)
You then set the security on the exe, zone, UNC path or whatever as fits the security policy of your company.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
OK, thanx, that's big help. I'll try that.
|
|
|
|
|
Hello
I have a usercontrol(UC) with a number of childControls. My textbox control in the UC's got an EnabledSpecial event, which I wanna run when UC is enabled true / false.
protected override void OnEnabledChanged(System.EventArgs e)<br />
{<br />
if(this.Enabled)<br />
TextBox1.EnabledSpecial = true;<br />
else<br />
TextBox1.EnabledSpecial = false; <br />
}
It looks as if everything is run as intended, but the EnabledSpecial (which I do to make disabled text black instead of grey) doesn't take. Does anyone have an idea wherein the problem may lie?
-- modified at 4:53 Monday 3rd April, 2006
|
|
|
|
|
Looks good at first glance (I hope those extra brackets are only editing issues...).
Have you stepped throught it with the debugger and verified your property gets called? Probably it's just not working the way you expect it...
|
|
|
|
|
Thx for response, and yes, it was editing issues
The problem seems to occur when the Uc.Enabled is set to false... It seems the textbox gets normal .Enabled property set to false eventhough I try to override it.
|
|
|
|
|
protected override void OnEnabledChanged(System.EventArgs e)<br />
{<br />
if(this.Enabled)<br />
tbTextBox.EnabledSpecial = False;
else<br />
tbTextBox.EnabledSpecial = False;
}
|
|
|
|
|
Hi, I would like to create a mini window.form like getright Drop window(it's a small window.form ~100x100px always on top ,where you can Drag & Drop html link.After you drop the link on it , the main window open with the info of the link)
It's easy to create the mini form but I can't manage to call
the mainForm_DragEnter(object sender, DragEventArgs e) from the mini form.
In c++ you could get the parent form that create the mini form and you could use its(parent form)public methods.Is there a way to implement the same behaviour in c#?
I would like to have something like this:
miniForm_DragEnter(object sender, DragEventArgs e)
{
mainform = ??; //get the mainform (in c++ this is a pointer to the mainForm)
mainForm.Visible(true);//Main form Public method
mainForm.mainForm_DragEnter(object sender, DragEventArgs e);//Call the Main form DragEnter method (public)
}
Please help me
Thanks Francy
p.s. Sorry for my bad english
|
|
|
|
|
Use this.Owner and cast it to whatever type your mainform is.
To avoid casting you could also give the owning form in the constructor of the miniform.
|
|
|
|
|
Hi,
I'm trying to read the GPS coördinates from a GPS Device configured as a COM Port.
I've managed to Open the Port and I get some data, but I've no idea how to interpret it.
All I get is some jiberish (I don't know how to spell jiberish, apologies), I've tried to interpret it as a byte array, but even then it's returning nonsense.
Any idea what I might do wrong?
<br />
Ports ports;<br />
SerialPort serialport;<br />
string coor = "";<br />
ports = new Ports();<br />
serialport = ports.OpenSerialPort("COM4");<br />
coor = serialport.ReadLine();<br />
I've also tried the other functions of the SerialPort object.
I hope somebody can help me.
tnx!
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
Have you set the port speed, number of data bits, and parity with the same settings as specified by the GPS device?
If the settings not are correctly set then you may recieve garbarge. Try different settings with a terminal program like windows hyper terminal.
|
|
|
|
|
Hi,
Tnx for your answer. Normally it should work, our core program uses it.
I now wanted to write my own (I don't have the core code of our program), to see and learn a bit for myself, but I only get nonsense.
I also don't know what data to expect really (datetime? string? ... ).
Is there a good article about Ports somewhere? (I found the GPS ones here on CP)
tnx...
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
I am calling a function to which I am passing datetime as
User1.AddUser("abc","","cdf",true,DateTime.Parse("14/04/1983"),"abc@rediff.com","123","abc@gmail.com","123467","","ewq","","","Delhi","Delhi","India","110234");
The Prototype of this function is as
public int AddUser(string FirstName,string MidName,string LastName,bool Gender,DateTime DateOfBirth,string PrimaryEmail,string Password,string SecondaryEmail,string Telephone,string Mobile,string Street1,string Street2,string Street3,string City,string State,string Country,string PinCode)
But while running this function -- I am getting the exception as
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: String was not recognized as a valid DateTime.
Plz tell me that how can i pass the Datetime type to function when I have only date.
Thanks,
Sandy
|
|
|
|
|
Look into the ToString method of the DateTime Object. I believe you can pass the format there:
Something like:
DateTime.ToString("dd/mm/yyyy")
Good Luck.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
The CultureInfo for the application doesn't have the same idea as you do about the string format of a date.
Create the DateTime value you want instead of parsing it from a string: new DateTime(1983, 4, 14)
---
b { font-weight: normal; }
|
|
|
|
|
ManagementClass mc = new ManagementClass("Win32_TemperatureProbe");
ManagementObjectCollection moc = mc.GetInstances();
Console.WriteLine(moc.Count);
I am using above code to get temperature of CPU, but moc.Count always returns zero. why i m not getting objects in moc.
Shajeel
-- modified at 3:14 Monday 3rd April, 2006
|
|
|
|
|
Is there a temperature probe in the computer?
|
|
|
|