|
Can we do polymorphism on event handlers
in the event handler the default parameters will be sender and e. Can i add more parameters to that ?
regards
hari
|
|
|
|
|
Not unless the delegate has extra parameters
only two letters away from being an asset
|
|
|
|
|
If I understand your question
No you cannot add extra parameters to system event handlers such as OnPaint or OnsizeChanged but you can on custom event handlers by adding extra parameters to the delegate.
Everybody gotta be somebody
|
|
|
|
|
Hi All,
I need to copy a subsection of an array to a List<>.
The only way i've found of doing this is to create a temporary array and do an Array.Copy(), as below:-
MyType[] srcArray = FillUpMySourceArray();
List<MyType> dstList = new List<MyType>();
int srcDataOffset, srcDataLength;
MyType[] tmpArray = new MyType[srcDataLength];
Array.Copy(srcArray, srcDataLength, tmpArray, 0, srcDataLength);
dstList.AddRange(tmpArray);
I don't like the use of Array.Copy. Surely there's a better way?
Jon
|
|
|
|
|
I think this should work:
dstList.InsertRange (srcArray.Length, srcArray); /ravi
|
|
|
|
|
Hey guys.... I don't really know how to create a wrapper..... but I'd like to.
Anyhow, I'm writing a program in Visual Studio 2003, and I need access to a .NET 2.0 class. If I try to reference a .NET 2.0 assembly (dll) in Visual Studio 2003, I get the following error:
A reference to "C:\Slatesoft Development\utils.dll" could not be added. This is now a valid assembly or COM component. Only assemblies with the extension "dll" and COM components can be referenced. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
Any help would be great. Thanks.
|
|
|
|
|
You can't use 2.0 assemblies in VS 2003
only two letters away from being an asset
|
|
|
|
|
Okay, I figured that's what the problem was.
Is there any way to create a .NET 1.1 wrapper for the .NET 2.0 class?
|
|
|
|
|
No. YOU CAN NOT USE 2.0 CODE IN 1.1 ASSEMBLIES.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
But, isn't there a way to use 2.0 code in 1.1 assemblies?
|
|
|
|
|
I am trying to change the tab name when i open a excell spread sheet on the run time in c#.
I changed it in the code:
Response.AddHeader("content-disposition","filename=" + sFileName + ".xls");
But it works only on save mode but on the display mode still display the name of the page i am calling this excell spread sheet, in other words i see Ratings.aspx in url and in the tab name of this excell spread sheet. I need the name i assigned in the Response.AddHeader(..)
Thank you in advence.
Greg
|
|
|
|
|
When you inherited from a base case do you ALWAYS inherit all the functions and variables of the base class? I.e. If a base class has hundreds of variables and hundreds of functions do you inherit them all even if you don’t need them?
Thanks in advance.
Rapier503
|
|
|
|
|
You inherit them, but can only access the public, protected ones.
|
|
|
|
|
Kind of what inheritance is all about.
only two letters away from being an asset
|
|
|
|
|
Rahithi wrote: if not forget about my answer
How about you just delete it, since it is wrong.
only two letters away from being an asset
|
|
|
|
|
Thanks for correcting me
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hello,
I created a compiled c# dll. I need to know the path where this dll resides. I use this code to do it...
mstrStartUpDirectory = System.IO.Directory.GetCurrentDirectory();
When I call this dll from a c# windows app i get the correct path that the dll is in (C:\roto\Practice\MyClass)
When I call this dll from a c# web service i get the WRONG path that the dll is in (C:\Windows\System32).
What do I need to do to get the correct path that the dll resides in regarless of wether I am calling the dll from a Windows app, web service or whatever.
Thanks in advance
-Roto-
|
|
|
|
|
string path = System.Reflection.Assembly.GetExecutingAssembly().Location
|
|
|
|
|
This isnt working either. This returns the path to the .net framework. I want the path to the dll I wrote. I apprieciate your trying though.
|
|
|
|
|
have you tried finding the location of the object in the DLL?
Something like:
typeof(MyClassName).Assembly.Location
|
|
|
|
|
You're right. That's because the your web service is hosting the dll you wrote. Depending on what you're trying to do, one option is using your web service configuration file to store path information.
|
|
|
|
|
Well, I gave up and decided to just pass the path to my dll when I create an instance of it in my web service using this....
strDllPath = System.Web.HttpRuntime.BinDirectory.ToString(); //this is code in my web service
I'll try that typeOf suggestion.
Thanks for the help.
|
|
|
|
|
Hello,
I didn't see a forum specific for Visual C# so I am asking this question here.
I am getting the following error when compiling:
"The following module was built either with optimizations enabled or
without debug information:
myfile
To debug this module, change its project build configuration to
Debug mode..."
I am using Visual C# 2005 Express and when I compare the build options tab under the project's properties to the options presented in the link below
http://msdn2.microsoft.com/en-us/library/027febhz(VS.80).aspx[^]
The build tab in Express doesn't have the "Configuration" list mentioned in the above link.
Can someone point me in the right direction to configuring the build process in Express to allow "Debug Mode"?
Thanks in advance,
Eric
|
|
|
|
|
Beringer wrote: I didn't see a forum specific for Visual C# so I am asking this question here.
This is the C# forum.
Beringer wrote: The build tab in Express doesn't have the "Configuration" list mentioned in the above link.
Is there not a drop down on the menu bar with Debug and Release options in them? (and possibly others if you set them up, but that's doubtful if you are asking this question). Change the value of that drop down so it says Debug. Then rebuild your solution.
I don't have C# Express in front of me so I can't see exactly where things are (it might be moved from other Visual Studio editions)
|
|
|
|
|
Thanks for the response.
I suppose I should have said no forum for the Visual C# IDE .
I have two drop down's on the menu bar with the following tool tip text:
"Solution Configurations" and "Solution Platforms". The Configurations one seems like the right one but I can't findout. Both drop down's are disabled and I can't find out how to enable them.
I should also add that this "Debug" issue only occurs in a project I imported into my solution and didn't write from the begining. All the other projects in my solution seem to generate debug code because when I use those modules I can actually use the debuger with them and I don't get he warning mentioned earlier.
Thanks in advance.
|
|
|
|