|
I gave that a go but if you set ShowInTaskBar to false the MainWindowHandle for the process is always 0 which prevents me from calling CloseMainWindow(). I have solved the problem with remoting now.
|
|
|
|
|
I'm glad that you solved it, and I'm glad that I managed to help even in a small way.
__DanC__ wrote: ShowInTaskBar to false the MainWindowHandle for the process is always 0
I know - it's a real bummer, which is why I didn't suggest this. Ho hum.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Ah, sh!t - sorry Pete, I voted you a 1 by accident (cack handed mouse skillz "r" us!)
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
No bother - I'm not in this for the votes. But thanks anyway.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello to all.
My problem is, that I can't seem to understand how to pass the updating of my progressBar control to
the function it supposed to be updated by.
my function sits in a different class then my form and does some measurments that return values and
then it manipulates it for my bussiness needs.
the problem is that I want that function(called from a background worker thread in my form) that belongs to another class to be updating the progressBar on the form created in the main thread.
if I was inside the same thread background workerThread I don't have a problem using the reportProgress method, the problem is that start_ChannelA_Offsetting function belongs to another class
here is some relevant code, please help me...
private void frmPicoBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
PICO.start_ChannelA_Offsetting(ref updateProgress);
frmPicoBackgroundWorker.ReportProgress(updateProgress);
}
private void frmPicoBackgroundWorker_ProgressChanged(object Sender, ProgressChangedEventArgs e)
{
progressBarSampling.Step = updateProgress;
progressBarSampling.PerformStep();
}
public void start_ChannelA_Offsetting(ref int updateProgress)
{
if (!Opened)
{
MessageBox.Show("device is not opened!!!");
return;
}
this.SetChannel(Channel_A, A_enabled, A_coupling, range);
this.RunStreaming((short)timeIntervalMs, this.maxSamples, windowed);
this.totNumOfSamples = (this.numValues / 2) * offsetChA.Length;
try
{
int i, j = 0, t;
for (j = 0, t = 0; j < totNumOfSamples - 1 || t == offsetChA.Length; t++)
{
Thread.Sleep((this.numValues / 2) * Convert.ToInt32(this.Intervalms));
values_collected = this.GetValues(bufferA, bufferB, bufferC, bufferD, out overflows, numValues);
if (values_collected < numValues / 2)
{
if (t >= 0)
t--;
continue;
}
updateProgress = Convert.ToInt32((j / totNumOfSamples) * 100);
for (i = 0; i < values_collected; i++, j++)
{
if (j == totNumOfSamples - 1)
{
break;
}
bufferA_mV[i] = this.adc_to_mv(bufferA[i], realRange);
}
if (i < values_collected - 1)
break;
this.offsetChA[t] = (sumBuffer(bufferA_mV) / (double)(i));
}
}
catch (Exception e)
{
MessageBox.Show("Finishing in an orederly fasion");
Console.WriteLine(e);
this.Stop();
}
if (Opened)
{
this.Stop();
MessageBox.Show("finished all requested sampling");
}
}
all help will be most appreciated.
|
|
|
|
|
Y isn't anyone answering me???????????????
|
|
|
|
|
Hi all
How can i display a msg to save before leaving the current page ONLY if the user has made changes in this page else i dont want to display the msg.
Is this possible? I have seen this senario working in CRM.
thanks
|
|
|
|
|
If you are talking about a web page, then this is a web development question, not a C# question, as you can't do it using C#.
Use the onunload event in Javascript to do something when you leave the page.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi.
I am doing an application in WPF where you can move around controls with your mouse. But what I want to do is to prevent the mouse cursor from leaving the area like in a MID forms application. I've tried to use set the mouse cursor on the MouseLeave and PreviewMouseMove event, but none of those solutions gives a good visual result. You can acctually see the cursor change position. I even made changed position on the Query event of my area (which is a canvas in this case).
Is there some magical solution to this? ..
Thanks in advance!
/Joakim.
|
|
|
|
|
hi,
i m new to directx programming... how can we create our own "direcshow filters"...? and register them in the registry...?
can anyone help please...?
thanks,
Kuldeep
|
|
|
|
|
http://amitranjan.wordpress.com/2006/05/31/enumerating-directshow-filters-on-wm5-deviceemulator/
Jintal Patel
|
|
|
|
|
|
I have file I want to transfer it from pc to another via modem the problem is I want to make the procedure on one button click. one in the sender side to send the file and another on the receiver side to receive the file.
I think it would be possible to do it depending on hyper terminal but i couldn't find way to run hyper and work on it on c# project ?
if any body can help on this way or another ?
best regards
sam
|
|
|
|
|
وينكون يا شباب
ليش ما حدا عم يرد
إذ ثير أني بادي هير=is there any body here
السلام يا زكرتية الحارة
لك ليش ما عم تشتغل
|
|
|
|
|
Hi, I want to insert a record , and I use tableadapter to execute the insert statement, when I run the application and execute the statement , works ok
and after I see the datagridview and the new row is there, but the problem is that when I stop the application and look my database in SQL Server 2005 the table don´t have the new row.
Somebody knows why? or Any idea to insert or delete or update rows in SQL Server 2005 data base using C# 2005.
himanshu p.taunk
|
|
|
|
|
|
hi all,
I am pretty new to this topic. i am developing a windows application using C# in which i need to call a mobile number when i enter the mobile number in a textbox.
How can i do it? i tried searching the google and found some examples in vb using mscomm control which did not work in .NET (as for me).
can anybody point me to some samples or suggest any ideas?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
visit this site http://www.tapiex.com i use it's librarry it was very useful
|
|
|
|
|
I found some examples(terminalcontrolproject and minimalisticTelnet) to connect to telnet from c#.net and execute the commands.
But my requirement is --Dynamically I know the IP to whihc i should connect through telnet and I have some commands to execute on that (remote system)IP
All these should happen at backend i.e., terminal should not be visible
minimalisticTelnet example nearer to my requirement but it is giving exceptions that i posted.
Please suggest me on this urgent
PraveenKumar Palla
|
|
|
|
|
praveenkumar palla wrote: Please suggest me on this urgent
They're all urgent. You won't get much of a response that way. You certainly won't get much if you don't describe, or include the exceptions you are encountering, or links to the examples you reference.
only two letters away from being an asset
|
|
|
|
|
This is the reference
http://www.codeproject.com/cs/internet/MinimalisticTelnet.asp?forumid=425724&select=2233796&df=100&msg=2233796
exception is
"Failed to connect : no password prompt"
I am able to connect with same IP login and password from cmd.exe
Thanks for the reply
|
|
|
|
|
Well then the person probably best able to answer this is the author.
only two letters away from being an asset
|
|
|
|
|
|
Hi,
I have developed one windows service application using C# 2.0.
I have class for read and write value in INI File. In INI file I have storing the database path.
I need to get the path value in windows service class. So I have used the following function for read and write the value in INI File.
[DllImport("kernel32")]
public static extern long WritePrivateProfileString(string SectionName, string KeyName, string Value, string FileName);
[DllImport("kernel32")]
public static extern int GetPrivateProfileString(string SectionName, string KeyName, string DefaultValue, StringBuilder Value, int Size, string FileName);
I called this function in start service
public void StartPPdbService()
{
// Get DB path
StringBuilder tmpPath = new StringBuilder(255);
try
{
MyWin32.GetPrivateProfileString("PPdb", "path", ".\\DB\\", tmpPath, 255, Gen.IniName);
PPGen.DBpath = tmpPath.ToString();
if (!PPGen.DBpath.EndsWith("\\"))
{
PPGen.DBpath += "\\";
}
}
catch (Exception e)
{
// Insert Open in db log
PPGen.Log("DB", e.Message.ToString(), Visible);
}
finally
{
// Insert Open in db log
PPGen.Log("db", PPGen.DBpath.ToString(), Visible);
}
}
The above code return only default value not in INI file value.
Thank you,
Best regards,
Sundar
B.Sundarapandian
|
|
|
|
|
If you are using 2.0 then you should use app.cofig, not antiquated techniques like ini files.
only two letters away from being an asset
|
|
|
|