|
Mtyb wrote: http://tempuri.org/
You must always change this. That's why it says 'temp' This will not fix your issue, tho.
Did you ever have a version that contained the hello world method and not the help method ? Have you tried deleting and recreating the reference ? Have you considered telling us what you mean by 'not accepted and not readed' ? Does it compile ? Does it not run ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Now its working good..Thanks!
How can i call a method in windows app from WebService..?
|
|
|
|
|
Mtyb wrote:
How can i call a method in windows app from WebService..?
There is absolutely no way to do that. The closest you could get, is to make a webservice call regularly to ask the webservice if it wants to prompt you to do something.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Ok..can u tell me how to connect WebApp with WinApp..sends paramters or call method in WinApp..????
Thanks
|
|
|
|
|
I expect you'd write an app on your server, and your client would connect to the server with TCP/IP to announce itself, and then the server could send back messages. Expect lots of grief from firewalls and anti spyware.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
It seems to me that Visual studio 2010 beta 1 is completely free?
is it right?
if so, then what is difference between Visual studio 2010 beta 1 and final version?
only some bugs or sth else?
thanks
|
|
|
|
|
Seraph_summer wrote: It seems to me that Visual studio 2010 beta 1 is completely free?
is it right?
if so, then what is difference between Visual studio 2010 beta 1 and final version?
only some bugs or sth else?
This is C# Forum. It would be better if you ask the Question on Visual Studio Forum[^] or at Loungh[^]
|
|
|
|
|
Apart from bugs, it will have a cut off date, after which it will stop working.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Christian Graus wrote: Apart from bugs
Is that in the release version or the Beta?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Yes, I was going to say, the big difference with release will be more bugs, but no time limits.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I am wondering how MS can let it stop working?
I mean if I download and install it, how MS control it? from internet? or from what?
or there is one pre-set date set in the software?
|
|
|
|
|
Probably the same system date based timebomb they use in OS beta/release candidates.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
i have some ink data. i get the bezier point and bezier cusp of the same. wud bezier cups be considered as the control poits of the curve and is it possible to drwa the exact curve from bezier cusps alone if i discard the bezier points. i searched google but cud not find the satisfactory answer.
|
|
|
|
|
Are you sure you have the correct terminology? A cusp is a particular kind of point in a Bezier curve (where the derivative is non-continuous) and only appears in some curves, often when the points are in the wrong order.
If you do have a cusp, it may be possible to calculate the relevant point coordinates, but I suspect you'd need the derivatives on each side of it (and possibly second derivatives) as well. The maths for working this out could be quite complicated...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
thank you for the reply. further, i do have the coordinates of the cusps. and want to draw curve out of these. i.e using minimum number of points. my requirement is to redraw(approximate) a curve from a given curve and its coordinates with minimum number of points with minimal error.
|
|
|
|
|
OK, if that's the requirement then I guess you're stuck with trying to do it.
As I said, it's not going to be easy, and I hope you're prepared for some difficult maths. Rather you than me...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
I have two objects.
Object A holds an event.
Object B assigns an anonymous delegate to Object A's event.
I want to access Object A from the code in the anonymous method.
foreach (Entity target in Entities)
{
[...]
target.OnTouch += new delegate()
{
if (Character == '+')
{
Character = '/';
passableBy = PassableFlags.normal;
}
return;
};
}
Character and passableBy are properties of [target].
It won't compile, it says that Character and passableBy do not exist in the current context.
How can I access properties of the event-holding object?
[Edit]
Note: This code is in Object B, and [target] point to Object A, for clarification.
modified on Tuesday, June 30, 2009 4:19 PM
|
|
|
|
|
Where do you expect to get the scope for these properties from ? target.Character and target.passableBy will work, because the anonymous method has the scope of the spot it was created.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I used target.[x] previously, and it doesn't work.
It always affects whatever [target] points to at the calling moment, ie. the wrong object. And I cannot... wait, that's an idea.
Is there some way to pass over a pointer to itself together with the anonymous method? Or should I just give it up and think of something else?
|
|
|
|
|
The method should have the scope of hte method that called it. If you created seperate variables for each object, or if you passed in a variable that was the index into the array and then looked up the object in the array in the method, that would work.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
That's not exactly the answer I was hoping for, but I now know how to do it.
...and will do it, after I catch some Z's. It's almost two in the morning, sheesh.
Thanks!
|
|
|
|
|
Christian Graus wrote: target.Character and target.passableBy will work, because the anonymous method has the scope of the spot it was created
How is that possible? In his code, target is just the loop variable and the anonymous method - the event handler - might run a year after the loop has finished. The handler will exist as long as delegates referring to it does, but the local variable "target" goes out of scope once the loop finishes, and it's value is changed on each loop iteration. The anonymous method is still a method and it seems to me it should have it's own scope. (I see that it makes sense for things where the anonymous method actually *executes* in the containing methods, like when using List<T>.Find(Predicate<T> match), but here we're attaching an event handler.)
I've seen many of your posts and have the impression you're in the know, so it would be nice if you can explain how this works with anonymous methods as event handlers. I'm also wondering if doing it like the OP did would lead to multiple anonymous methods? It seems it would have to be so if the method shares scope with it's containing method.
To return to the OP's issue, surely the normal way to do this is to use a single event handler, attach it to all the targets, and pass a target to the eventhandler as "sender" in the EventHandler delegate?
public class Thing
{
public event EventHandler Touched;
public void Touch()
{
if (Touched != null) Touched(this, EventArgs.Empty);
}
}
public class OtherThing
{
List<Thing> Things = App.GetThings();
public void Foo()
{
foreach (Thing t in Things)
t.Touched += new EventHandler(thing_touched);
}
static void thing_touched(object sender, EventArgs e)
{
Thing source = (Thing)sender;
}
}
(I believe it is a good practice to make all non-virtual methods that depend only on their parameters static. It works with an instance method as well, but there is no reason for it to be an instance method.)
I hope you will comment on this as I'm now confused about the scoping of anonymous methods.
|
|
|
|
|
I've decided to just use EventArgs containing a reference to the appropiate object whenever it is called. Probably not very elegant, but it works, at least.
It seems that anonymous methods have the scope of the creation place, but I'd have to do some research to say for certain...
|
|
|
|
|
That is probably the sensible solution. But I still hope someone can help shed light on this; I've discovered something I'm unsure about and that is always an opportunity to learn.
I could probably google it, but if someone has the answer at hand...
|
|
|
|
|
I've checked it.
It always has the scope of the place where it was created.
public void init()
{
int i = 30;
foo(delegate()
{
i = 10;
});
Console.WriteLine("i = " + i.ToString());
Console.ReadKey();
}
public void foo(EventHandler awesome)
{
awesome();
}
This would return "i = 10". This is somehow creepy, because it's a variable local in another method...
The same happens if foo is in another class.
Additionally, if the creator object doesn't exist anymore... nothing happens:
using System;
using System.Collections.Generic;
using System.Text;
namespace test2
{
class Program
{
static void Main(string[] args)
{
Thing1 thing1 = new Thing1();
Thing2 thing2 = thing1.Get2();
thing1 = null;
GC.Collect();
thing2.awesome(null, null);
return;
}
}
public class Thing1
{
public Thing2 Get2()
{
Thing2 thing2 = new Thing2();
thing2.awesome = delegate(object sender, EventArgs args)
{
thing2 = null;
};
return thing2;
}
}
public class Thing2
{
public EventHandler awesome;
}
}
Cleary, thing1 created the anonymous delegate.
I've named the Thing2 variable the same everywhere, to be sure.
Main.thing2 didn't turn into null, therefore it affected the non-existing thing1, ie. nothing happened. Also, no crash nor anything of that sort. It obviously has the scope of Thing1.Get2(), again the creator scope.
[Edit]
I've just noticed. The Garbage Collection doesn't take thing1!
The anonymous delegate points to it after all...
modified on Wednesday, July 1, 2009 2:20 PM
|
|
|
|