|
To copy a site, you also need to copy the binary, and to reset the folder in IIS.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi,
Can you tell me in more details.
Thanks!
|
|
|
|
|
Hi,
That is good. Can you please tell me in more details.
|
|
|
|
|
What do you need to know ? Do you know how to use IIS ? Do you know what IIS is, or has the IDE just set that stuff up for you ? Or are you using one of the newer versions with a web server built in ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi friends,
I wish to create a playing kit for kids ..
One of it includes, to design many boxes like what we have for "Match the following" in our academics....
In Box1---B,F,L,P,D...(jumbled alphabets)
In box2---Lamb,Dog,Box,Fish,Peacock...(many words as match for the jumbled alphas)..
Kids have to match the alphabet to the right word using a line drawn when they drag items and match as wat we do in defining relationship diagram ib Access....
Could anyone help me in doing this?
Thanx.....
|
|
|
|
|
If you look for Doodle, you'll find a GDI+ paint program I wrote here on CP. It shows how to do a line drawing tool, which is basically what you're talking about.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Chris,
The Url is not displaying the page...
Some error has occured....(i want in C#.NET)..
Kindly help me...
Thanx
|
|
|
|
|
Hai,
I need to do the actions when the mouse is down or up or moved....
How can i call the painteventargs in the Mouse events?
Kindly help .....
|
|
|
|
|
hi!
you just call the Invalidate method. this will force the control to repaint.
hope that helps!
|
|
|
|
|
thanks friend,
It works....
I need another help..A line is drawn for matching and then when i try to draw another line sustaining the previous drawn line too,its not working..
When i draw another line,the previous line vanishes....
Help me...
Thanx again..
|
|
|
|
|
your welcome!
sorry but it's not that clear to me...
can you include the code for drawing the lines so i can check where the error is?
thanks!
|
|
|
|
|
Hi friend,
this is the coding...Wht i mean is,first i draw a line.the when i use the mouse to draw another line ,first line vanishes...
This is the problem...Help me.
<br />
public void OnPaint(object sender,PaintEventArgs e)<br />
{<br />
Graphics g=this.CreateGraphics();<br />
Pen pen=new Pen(Color.Magenta);<br />
Point p1=new Point(index1,index2);<br />
Point p2=new Point(index3,index4);<br />
g.DrawLine(pen,p1,p2);<br />
this.ResetMouseEventArgs(); <br />
}<br />
public void mouseUp(object sender,MouseEventArgs e)<br />
{<br />
index3=e.X;index4=e.Y; <br />
this.Paint+=new PaintEventHandler(this.OnPaint); <br />
Invalidate();<br />
}<br />
public void mouseDown(object sender,MouseEventArgs e)<br />
{<br />
index1=e.X;index2=e.Y; <br />
}<br />
|
|
|
|
|
i try to run what you've got and figured out what the cause of your problem...
It's because you didn't store the previous lines coordinates to a collection or array.
and because you call the Invalidate method,this will repaint the whole control that means it will clear all what you've drawn before.
so my solution was to put the coordinates in an arraylist and loop it on the OnPaint method. i used this on a simple form and it works fine.
here's the code
<br />
private ArrayList m_arlPoint1 = new ArrayList();<br />
private ArrayList m_arlPoint2 = new ArrayList();<br />
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
base.OnPaint(e);<br />
<br />
Pen pen=new Pen(Color.Magenta);<br />
Point pt1, pt2;<br />
for (int i = 0; i < m_arlPoint1.Count; i++)<br />
{<br />
pt1 = (Point)m_arlPoint1[i];<br />
pt2 = (Point)m_arlPoint2[i];<br />
e.Graphics.DrawLine(pen, pt1, pt2);<br />
}<br />
<br />
}<br />
<br />
<br />
protected override void OnMouseUp(MouseEventArgs e)<br />
{<br />
m_arlPoint2.Add(new Point(e.X, e.Y));<br />
Invalidate();<br />
}<br />
protected override void OnMouseDown(MouseEventArgs e)<br />
{<br />
m_arlPoint1.Add(new Point(e.X, e.Y));<br />
}<br />
<br />
hope this will solve your problem!
|
|
|
|
|
Thanks a lot for ur timely help...
Sorry for disturbing again and again...
But if i override the mouse events...Foll error is displayed
..Projects\WindowsApplication2\WindowsApplication2\Form1.cs(150): 'WindowsApplication2.Form1.mouseUp(System.Windows.Forms.MouseEventArgs)': no suitable method found to override
...Projects\WindowsApplication2\WindowsApplication2\Form1.cs(157): 'WindowsApplication2.Form1.mouseDown(System.Windows.Forms.MouseEventArgs)': no suitable method found to override
How to overcome this?(eventhandlers for these events needed?)...
|
|
|
|
|
Oh Sorry friend...
It really works superbly...
Thanks a lot....Since am new to graphics i couldnt things things easily...
Now i can....
Another kind help...Cud you tell me any site for learning graphics deeply....
Am much interested in it...
Thanx....
|
|
|
|
|
that's ok.
sorry but i have no particular site to recommend because when i have problem re graphics i just search in the msdn, google, codeproject and other .net forums.
you can use GDI+ as your keyword for searching.
|
|
|
|
|
that's ok. no problem!
maybe because you just added the override keyword on your mouseup and mousedown method. try to rename these methods to OnMouseUp and OnMouseDown and remove the "object sender" parameter. or the easiest way is to copy and paste the code i'v given to you.;P
because override methods are only suitable for virtual methods of the base class(which on your part is the Control class).
if you want to see other overridable methods, just type "override " on your code editor and it will show you the list. and if you're not yet familiar with these keywords, try to read some articles bout this or search it to the msdn.
|
|
|
|
|
thank u very much....
I'll catch for further help(sorry ,but have to)....
Happy coding....
|
|
|
|
|
Hi, I want to pinvoke this function from an unmanaged dll. The unmanaged signature is this:
int QuickUsbFindModules(char *nameList, unsigned long bufferLength)
nameList - A buffer in which to store a QuickUsb module names found by the library. Must be large enough to contain all device names + 1 character.
bufferLength - The length of the nameList buffer in characters.
Here is C# dll import, is this correct given the above?
[DllImport("quickusb.dll", CharSet = CharSet.Ansi)]
internal static extern int QuickUsbFindModules([Out]StringBuilder nameList, int bufferLength);
Then I call QuickUsbFindModules with the following code:
public string FindDevices()
{
int length = 512;
StringBuilder name = new StringBuilder();
try
{
int result = QuickUsbFindModules(name, length);
if (result != 0)
{
return name.ToString();
}
if (result == 0 && name.ToString()=="")
{
return "";
}
}
catch (AccessViolationException ave)
{
LastError = ave.ToString();
return null;
}
return null;
}
Does everything look good here, or am I doing somthing bad?
/\ |_ E X E GG
|
|
|
|
|
|
I took it out, it still works. That's good!
Was the [Out] redundant or something?
/\ |_ E X E GG
|
|
|
|
|
I am attempting to bind the value in a database field "Custodian" to a textbox like so:
strColumnValue = "Tables[FormList].Rows[0].[Custodian]";
tbCustodian.Text = (string) DataBinder.Eval(ds, strColumnValue); // ds is my DataSet
The problem is that if the Custodian field contains a NULL, I get a "Specified cast is not valid" exception. I'd like to solve the problem by doing something like this:
if (Tables[FormList].Rows[0].[Custodian] == null)
{
strColumnValue = "";
}
else
{
strColumnValue = "Tables[FormList].Rows[0].[Custodian]";
}
However, this won't compile as I get an "Identifier expected" error at "[Custodian]". Does anyone know how I can do this? I know .NET 2.0 allows nullable types (e.g. string?). However, I have to work with 1.1.
Thanks!
|
|
|
|
|
You want to check to see if the row is equal to DBNull.Value instead of null.
if (Tables[FormList].Rows[0].["Custodian"] == DBNull.Value ){
strColumnValue = "";
}
else {
strColumnValue = Tables[FormList].Rows[0].["Custodian"];
}
|
|
|
|
|
That doesn't work. When I try to compile, I still get "Identifier expected" pointing to the first bracket ("]") that surrounds "Custodian." Does anyone else have any ideas?
|
|
|
|
|
One way to handle this is to convert the Custodian field's NULL value to an empty string in the SQL Server database instead of trying to do it in C#:
SELECT ISNULL(Custodian, '') AS Custodian
WHERE ...
|
|
|
|