|
hello everybody in this forum.
Iam creating a usercontrol that runs as an embedded object inside the html code page in internet explorer that uses system.Net.Sockets to connect to a server i ran it on my localhost . It connects successfully , But after halt time . The explorer at first it hangs on for some seconds (lot of seconds) then it connects successfully.
Iam asking why the explorer doesn't respond during this time till it connects ? is there anyway for me to overcome this problem of halting the explorer?
I don't need it to halt ? i need it to work immediately.
Thanks everybody in this forum.
Any help will be greatly appreciated.
Human knowledge belongs to the world.
|
|
|
|
|
Use a new thread to do the socket communication. If you're using the UI thread, it will lock up explorer while the connection is made. If you use a second thread, it shouldn't lock up explorer.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hallo,
I make a windows service that check new entry in a database table, if there are new entries the service show a notify icon in the system tray.
all works fine but when the system tray show my icon, some applications crashes and stop to work (e.g: cics)
Any suggest for me? Thanks a lot.
(I hope you understand me, me english is not so good.)
|
|
|
|
|
I can't sqy why while you don't show me your code...
|
|
|
|
|
I'm sorry!
This is the code:
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Diagnostics;<br />
using System.ServiceProcess;<br />
using System.Text;<br />
using System.Drawing;<br />
using System.Data.SqlClient;<br />
using System.Windows.Forms;<br />
<br />
<br />
<br />
namespace Warning<br />
{<br />
<br />
public partial class Warning: ServiceBase<br />
{<br />
private System.Timers.Timer m_tTimer;<br />
private SqlConnection sqlConn;<br />
private SqlCommand sqlCmd;<br />
private SqlDataReader sqlReader;<br />
private string strSql;<br />
<br />
<br />
public Waning()<br />
{<br />
InitializeComponent();<br />
<br />
}<br />
<br />
protected override void OnStart(string[] args)<br />
{<br />
m_tTimer.Enabled = true;<br />
m_oNotifyIcon.Visible = false;<br />
}<br />
<br />
protected override void OnStop()<br />
{<br />
m_tTimer.Enabled = false;<br />
<br />
}<br />
protected override void OnContinue()<br />
{<br />
<br />
}<br />
private int GetNewRequestes()<br />
{<br />
int newRequestes=0;<br />
<br />
sqlConn = new SqlConnection("DATABASE=DBNAME;SERVER=DBSERVER;user id=user;password=xxx;");<br />
strSql = "SELECT COUNT(*) FROM DBTable WHERE StatusID=5";<br />
try<br />
{<br />
sqlConn.Open();<br />
sqlCmd = new SqlCommand(strSql, sqlConn);<br />
sqlReader = sqlCmd.ExecuteReader();<br />
sqlReader.Read();<br />
newRequestes = sqlReader.GetInt32(0);<br />
sqlReader.Close();<br />
}<br />
catch (Exception err)<br />
{<br />
string msg = err.Message;<br />
}<br />
finally<br />
{<br />
sqlConn.Close();<br />
}<br />
return newRequestes;<br />
}<br />
private void m_tTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)<br />
{<br />
int newRequestes = 0;<br />
newRequestes = GetNewRequestes();<br />
if (newRequestes>0)<br />
{<br />
m_oNotifyIcon.Visible = true;<br />
m_oNotifyIcon.ShowBalloonTip(60, "There are "+newRequestes.ToString()+" new requestes!", " ", ToolTipIcon.Warning);<br />
}<br />
else<br />
{<br />
m_oNotifyIcon.Visible = false;<br />
}<br />
}<br />
}<br />
}
Any idea? Thanka a lot!
|
|
|
|
|
Hi
I have a SD card in a Pocket PC, and now I would like to get it's properties.
Total size, used space and free space to be exact.
How do I do that in C#?
|
|
|
|
|
|
Hello,
I'm a student to software developing and my problem is as following:
I have to create an xml which fills the tasks, ressources, etc. for MSProject2003. Now, after I could get the xml started proper in MSPj, i have to replace the Tasks where only numbers are defined to make it much better readable. I have to use enums but project doesn't have the enums i need, so i have to create my own!!
How can i create this enums and use them the right way???
Thanks for help!
-- modified at 5:18 Thursday 6th April, 2006
|
|
|
|
|
public enum enum_name<br />
{<br />
Element1 = 0,<br />
Element2 = 1,<br />
...<br />
ElementN = N<br />
}
Or I didn't understand what do you need?..
|
|
|
|
|
Thanks for the answer!
got the solutio for my problem by myself when i was trying about changing my code!
I didn`t know how to set the enums the right way to use it proper in my code!
the answer i needed was:
<br />
public enum MyEnum = 0;<br />
...<br />
i only had to set MyEnum into the code where i needed it:
<br />
(int)System.Enum.EnumUsing.MyEnum;
Like I said, I´m a student to programming and learning about how to use code in proper way to write a bugless programm.
However, thanks for the help!!!
|
|
|
|
|
Hello,
I've a problem connecting to a mysql Database.
My program gives an error when i try to use using ByteFX.Data.MySqlClient;
It gives this error with this code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ByteFX.Data.MySqlClient;
namespace UploadBatches
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
Error 1 The type or namespace name 'ByteFX' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\wvsighem\My Documents\Visual Studio 2005\Projects\UploadBatches\UploadBatches\Form1.cs 9 7 UploadBatches
Can someone help me please
Thx
wistiti 5
|
|
|
|
|
|
That was indeed the problem
Thx
wistiti 5
|
|
|
|
|
Hi.
I want to use in my application a thing like common task in windows XP that appear in left side of a window.
Can you help me?
Best wishes
|
|
|
|
|
Write more about your problem...
|
|
|
|
|
I hope that you understand my mean about common task:
A portion in left side of all windows(My Computer, My Documents , ...) in Windows XP that in My Computer window, For example have System Tasks, Other Places and Details, that with click on each of them closes and opens.
OK?
I want to use somthing like this.
How?
Best wishes
|
|
|
|
|
Is there possible for someone to open an existing assembly and modify it with the help of System.Reflection classes?
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
|
Hey all,
I've been trying to look for similar problems all around the net, but I didn't succee...
Anyway, my problem is like that:
I wrote a little command line mailer that tries to send a mail to me when certain events happen. The mail program worked wonderful until I actually tried to run at the server.
It stills sends mail, and I still receive them, but some of the mail just don't appear in my mailbox. The problem is that sometimes I do get those mails, and sometimes not (The same mails, with the same subject and message text etc.). In the past I've used a program called postie.exe which (until now), never missed a mail.
As you probably understand, I got no relay problem what so ever, and I also didn't get any exception (I finish the command "SmtpMail.Send(aMessage);", with no errors).
Here is a small part of the code:
aMessage = new MailMessage();
aMessage.From = from;
aMessage.To = to;
aMessage.Cc = cc;
aMessage.Bcc = bcc;
aMessage.Subject = subject;
aMessage.Body = text;
SmtpMail.SmtpServer = smtpServerName;
SmtpMail.Send(aMessage);
return(true);
I don't know if that will give any more info, but I did some checking in my Exchange server and I saw that the missing mails never reached it (I've used the message tracking sending program supplied with the exchange server).
Also, all mails are being sent from a user inside the LAN to a user inside the LAN
Any idea what may be the problem?
Thanks,
Guy
|
|
|
|
|
I have a MDI Application. When the application loads Modal dialog opens asking for login. After period of inactivity the same ModalDialog needs to be opened. It opens perfectly but this time it opens as Modaless dialog.Help on this would be much appreciated.
I am using the same method to show the dialog but whats the reason it open as modaless dialog after the inactivity period. Thanks in advance.
Sairam
|
|
|
|
|
Try,
In the method you open the form
Set every Time the property MdiParent:
form.MdiParent = this;
Maybe when you open it you use
Ricardo Casquete
|
|
|
|
|
Thanks for the reply.
I am using InActivityMonitor Posted in CodeProject for tracking Inactivity of the Application. On Time Elapse calling a static method in form class where i invoke the ShowDialog. The Dialog which pops up is modaless. Initally when the dialog is called its modal.
I tried passing the MainForm Instance as a paramter to the static method and assigned that as MDI parent of the form which calls the showdialog. After timeelapse, it is showing dialog itself.. this is strange or am i doing something wrong???
Can you please assist me in this.
|
|
|
|
|
Thanks for the reply.
I am using InActivityMonitor Posted in CodeProject for tracking Inactivity of the Application. On Time Elapse calling a static method in form class where i invoke the ShowDialog. The Dialog which pops up is modaless. Initally when the dialog is called its modal.
I tried passing the MainForm Instance as a paramter to the static method and assigned that as MDI parent of the form which calls the showdialog. After timeelapse, it is NOT showing dialog itself.. this is strange or am i doing something wrong???
Can you please assist me in this.
|
|
|
|
|
I think it is strange...
I have just made a sample with 3 forms...
One as MdiParent, One as Children and One as Modal...
and everthing works...
the code is this... as normal as you can Imagine... so thats why I don't understand what is happening to you... maybe you have some property in the forms that is doing this behaviour
//Code in Form1 ( the Mdi Parent )
Form2 f = new Form2();
f.MdiParent = this;
f.Show ();
// Code in Form 2
Form3 f = new Form3();
f.ShowDialog ( this );
I am really surprised about your error...
Good Luck
Ricardo Casquete
|
|
|
|
|
Atlast i found out the cause, but not the solution... If u can tell me the solution that would be great..
In the background a thread is running checking whether the Time has elapsed for the application(i.e Application is idle or inactive for certain period), In that thread i am trying to show the showdialog.
The Application parent thread is running which hold the instance of Parent form (which should be MDIparent of dialog), but it is not..
In my app dialog is running in a separate thread and the application MDI parent is running in separate thread. When i tried to assign the MDI parent of Dialog i got an exception as follows.
Please let me know if you have any solution or workaround for this...
Exception occured: Controls created on one thread cannot be parented to a control on a different thread.
Parameter name: value
|
|
|
|