|
Thanx for answering.In the second method i have intentionally left out InvokeRequired check.
|
|
|
|
|
You can also shorten up the second one a bit. It avoids the overhead of an extra object creation and delegate call.
2.) Using an anonymous method and MethodInvoker:
...
public void SomeMethodRunningInDiffirentThread()
{
...
this.Invoke((MethodInvoker)delegate()
{
UpdateUI2();
}
));
...
}
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
Hi;
I'm french which does not know a lot about Add-ins...
I did a COM Add-ins for outlook in C# through VS .NET.
I add a configuration file in my project to set some specifics configurations.
I add a project for setup (which build a .msi file). This one copy the configuration file in the installation directory of the add-ins.
I tried to get information with the method :
String dataReadFromConfigFile = ConfigurationSettings.AppSettings["MyKeyToData"];
But it does not read my configuration file. In fact I think that it reads Outlook one.
So my question is :
How to read the configuration file in the installation directory of my add-ins ?
This question can simplified in :
How to get directory of the installation of my add-ins ? And then it can be read easyly by reading a .xml file.
Many thanks for Help
Frédéric
Frédéric
|
|
|
|
|
How to copy file from a server to the other when other server is in different domain!!!!
|
|
|
|
|
Use the full domain name in the UNC path.
When I'm at work I can copy a file from a path like this:
\\SomeServer\SomeShared\FileName.txt
When I connect from another domain I can use
\\SomeServer.MyCompanyName.co.uk\SomeShare\FileName.txt
Also, we have situations where there is some configuration in the Active Directory (some trust setting, I'm not the Sys Admin so I don't really know) where by different domains are given trust so that I can log on with my regular username/passphrase combination.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Is it more efficient to use the Win32 API with BitBlt for double buffering or simply the .NET way with SetStyle?
I've seen many web sites that offer different opinions on this. When I'm looking at the drawing performance, it seems that BitBlt is slightly faster (Even though I doubt it's using any hardware acceleration).
|
|
|
|
|
If graphics performance is the issue then you need to develop a couple test programs in C# to determine if the performanace obtained is suitable. You can always eek out greater performance by dropping down the VC++ but you might want to reserve that as your last option
Mike
|
|
|
|
|
how to get a window handle in .net application.
thanks
Ramendra K
|
|
|
|
|
|
Of the myForm.Handle property...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am creating an application using Visual Studio .NET 2003 whose setup requires another setup to be embedded.
Is there any way by which I can embed an .msi file in my setup and launch it during the installation of my application.
I couldn't find anything on this anywhere...Please help
Sameer Bhise
|
|
|
|
|
From page 175 of Phil Wilson's book "The Definitive Guide To Windows Installer":
You cannot start an external Windows Installer setup from within your own setup because Windows prevents two installs from being in the InstallExecuteSequence at the same time. If the other setup is installer-based, then for this reason you can't start it from within your setup package. Although you can detour this restriction by starting the other install from the UI sequence of your own setup, this in turn means tha tyou're committed to providing a UI from within your own install, which can therefore never be silent. This effectively makes your product nondeployable in software distribution schemes that almost always suppress the UI. So, you can add the MSI file to your install project and hook it to a UI event by using Orca to edit the MSI file, or you can add it as a custom action and make it an asynch action when the installer ends.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
hello all,
Quite simply, I need to get the size of an objects memory footprint, does anybody know how this can be done in C#? e.g The amount of bytes of memory a DataSet object uses after it has been populated via a database call.
I have looked at the sizeof(..) MSDN docs, but these indicate that the function is only valid for Value types and is also unsafe code (something I would prefer to avoid). There is also the System.Runtime.InteropServices.Marshal.SizeOf(..) function which unfortunatly returns the following error for datasets:
Additional information: Type System.Data.DataSet can not be marshaled as an unmanaged structure; no meaningful size or offset can be computed.
At the moment I have a very clunky piece of code that parses the DataSet via an XML object into a Byte[] and then uses the length of the array. Not very pretty at all
Thanks
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
The size of a DataSet object? I don't think you can, reliably anyway.
The error says it all - "no meaningful size or offset can be computed".
The DataSet is a complex object that not only holds value types, but also holds references to other objects, that won't be inside the footprint of the DataSet object. You'd have to get the size of every referenced object that a DataSet refers to, and add that to the size of the DataSet. But as you've already found out, you can't do that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
What do you need to use it for? It is possible using the profiler api, but that involves COM, native code and turning profiling on for you app which will slow it down. If you just need to check something you can also just use windbg and sos to view the DataSet in memory.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Well thats the thing, this isnt just development function I am after, the code would stay in the production release.
Essentially I have a traditional application logger that support different log levels, at log level DEBUG data in datasets is output to the log files. What I want to do is check the size of the dataset, if it exceeds ~20mb then only log when the application configuration allows (i.e. a LogLargeObjects configuration item)
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
how can i change the background color of console window
not only of text area but of hole background when we run the app.
AMit Katiyar
|
|
|
|
|
If your using .NET 2.0, all this has been made very easy for you. eg:
<br />
Console.BackgroundColor = ConsoleColor.Blue;<br />
Console.Clear();<br />
If not, then its down the old InterOp path I'm afraid.
Regards,
Rob Philpott.
|
|
|
|
|
|
Hello there,
I'm having a problem using XMLConvert.ToDateTime(str) when str = "2005-07-13T11:12:00Z". But it works when the last character 'Z' is removed from the string. What could be a work around for this? I know we can't just remove 'Z' since it denotes that the time is in GMT and not in local time.
Thanks!
~Rafferty
|
|
|
|
|
Hey,
Off the top of my head (better solution probably exists) - why don't you replace the Z of present with ' +00:00' and try that?
Regards,
Rob Philpott.
|
|
|
|
|
That won't work, Z represents the time to be in GMT time. so if I add +00:00, the xmlconvert class may think that the time is in local time which will give me wrong time values
|
|
|
|
|
Not so,
You can either express a date using the Z to denote UTC time (same as GMT), or you can use local time and specify the timezone. By using " +00:00" you are using the local time in Greenwich which also happens to be GMT.
Take a look at http://www.w3.org/TR/NOTE-datetime[^]
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
I had to create Windows Service Application for my project. I have a client-server application. The server application, is a form with a button, and on click of it the server starts. So i need to convert this application to 'windows service'. I went through MSDN, and created a service. In the 'OnStart' method, u need to write the code which will run the application, so i wrote the 'code which was in the buttonClick event' of the form...
the service was created and installed, but when i 'started the service', i got this errror :
"The Service1 service on your Lcal Cmputer started and then stopped. Some services stop automaically, if they have no work to do, for example, the Performance Logs and Alert services."
Please do tell me what to do.....
|
|
|
|
|
1. You need to construct a loop in thread somewhere, else the program will just quit.
2. Im not 100% sure, but you are trying to use UI code in a service. .NET services dont interact with the desktop.
xacc.ide-0.1 released! Download and screenshots
|
|
|
|