|
Well, a clean output for clean designs. If your design (in this case, MY DESIGN) has troubles (if the class is not ICloneable), and the object that you think that is for sure can be modified by side-effects (if I wasn't able to call Clone(), then I copied the memory address), there must be a WARNING to let the programmer know that he has to be *VERY CAREFUL* with the original object, or make that class ICloneable, so warning message *WILL DISSAPEAR*.
Well, if he does well, there will be 0 errors, 0 warnings.
Cheers !!
|
|
|
|
|
What does this have to do with your original question?
Keep in mind that implementing ICloneable is not always an option. If your type contains a reference to another type which is not cloneable, then your type cannot provide true deep copy semantics. In that case, your annoying warning message will not disappear.
Josh
|
|
|
|
|
You're just right. In that case the #warning message wouldn't be showed, and my class would't be able to provide a true deep copy, but in that case, and only in that case, the problem (the main trouble) would be that the developer that wrote it was wrong, because didn't think about implementing Clone() method to provide a deep copy.
We sometimes just have to trust in developers that are gonna use our classes, so we cannot do more than we are doing right now.
Far away, you're right, my warning would not appear when compiling.
Thank you for your comments Josh.
|
|
|
|
|
hi to all,
i would like to have a form with an button that can show hide the form border like msn messenger does. also hides menu strip.
this is the code i have but i get terrible flicker when the controls are set visible, msn is really smooth, how can i acheive this please?
i have 7 picture boxes that contain the bg pictures and a toolstrip in the middle of the form, are the mutiple picture boxes the problem or is there a better way
if (e.Button == MouseButtons.Left)
{
if (this.FormBorderStyle == FormBorderStyle.None)
{
this.FormBorderStyle = FormBorderStyle.Fixed3D;
this.menuStrip.Visible = true;
this.Location = new Point(this.Location.X, (this.Location.Y - SystemInformation.CaptionHeight));
this.TransparencyKey = Color.Empty;
}
else
{
this.FormBorderStyle = FormBorderStyle.None;
this.menuStrip.Visible = false;
this.Location = new Point(this.Location.X, (this.Location.Y + SystemInformation.CaptionHeight));
this.TransparencyKey = SystemColors.Control;
}
}
kind regards,
g00fy
|
|
|
|
|
Try to use doublebuffer.
SetStyle(ControlStyles.DoubleBuffer, true);
|
|
|
|
|
yeah thanks for the reply, but i am doing that.
i moved the transparencykey line when settings visible true to the first line and it improved but its still very ordinary.
thanks
g00fy
|
|
|
|
|
hi
i want bind 2 exe files in one file .. how to do that ?
and how to extract those exe files again ?
|
|
|
|
|
In what way? Do you mean the 2 exes should be embedded inside a resource? Or that 2 exes should work together (using remoting)? Or that they share common code in form of a dll?
|
|
|
|
|
I am doing a report programmatically(with COM) using Word 2003. First I build the report and print it. Then the idea is to remove all headers and footers(with logos etc) and print it again with only Page {PAGE} of {NUMPAGES} in the header. I can remove the headers and footers but can't add the pagenumbering . There probably is som escape code I should use or then it is just impossible. Any ideas?
Of course I could use two different .dot files but is too slow for me.
jhaga
It would be glorious to see mankind at leisure for once. It is nothing but work, work, work. I cannot easily buy a blank-book to write thoughts in; they are commonly ruled for dollars and cents. A[man], seeing me making a minute in the fields, took it for granted that I was calculating my wages. — business! - I think that there is nothing, not even crime, more opposed to poetry, to philosophy, ay, to life itself, than this incessant business.
Henry David Thoreau
-- modified at 6:50 Tuesday 2nd May, 2006
|
|
|
|
|
Try to start record a macro, and do manually what you want.
After that copy and modify macro code to your language.
This helps me, when I was making export to Excel.
Best regards, Alexey.
|
|
|
|
|
Thanks,
it is in VB:
NormalTemplate.AutoTextEntries("Page X of Y").Insert Where:=Selection. _
Range, RICHTEXT:=True
had missed that it is richtext
jhaga
It would be glorious to see mankind at leisure for once. It is nothing but work, work, work. I cannot easily buy a blank-book to write thoughts in; they are commonly ruled for dollars and cents. A[man], seeing me making a minute in the fields, took it for granted that I was calculating my wages. — business! - I think that there is nothing, not even crime, more opposed to poetry, to philosophy, ay, to life itself, than this incessant business.
Henry David Thoreau
|
|
|
|
|
Hi All
I want to create a DTS that will read a .txt file (comma separated) and insert record in database. I want to pass .txt file name on run type. Please help me to sort out this problem.
It’s urgent.
Thanks in advance.
Amit
|
|
|
|
|
You can add a reference to the COM object called "Microsoft DTS Package Object Library", then you want to start with DTS.Package2Class . The process from there onward is far too vast to explain in a single forum post - so give it a try and post specific questions when and if you get stuck.
I havepersonally used this COM object from old VB6, and from C# so I am sure I will be able to help you with specific questions - ill keep an eye out on this C# forum in case you get stuck.
Lastly, please leave out the "urgent" - it will not get you an answer any quicker!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Ok fine I will try and thanks for your help!
Amit
|
|
|
|
|
Hi, I am trying to learn a bit of C#, so I'm trying to make a console program (a Hellow World).
I have the following code:
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
<br />
namespace ConsoleApplication1<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
Console.WriteLine("Hello World");<br />
}<br />
}<br />
}<br />
When I run it, I get a console window that displays that, but closes immediately. How can I prevent the console window from closing?
Thanks
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.ReadLine();
}
}
}
|
|
|
|
|
|
open the command prompt and run the app from there ...
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
I created a dll in .NET converted it with the TlbExp.exe to a .tlb file and I imported that file in a C++ application in which I wish to use it.
The strange thing is that for some reason the namespace in the tlb file does not seem to be correct...
The .NET dll project is called myNETDLL and creates the myNETDLL.dll file. The namespace of the class and interface I wish to export is COMCaller (I changed the default namespace in the property settings of the project too).
Now creating the tlb file goes fine, the thing is that when I import the tlb in my C++ project the myNETDLL.tlh (created when compiling the C++ project) has all the exported functions and classes in a namespace called myNETDLL and there is no mention whatsoever about any COMCaller namespace. Does anyone know what I might be doing wrong? Can^t I have a namespace with a different name than the project name when I plan to make a type library of it?
Thanks for any feedback you provide,
Davy
|
|
|
|
|
I'm trying to access a web address using proxy (Microsoft ISA Server).
The authentication is NTLM (using domain in Windows 2000).
My code is :
try
{
const string proxyHostAndPort = "http://myproxy:8080";
WebProxy webProxy = new WebProxy(proxyHostAndPort, true);
webProxy.Credentials = CredentialCache.DefaultCredentials;
WebRequest webRequest = WebRequest.Create("http://www.microsoft.com");
webRequest.Credentials = CredentialCache.DefaultCredentials;
webRequest.Proxy = webProxy;
WebResponse webResponse = webRequest.GetResponse();
Stream stream = webResponse.GetResponseStream();
byte[] receivedDataInBytes = new byte[webResponse.ContentLength];
stream.Read(receivedDataInBytes, 0, receivedDataInBytes.Length);
string receivedDataInString = Encoding.ASCII.GetString(receivedDataInBytes);
Trace.WriteLine(receivedDataInString);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
But I get an error (407 - Proxy authentication needed). Are there something wrong in my code ?
Thanks.
|
|
|
|
|
Hello,
Can i disabled the entries in ComboBox in window application ??
What i want is as follows
I have two ComboBox on my page having same entries in it. If i Select one of the value from first ComboBox then that value or entry get automatically diable in second ComboBox and vice versa.
Thanx in Adv.
|
|
|
|
|
hi ankushmn!
I suggest that you just remove it from the list instead of disabling it.
I also recommend to use a DataView as your DataSource instead of using Items.Add when populating the combobox.
you can use the RowFilter of the combobox to remove the item you want and put this handling on the SelectedIndexChanged event handler of your two comboboxes.
hope that helps!
microsoc
|
|
|
|
|
I found two debugging problems running my program on new operating system. It contains Visual Studio, and I run Debug version. Results of Release versions are the same.
1) Program doesn't report correctly about missing Dll. C# executable depends on C++/CLI Dll, which is linked to unmanaged Dll. Unmanaged Dll is not found, and program reports "Module not found" exception in some completely unrelated code fragment. Message doesn't contain missing Dll name. I fixed the problem, but why error message is not informative?
2) Exception dialog contains two buttons: Debug and Close. I remember that before reinstalling OS this dialog looked different. There was the button "Details" and I could see full exception stack without running debugger. What settings should I change to get such dialog?
Palestine
|
|
|
|
|
We are currently moving from .Net 1.1 to .Net 2.0. We are using an external DLL provided by a hardware supplier. This DLL is written on .Net 1.1. I now want to port it to .Net 2.0 but I don't have source codes so I cannot recompile it (I tried decompiling but the generated code won't compile). Is there a tool or something that can directly port the DLL to 2.0 so that it is all .Net 2.0 based?
Palestine
|
|
|
|
|
You don't need to recompile the DLL to get it to run on .NET 2.0, it should do it without any extra work. Just import and use in your .NET 2.0 application.
WM.
What about weapons of mass-construction?
|
|
|
|