|
If the method always creates a new array, it's better to make the method return the array instead:
this.allocGrading = this.SetupStageAllocation();
private Control[] SetupStageAllocation() {
Control[] controlArray;
controlArray = new Control[numStages];
return controlArray;
}
---
b { font-weight: normal; }
|
|
|
|
|
I agree with Guffa. If you start getting used to passing by reference all over the place, it will soon get out of hand.
Matt Gerrans
|
|
|
|
|
Hi
Im trying to find information about how to implement a massemailer. I've got a site that needs to be able to send out alot of emails (not spam). My current solution works for 400 recipients but more than that it starts to freak out. Been thinking of splitting the recipients into various groups and have threads sending them out, but I really doesnt know where to start here.
Do you guys/girls out there have any information on where to find a tutorial or something similiar regarding this kind of email stuff? Buying is also an option if the product is fairly cheap and good.
|
|
|
|
|
Hi,
I get error
"Couldn't get process information from remote machine" when i try to run Process.GetProcesses().I understand that this is because i dont have administration rights.How can i solve this problem.Is there a way where in i can give some permissions to the user to execute that part of code alone.
Hope to get replies soon.
Thanks
|
|
|
|
|
I don't think so. You could try building that functionality into a seperate program, then launch that program with Administrative permissions (provided either you know an admin's name & pass, or the user fills it in for you).
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Who is Jewish, the Trivia Game!
Judah Himango
|
|
|
|
|
I guess i havent explained the case properly.
I have a program where i try to get the processes running in the machine through GetProcesses().I connect to a remote machine using a user who doesnt have admin rights.When i run the program from the remote machine i get error saying "Couldn't get process information from remote machine" additional info :"Access is denied". I cannot give admin rights to this user but i stil want the program to return me the processes through GetProcesses().Is there a way to give access permission through the code , such that i get the processes even though the user does not have admin rights.
thanks
|
|
|
|
|
Menu Item names are directly coming from the database and i want to attach menu item with the event handler names.
so i name event handler as "handle" + item.name(value from database) + "click".I want to attach it dynamically.
the code is as follows
//sample code
public class myclass
{
protected void Handle_FileMenuItem_Click(System.Object sender, System.EventArgs e)
{
}
public bindeventhandler()
{
string dynamiceventhandler="";
dynamiceventhandler="Handle_" + item.Name + "_Click";
Delegate temp=Delegate.CreateDelegate(typeof(EventHandler),this,dynamiceventhandler);
item.Click+=(EventHandler)temp;
}
}
The code is throwing error. Error binding to target method.
Can anyone pl explain how to solve this error...
i got the idea from this url
http://www.dotnet247.com/247reference/msgs/21/106638.aspx
|
|
|
|
|
Hi,
I tried your provided code and it works just fine. Did you verified that the value of item.Name is e.g. FileMenuItem?
Do you have a target method for all items that wil be binded ?
Regards
Sebastian
|
|
|
|
|
Can anyone tell me or show me how can i delete a virtual directory from IIS, urgent
thanks
Regards,
Luke
|
|
|
|
|
How about right click, select delete.
|
|
|
|
|
The IIS control - you can find it under the "Administrative Tools" of the PC / server where the IIS is hosted....
"He that is good with a hammer tends to think everything is a nail." - Abraham Maslow
|
|
|
|
|
Programmaticly i meant,
If not programaticly i wouldnt have posted it on the C# forum innit?
Regards,
Luke
|
|
|
|
|
Hello, I'm trying to access a DataTable from a Typed Dataset through Remoting but when I call my method it throws the follow exception:
[SerializationException] The constructor to deserialize an object of type
TBPerfilDataTable was not found.
But, when I try to return the full filled typed dataset it works... It only doesn't works with DataTables.
Any idea?
Wender Oliveira
.NET Programmer
|
|
|
|
|
Hi Wender,
I'm not really sure if the TBPerfilDataTable class needs to have a default constructor (without any parameters). If I access an object using serialization (e.g. by using a WebSerice), the serialized class always needs a constructor without parameters.
Is your datatable marked as serializable ?
Regards
Sebastian
Trying to be a .NET Programmer
|
|
|
|
|
Sebastian, thanks for your attention
First it throws an exception about Serializable Attribute not found, so, I marked all my datatable classes as [Serializable()]. Then, I tried again and got that exception. I tried to reimplement ISerializable interface but I didn't understande how to do this.
Wender Oliveira
.NET Programmer
|
|
|
|
|
If you are deriving from the DataTable class, then you must add the following code
protected MyDataTable(SerializationInfo info, StreamingContext context):base(info, context)
{
}
|
|
|
|
|
Thanks, I didn't try but it seems to work.
I did an workaround and now works...
Tks...
Wender Oliveira
.NET Programmer
|
|
|
|
|
Hello,
I've been programming a C# game engine, mainly just for fun and learning purposes. The project is going very well and i've learned alot seeing as this is my first time working with DirectX, but even though the project is going well i continuously run into the same problem.
I'm building my Engines around the idea of an RTS game and i have 3 seperate engines. The Game Engine(master) and then 2 lower engines the Sprite Engine(DirectDraw) and my Object Engine(Manages Units).
Since i'm still testing things there are times when there are no units on the screen. If this happens and i don't have any debug information being drawn then it begins to lag extremely. Its obviously hard to tell whats going on because it only does it when theres a blank white screen displayed, but i first noticed it in how laggy the responses are in the keyboard.
I'm at a total loss as to why giving DirectX nothing to do would lag my program? any ideas?
Heres a segment of my code from the Sprite engine that actually draws stuff on the screen:
back.ColorFill(Color.White);<br />
<br />
for (int i=0; i <= AnimQPt; i++)<br />
{<br />
for (int z=0; z <= AnimQ[i].spriteCluster.TotalSprites; z++)<br />
{<br />
back.DrawFast(AnimQ[i].spriteCluster.sprites[z].point.X, AnimQ[i].spriteCluster.sprites[z].point.Y, Models[AnimQ[i].intModelID].Sprites[AnimQ[i].spriteCluster.sprites[z].SpriteID].SpriteSurface, AnimQ[i].spriteCluster.sprites[z].rectangle, DrawFastFlags.SourceColorKey);<br />
}<br />
}<br />
if (bObjectNumDisplay)<br />
{<br />
for (int i=0; i <= AnimQPt; i++)<br />
{<br />
back.DrawText(AnimQ[i].pointDisplay.X, AnimQ[i].pointDisplay.Y, AnimQ[i].intUnitID.ToString("N0"), false);<br />
}<br />
back.DrawText(10, 10,"ScreenWidth = " +Screen.Width.ToString()+ " ScreenHeight = " +Screen.Height.ToString()+ " XPos = " +AnimQ[0].pointDisplay.X +" YPos = " +AnimQ[0].pointDisplay.Y +" Current Point = " +this.AnimQ[0].spriteCluster.sprites[0].rectangle.ToString() + " ElapsedTime = " +this.AnimQ[0].pointDisplay.ToString(), false);<br />
}
The variable AnimQPt would normally be -1 if there are no units on the screen.
|
|
|
|
|
How are you rendering the scene - a OnPaint->Invalidate() call (thus making OnPaint be called over and over again)? If so, that could be a cause of your problems; doing OnPaint and Invalidate is extremely inefficient, lots of overhead. It wasn't meant to be used in this manner.
Check out Managed DirectX creator Tom Miller's blog posting here[^] regarding the best, most efficient way to render your scene.
The other possibility is that you're doing something too heavy; too many allocations, too much drawing to the screen, too many garbage collections going on. It's tough to say without a knowledge of the codebase.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Who is Jewish, the Trivia Game!
Judah Himango
|
|
|
|
|
Dear Gurus,
I have the following problem (reduced from more complicated stuff):
I want to process different types of data in a class (in the example I simply store the data).
The problem here (in C#) to my best understanding is, that I have to write an extra function for each data-type. This can be much more easily managed in C++ via Templates.
How do I manage such a problem in C#?
Class-Example:
public class Action {<br />
<br />
public void storeValue(int i) { m_intValue = i; }<br />
public void storeValue(char c) { m_charValue = c; }<br />
public void storeValue(double d) { m_doubleValue = d; }<br />
<br />
private int m_intValue;<br />
char m_charValue;<br />
double m_doubleValue;<br />
}
Thank you for your help
|
|
|
|
|
Hi!
Either you use .NET 2.0, where a template system is supported, or you use public void storeValue(object o) and sacrifice type-safety.
Nevertheless, you can query the real type of the object passed to your function using the typeof or is operators.
Regards,
mav
|
|
|
|
|
hi to all,
how do i go about implementing remoting using SSL sockets?. i have googled for SSL sockets + C# and im getting alot of middleware and 3rd aprty products. is it possible without these, or is it just harder
links to learn from would be good, or msdn docs too.
kind regards,
g00fy
Ethical axioms are found and tested not very differently from the axioms of science. Truth is what stands the test of experience.
Albert Einstein
|
|
|
|
|
|
thank you kindly
g00fy
|
|
|
|
|
hi
i am mukesh
i want zip and folder through coding zip on client and unzip on server
mukesh
|
|
|
|