|
You can call theOtherThread.Join to force some thread to finish executing.
Since you're doing UI communication, I recommend you use the System.ComponentModel.BackgroundWorker component; this will fire a "work in the background" event (DoWork event) which will run on a background thread. Then another event (the RunWorkerCompleted event) will fire when the work is done; firing on the UI thread. Thus, it allows you to do multithreading without having to do manual thread joins, UI control invokation and so on.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I am trying to communicate between two app domains which my application process has. Two questions...
1. Is .net remoting the best way to communicate an invocation between these two app domains?
2. Is IPC the best type of channel, when the communication will (must in fact) never go outside of my process?
Joel Holdsworth
Want to give me a job this summer?
Take a look at my online CV
|
|
|
|
|
Maybe this answers at least one of your questions: Ingo Rammer (a .NET remoting guru) states on his blog [^],
"As soon as you create a new application domain in .NET, you are automatically using Remoting behind the scenes to communicate between the two AppDomains. In this case, the Remoting framework will setup all channels and sinks for you - and in fact it will use a highly optimized formatting process and an in-memory channel.
This provides for two different implications: a) you can't change formatters or channel sink chains and b) you don't have to care too much about it. It just works. You can use all .NET Remoting features without any problems.
In fact, cross-AppDomain calls are one of the primary use cases for .NET Remoting. They are so well integrated in the framework, that you usually don't even notice that you are using Remoting."
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hmm ok, that's helpful. The reason I ask is that I'm writing a manged plugin for an unmanged application with a MC++ bridging dll and a C# worker dll. So far things have been fairly simple - the bridging dll has a "Run" method which gets called by the host when it's time to do work, and then the whole of the plugin operates within that single app domain. However I get problems when I need to handle callbacks from the host, because .net seems to give these functions a fresh app domain. So I need to figure out how to use remoting (or whatever) to forward the event into the main app domain.
Joel Holdsworth
Want to give me a job this summer?
Take a look at my online CV
|
|
|
|
|
|
Hi All,
I have a requirement, where my web application before redirecting to a particular page, need to validate a business rule. the business rule logic is running in a different server other than the webserver but in same domain.
The business logic runs as a Remoting service and exposes a public method to validate the logic. Code looks like this.
----------------------
namespace MyNamespace
Class Class1
string xmlPath = appReader.GetValue("RemoteConfigPath", typeof(System.String)).ToString();
//configuring the Remote server.
RemotingConfiguration.Configure(xmlPath, false);
private void CalculateAverage()
public Int Average() -- method exposed to client
------
in the client :
string remoteUrl = @"tcp://" + ServerName of the remoteservice+ ":" + port + "/MyNamespace.Class1";
remoteObj= (Class1)Activator.GetObject(
typeof(Class1),remoteUrl);
int i = remoteObj.Average(); ---------if the service is unavailable, this line takes 15 or more seconds to timeout
Ideally i want to timeout if the call is un successful for 3 seconds.
How can i achieve it. ??
I' m not registering any port or tcp channel in client. the config file for remoting configuration looks like this :
<configuration>
<system.runtime.remoting>
<application name="MyRemoteService">
<service>
<wellknown type="MyNamespace,Class1"
objectUri="MyNamespace,Class1" mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="8085">
<serverProviders>
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
it works fine if the service is available , problem when service is not available.. needs to timeout..
|
|
|
|
|
I searched the Internet, including CP and MSDN, but I didn't find anything useful.
I'm developing a custom Windows Forms control, inheriting from Panel.
This control has a few string properties that I'd like to make localizable. How can I do this?
Thanks in advance for any help.
EDIT: I'm working with VS2005 Standard.
___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]
-- modified at 11:31 Tuesday 25th April, 2006
|
|
|
|
|
Try marking the properties with the Localizable attribute
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Ed.Poore wrote: Try marking the properties with the Localizable attribute
I tried, but the control disappears the first time I change the language of the form that contains it (with the property Localizable se to true).
The control remains invisible at run time too.
___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]
|
|
|
|
|
Hi all,
I want to write a plug-in to IE, Firefox, and other web browsers, and I hope all of you will share your experience with me.
Thanks in advance,
Hung
|
|
|
|
|
hi every on plz i am confuge between function overloading and delegates in C# plz tell me what is difference Between Function Overloading and delegates in C#.
Rahul!
|
|
|
|
|
A delegate is basically a pointer to a method. Function overloading is when you implement several methods with the same name but with different sets of parameters.
Ut Rahul wrote: i am confuge
I am sorry to hear that. That sounds quite painful.
---
b { font-weight: normal; }
|
|
|
|
|
Delegate/Events are more or less like an array of references to methods in objects. Overloading seeks to slightly alter, in a way customize, behavior for implemented objects. They are really different methods exhibiting different behavior. Although you can similate overriding with events but one should really avoid it. Likewise, you can similate events using virtual behavior as well but again you should avoid it.
|
|
|
|
|
Tom Larsen wrote: Overloading seeks to slightly alter, in a way customize, behavior for implemented objects.
I reckon that you are thinking of overriding, not overloading.
(Then again, that could also been what Ut Rahul was thinking of...)
---
b { font-weight: normal; }
|
|
|
|
|
Hello all,
i am using WebBrowser Control for displaying of Data. but this will accepts only HTML data. but in my application getting the Data from multilined textbox.
Here i need convertion of string to HTML.
how to do this?
regards
GV Ramana
|
|
|
|
|
<FONT color=Blue>string</FONT> html = <FONT color=Blue>string</FONT><FONT color=DarkBlue>.</FONT>Format<FONT color=DarkBlue>(</FONT><FONT color=Maroon>"<p>{0}</p>"</FONT>, textbox<FONT color=DarkBlue>.</FONT>Text<FONT color=DarkBlue>.</FONT>Replace<FONT color=DarkBlue>(</FONT>Environment<FONT color=DarkBlue>.</FONT>NewLine, <FONT color=Maroon>"<br/>"</FONT><FONT color=DarkBlue>))</FONT>;
-- modified at 12:48 Tuesday 25th April, 2006
|
|
|
|
|
string myHTML = string.Format("<html><body>{0}</body></html>", myTextBox.Text.Replace(System.Enviornment.NewLine, "<br/>"));
I hope that compiles.
- Malhar
|
|
|
|
|
Hey all,
I'm trying to get an application to read some cells from an excel spreadsheet. The problem that I am running into is with the date fields of the cells. The test code that I am using is:
string cellValue = ((Excel.Range)workSheet.Cells[3,1]).Value2.ToString();
DateTime dt = DateTime.FromOADate((double)((Excel.Range)workSheet.Cells[3, 1]).Value2);
When I display cellValue of a date field (1/2/2006 in the spreadsheet), it shows me a number which is 37257. When I display dt, it shows 1/1/2002. I cannot seem to get it to pull the right date from that cell, it is always messing up on the year (but it does appear to be always getting the month and day correct). I'm not sure how to go about fixing this, any help would be appreciated
Shultas
|
|
|
|
|
Excel stores dates differently than the .net dateime. the 37257 is the number of days(and then, 12:00 AM on that day, because there is no .XXXXXX after the 37257), that have elapsed since one of TWO separate dates. Suffice to say that excel has two separate base dates, Jan 1, 1900 and Jan 1, 1904. This has to do with Mac/PC versions of excel, and is a longer story than I bet you want to hear.
Anyways, you need to do one of two things:
1) Dynamically find out what epoch your spreadsheet is using and handle that.
OR
2) Use DateTime.TryParse() to parse the text of the cell and let the compiler figure out the date(and time) from there.
|
|
|
|
|
Why don't you use the Value property rather than the Value2 property. The Value2 property returns this integer for reasons specified in the documentation. Value will return a "proper" date.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi everyone,
I am adding a simple extention to a call center application to allow it to initiate a telephone call to the real world by connecting to the company's Nortel BCM.
Does anyone have any experience of this or know where I can get started?
I have found some simple TAPI code but none of it is specifically connecting to a BCM.
Any help would be gratefully appreciated. Thanks in advance.
Wayne Eastaugh
|
|
|
|
|
TAPI connects through a "driver" to third-party telephony hardware. You'll need to see if your hardware supports TAPI. You are looking for a TSPI file, which is a dll that TAPI uses to talk to the hardware.
You many find that the hardware has its own custom API and SDK and doesn't bother with a TAPI interface.
The best bet is to check the manufactuer's website or contact your support representitive.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
hi all,
is there a way to get the icon of an application like in alt-tab menu. i have EnumWindows working nicely and i have a handle to the window, but i cant find anything in api to get the icon for that window using its handle.
how can this be acheived please ?
kind regards,
g00fy
|
|
|
|
|
This link has a lot of icon info:
About icons[^]
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
Hello all,
I've searched almost all the web but I didn't find any clue to help me...
My datagrid is bound dynamically to a collection of objects (let's say with fields : name, age, sex, phone).
All mapping names are done in the order I want to see them on screen : name, age, sex, phone.
When I execute the code, the fields appear in a different order, sex, name, age, phone.
I tried to remove all TableStyles, it still works with this ugly order.
I tried to change properties in TableStyleDescription (for example, width of a column) but nothing changes.
Any clue to help me ?
Thanks
|
|
|
|