|
I'm not sure what RecreateHandle(); is pointing to for the OnMove override but it seems to me that overriding the OnPaintBackground method and not calling the original Base.OnPaintBackground should case the application to just not ever paint the background. Is that what you're wanting?
|
|
|
|
|
Thanks again but i figered out what the OnPaintBackground was doing for the program as that was my first route of enquiry when trying to pull this off.... BUT on its own it just leaves the background as a black void.... it was the two other elements that where puzzling me as they seem to make it work but i just dont know why
|
|
|
|
|
I need assistance tring to login to a webpage using C#
the link flirt.canoe.ca for starters.
Anyone able to assist me with this? Thanks
-- modified at 21:46 Sunday 9th October, 2005
|
|
|
|
|
Hi,
Is anyone can help me, I written a code in C#, convert it in DLL and create COM wraper so I can use this to my MS Application. Apparently it does not work. I tried this simple program, but it does not work when i call it to MS Access
****************************
using System;
using System.Runtime.InteropServices;
namespace Tester
{
[Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _Numbers
{
[DispId(1)]
int GetDay();
[DispId(2)]
int GetMonth();
[DispId(3)]
int GetYear();
[DispId(4)]
int DayOfYear();
}
[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Tester.Numbers")]
public class Numbers : _Numbers
{
public Numbers(){}
public int GetDay()
{
return(DateTime.Today.Day);
}
public int GetMonth()
{
return(DateTime.Today.Month);
}
public int GetYear()
{
return(DateTime.Today.Year);
}
public int DayOfYear()
{
return(DateTime.Now.DayOfYear);
}
}
}
******************************
regards,
edwin
|
|
|
|
|
I'm looking for a function to check if 2 lines intersect.
There are a few key factors to this.
The project I am working on involves navigating around polygons by moving from vertex to vertex, but only to vertex's it can move in a straight line to without intersecting other lines. I've found a few functions online, except they always find an intersection ON the vertex, which I can't have, and they find an intersection when moving from 1 vertex to the other on the same polygon, parallel lines, which is an allowed move.
Thanks
Note - The project involves the intersect check, but that isn't the project, the project is to test AI algorithms to compare the results.
(he's provided some Dr. Scheme code http://skipjack.cs.wwu.edu/~gmatth/index.html that does it, that I can't quite figure out how to convert to C# though I know the function I need to translate is (define intersect-lines?)
The wisest of the wise may err. - Aeschylus
Codito Ergo Sum - (I code, therefor I am)
-- modified at 19:32 Sunday 9th October, 2005
|
|
|
|
|
let's call your segment AB and CD, and let's use underline as vector notation.
let's compute intersection!
you should solve a & b so that
A + a AB = C + b CD
=>
a AB - b CD = C - D = DC
very simple a * Num1 + b * Num2 = Num3 set of equations. In N dimensional space (N>2) it might have no solution (=> no intersection).
and now, the segments (instead of just the line) intersect if
0 <= a <= 1 && 0 <= b <= 1
Next time try not to sleep during geometry lesson....
(You could sleep during philosophy lessons, instead )
-- modified at 20:27 Sunday 9th October, 2005
|
|
|
|
|
How are you all in this great and awesome website for microsoft developers.
I need to know a way to convert my C# code into its equivalent .Asm file and hexidecimal format and store it in .Hex file any one knows how to do so ? is there any class or any win32 function to do so ?please refer to me please.
Miss With The Best And Die Like The Rest
|
|
|
|
|
No there isn't. C# never compiles to .ASM code. It compiles to MSIL only. The MSIL code is compiled into native processor code (or ASM if you wish) on-the-fly, when it is called. There is no application (AFAIK) or API function that will do what you want. I don't see what use this could be, so it begs the question, why would you want to do this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how are you my friend i just want to do so in robotics.
My friend . i have one more question?
If you clicked start----> run and you typed the command
ymsgr:sendim?matrix_623
if your messenger is already open it will open for you a private chat window?
My question is how could this be done? how can i add my own shell command ? i know may be through registry but which one and how ?
Mess With The Best And Die Like The Rest
|
|
|
|
|
snouto wrote:
i just want to do so in robotics.
Then use a language more appropriate for the hardware controller that is manipulating the machine. C# will not compile down to what you want.
snouto wrote:
If you clicked start----> run and you typed the command
ymsgr:sendim?matrix_623
if your messenger is already open it will open for you a private chat window?
Your application must be able to detect that it is already running (search the articles for "single instance application"). Also, your application must expose an interface so a second instance of your app that gets launched can pass parameters to the first instance. Just search the articles and you'll find a few examples.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It's Mess with the best,... And not Miss...
|
|
|
|
|
Hi everyone,
this is not really a programming question, but as I made some thoughts about cloning my objects I had an idea and just want to hear some comments on it.
Normally when a class should be cloneable it implements ICloneable like this:
public class TestClass : ICloneable {
public object Clone() {
}
}
The nasty thing about this is that everybody who calls Clone will have to do a cast afterwards (assuming the caller wants to do something with the result where object doesn't help).
Do avoid this one could just forget ICloneable and make a typed Clone method:
public class TestClass {
public TestClass Clone() {
}
}
Sadly this isn't an option for me because at some places in my code I have an ArrayList which holds objects of several different classes which I all have to clone.
So I came to the idea to instead combine the two methods and do the following:
public class TestClass : ICloneable {
object ICloneable.Clone() {
return this.Clone();
}
public TestClass Clone() {
}
}
So now when I use a variable of type TestClass the Clone method will return TestClass, but I can use it also as an ICloneable where I get an object (Truly also having the type TestClass but unknown to the caller).
So what are your thoughts about it? I think this casting problem when using Clone is relatively widespread, but why is everybody using (I refer to the framework and some 3rd party components) just the naiv method?
PS: Why is the result of ICloneable.Clone an object and not ICloneable? I thought the intention of this interface was that the result should be some kind of deep copy of the object and should always have the same type...
-- modified at 15:56 Sunday 9th October, 2005
|
|
|
|
|
If only C# supported Covariant[^] return types, then your problem would go away. You'll be able to return TestClass and still implement ICloneable.Clone.
Robert Rohde wrote:
Why is the result of ICloneable.Clone an object and not ICloneable? I thought the intention of this interface was that the result should be some kind of deep copy of the object and should always have the same type..
ICloneable.Clone clones an object, so why should it return ICloneable?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello,
i have a problem with my dialogs. When i create a new dialog i use the methode form2.Show(); But when i close the old dialog what was created before the form2 dialog, the form2 dialogs also closes?
how can this be fixed?
greetings
Sander
|
|
|
|
|
This is happening because you closed the startup form for your application.
For example, the common misconception is that a splash screen can be the startup form for an application. You can't do this. When the startup form closes, it takes the application's message pump with it, closing down the entire application.
The startup form of your app should be the main form your application uses for the builk of it's user interface. Any other forms are created, in a heirarchy, from this form and displayed. You can NOT transfer the application's message pump from form to form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can i start the new form as a new application then because that is what i want then.
greetings
Sander
|
|
|
|
|
This[^] might help you out. Just remember to change the startup type in your project properties to Sub Main, instead of whateverForm.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You need to run the message pump for the other dialog on a separate thread. Something like
void ShowSecondDialog()
{
new Thread(new ThreadStart(RunMessagePump)).Start();
}
void RunMessagePump()
{
Application.Run(new Form2());
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
I have just started to learn c# and I need to write a program that gets the factorial of a number using a "for" loop. Could anyone help me as i'm having a hard time trying to write it.
thanks
|
|
|
|
|
Sounds like homework... but I think I have a good day...
public long Factorial(long number) {
long result = 1;
for (int i = 2; i <= number; i++)
result *= i;
return result;
}
|
|
|
|
|
how sad
|
|
|
|
|
I have made a C# .NET 2002 based exe which I want to run at the startup of system which is Windows 98 based. Now I added the exe name in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run so that it could be run whnever the system starts.
This exe is supposed to run a batchfile (which is placed in the same location where the exe is) as the exe starts running. Now I tested it in the debug mode and it works fine (i.e properly runs the batch file in new process ) but whn this exe is executed frm startup the exe starts running but can't run the batch file.
Can anyone tell me what wrong I am doing. Do I have to set the directory name of this exe in the registry or what?
Thanks
Bilal
Bilal Farooq
|
|
|
|
|
Without seeing your code, it's a little difficult to tell you what you're doing wrong. But, I can take an educated guess at it.
The standard problem with this is that you're not using a fully qualified path to find the file you're trying to run. You're probably just specifying something like myBatchFile.bat , assuming that that file will be in the current directory. This is almost always the case and a very bad assumption to make. You show never assume that the current directory is whatever you think it is. Instead, always(!) build a complete path to to the file you want, then use that full path in your command line that you want to execute.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here's some code:
void DrawLine(Graphics g)
{
Pen p = new Pen(Color.Blue, 2);
p = c_xy.GetNextPen(); //returns an index of an array of Pens in
//a generic class, (i.e. Pen p1[0]..)
//different Color, different Font
g.DrawLine( p, x1, y1, .....)
How can I draw a line with an arrow or triangle on the end so that it
is obviously visible, that is it looks like an arrow on the end of a line
and not a "sharpened pencil".
I've read a bit of the MSDN and messed around with some code but can't seem to sort out this LineCap/Arrow/Triangle stuff. Not very clear to the novice...thanks
|
|
|
|
|
Hi again,
if the predefined LineCap constants are too small for you, then you can define a CustomLineCap (namespace System.Drawing.Drawing2D) by yourself. There is already one implementation in the .Net framework which draws an arrow of selfdefined size.
So when you create your pens instead of assigning the EndCap/StartCap properties do the following:
pen.CustomStartCap = new AdjustableArrowCap(10, 10, true);
pen.CustomEndCap = new AdjustableArrowCap(5, 5, true);
Don't forget: using System.Drawing.Drawing2D;
|
|
|
|