|
Oh, and... a few months ago I asked about it on MSDN and Jon Skeet said he'd ask whether or not an enum constraint might be in the future, he later reported... "maybe". I suspect there are a lot more important things concerning them.
I think maybe we should start a letter campaign.
|
|
|
|
|
PIEBALDconsult wrote: I asked about it on MSDN and Jon Skeet said he'd ask whether or not an enum constraint might be in the future,
Ohh, so what could replace enums ?
Jon Skeet - I love that guy. He got indepth knowledge on the subject and very helping too. He has a book out "C# in Depth". I got a copy, it's worth reading.
|
|
|
|
|
I meant it's possible that a future C# compiler will allow where T : enum
I'm not holding my breath, but apparently the team who can make it happen know there's some demand for it.
|
|
|
|
|
PIEBALDconsult wrote: I meant it's possible that a future C# compiler will allow where T : enum
I misunderstood you, now it's clear.
PIEBALDconsult wrote: know there's some demand for it.
Yeah. Let's hope it would come in the future versions.
|
|
|
|
|
I had a third party dll on which COM interoperability was not built in. I wrote my own C# dll which provided the wrappers for the functions inside the third party dll and in my dll, I added COM interop. My C# dll works fine if I use it in a C# application but whenever I call it from C++ using COM pointers, then no statement in the function is executed if that function uses any component inside third party dll.
In the following code, not even the messagebox will pop up which means as if the function is not even called. But if I remove, the last two lines of code, then messagebox will properly pop up.
<br />
public void MyDllFunc()<br />
{<br />
MessageBox.Show("Inside MyDllfFunc");<br />
<br />
ThirdPartyDllClass service = new ThirdPartyDllClass ();<br />
service.DoSomething();<br />
}<br />
It seems that if I am using a main dll which internaly uses some other dll, then both dlls should support COM interop if i want to make the main dll COMVisible.
Any ideas/suggestion/advice?
For COM interop, I am generating a tlb using regasm and then importing that tlb in my C++ application. Is there any other way through which I can achieve calling the third party dll from my C++ application?
Thank you.
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|
|
Hi everybody
I developed a web application project in C# involving a method, named run(), being called when a button, named "Go", is clicked.
The "run()" method takes some time to be executed. So I want to use a "PLEASE WAIT" swf file, named "PleaseWait.swf" while processing.
It is binded by a flash control dll, named "flcontrol" The Code belonging "Go" button looks like this:
protected void Go_Click(object sender, EventArgs e)
{
flcontrol.play=true;
run();
}
The problem is there that flcontrol plays right after "run()" method gets completed.
I also used "response.flush()" method before "run()" but nothing happened.
What should I do???
Tnx in forward
|
|
|
|
|
Your problem is that you are trying to play an animation on a page that doesn't exist yet.
Flushing the response doesn't help either. When the button events are executed, the rendering of the page hasn't been done yet, so there is nothing to flush.
You have two options if you want to play the animation while the server code runs:
1. Start the animation before the postback, using client code.
2. Start a separate thread for the run method, so that the thread creating the page can complete and send the page to the client. This of course means that you can't put anything in the page from the run method, as the page has already been sent.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi All,
I am creating plugin for Visual stdio 2005. After performing steps for registering plugin for VS2005 and starting new instance of VS2005 , I got error message as problem in loading plugin. Invalid text is found in line 1.
thankns
A
|
|
|
|
|
I am consuming an XFire Java Web Service from c# using WCF.
It is all working fine for fields that are elements in the wsdl, however there is one field that is an attribute and this never gets set on the client side. The Reference.cs has fields mapped thus:-
/// this is an element and works fine
[System.Xml.Serialization.XmlElementAttribute(Order=14)]
public string type {
get {
return this.typeField;
}
set {
this.typeField = value;
this.RaisePropertyChanged("type");
}
}
/// this is an attribute and fails : (
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
public long id {
get {
return this.idField;
}
set {
this.idField = value;
this.RaisePropertyChanged("id");
}
}
I know that the attribute is being set by the server as the method works fine in our java app, returning xml like this
<soap:Envelope>
<soap:Body>
<ns1:getFolderStructureResponse>
<ns1:result>
<folders>
<folder id="1">
<children>
<folder id="427">
<children/>
<copyId>18904</copyId>
<createdBy>203</createdBy>
<type>user</type>..... etc.
Any idea what might be going wrong?
|
|
|
|
|
OK this seems to be working now : )
I changed this
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
to this
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
So it seems that Qualified is referring to explicitly setting the namespace on an attribute.
|
|
|
|
|
How to write the SQL DB connection string in namespace file.Then i wanna add that connection string like "using DBconn;" <<DbConn should be connection string>>
If you know that how to write DB Connection string using webconfig file also welcome.
BD is MSSQL 2005
Programing language : C#
Web development using ASP.Net
If some one know please reply me
Thank you..!!!
ReGRdZZZ
CheeN
|
|
|
|
|
SQL and Database Discussion forum
|
|
|
|
|
Hi, I want to ask a question about bitmap constructor(Image, Int32, Int32).I know that the three arguments 'Image','Int32' and 'Int32' are filled by original image, integer number and integer number respectively. In my application, I write my code like this:
Image image = new Bitmap(originalImage, integer number,integer number)
But after I run the application, the system give me an error like the bitmap first argument where I wrote originalImage should be integer. So can somebody tell why?
Thank you very much~!
|
|
|
|
|
Without a specific error, no one will know...
|
|
|
|
|
specific error?Didn't I describe my problem clearly?The problem I encountered in my program was:
I wrote a code like this:
Image image=new Bitmap(originalImage,originalImage.Width+changedSize,originalImage.Height+changedSize)
When I ran the application, the system gave me an error message like: 'Argument 1' cannot convert 'System.Drawing.Image' to 'int'. 'Argument 3' cannot convert 'int' to 'System.Drawing.Image.PixelFormat'.
Can anybody tell me why?
Thank you~!
|
|
|
|
|
kevinlin_5 wrote: the system gave me an error message like: 'Argument 1' cannot convert 'System.Drawing.Image' to 'int'. 'Argument 3' cannot convert 'int' to 'System.Drawing.Image.PixelFormat'.
Thank you, that is a proper error message, not a vague error description.
But I dont really know why! From what I can deduce, everything looks ok, but I will just make a quick sample when I get to work.
What version of .NET are you using?
|
|
|
|
|
I am using .NET 2.0.
Thank you very much for your kind helping.
|
|
|
|
|
Because you have written something as the second and third parameter that is so incorrect that the compiler can't even determine the type of it, so the compiler is using the overload of the constructor that seems closest, and that happens to be an overload where the first parameter is an integer.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have reviewed my errors, I think it's because the compiler treat my constructor as (Int32, Int32, PixelFormat), so it gave the error. So can you tell me how did the compiler know what constructor it is?Is there any pre-defined code?
Thank you~!
|
|
|
|
|
The compiler determines what overload to use by the type of the arguments.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi i create a class and i want to create the array of the object but the array would not be fix it can be vary due to some conditions
wasim khan
|
|
|
|
|
Since an array is initialised with a fixed length you want to be looking to use a variable length object. The best way to do this would be to use a generic List which contains instances of your class.
E.g. if your class is called MyClass
using System.Collections.Generic;
List<MyClass> myList = new List<MyClass>();
MyClass c1 = new MyClass();
myList.Add(c1);
HTH
It definitely isn't definatley
|
|
|
|
|
Preview your posts after you post them. Obviously you didnt, as you would have realized the generics got swallowed by the HTML.
|
|
|
|
|
Yeah I always forget about that... Edited to display properly now.
It definitely isn't definatley
|
|
|
|
|
hi all,
actually we developed windows application using (Visual Studio 2008 C# & LINQ and sqlserever 2005 express edition).and i have to create setup and deployment for this project. i was added new project as "setup and Deployment" for my windows project .And i also included all the prerequisites to my project.exe layer.but main problem is "How can i deploy the database in Client machine ".
i tried this in client Machine :
it was installing All the Prerequisites in Client machine ,it was runnig succcesfully ,but it was showing "user is not trusted user" ,How can i solve this ,could u please help me,and i was strucking from last 3 weeks.
i got the below error:
============================
Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.
<configuration>
<system.windows.forms jitDebugging="true"/>
</configuration>
When JIT debugging is enabled any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.
=============================
Thanks in advance.
|
|
|
|