|
What exactly you want to do?
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
|
What code have you written so far? No-one will do this for you. Show your efforts so far and when you get stuck people will offer help.
Kevin
|
|
|
|
|
|
|
Rahithi wrote: if somebody help me to code this, it will be better for me now.
Of course it would be better for you now if someone just wrote the code for you.
In the long run, however, it's better for you if you learn two things from this:
1. Don't expect other people to do your homework.
2. If you have no idea on how to do the assignment, an hour before it's due is not a good time to start working on it.
Of course we are willing to help you with any problem you have while doing your assignment. This of course requires that you actually made an attempt, so that you know specifically what it is that you have problems with.
---
b { font-weight: normal; }
|
|
|
|
|
Wow, that's ballsy for sure. Please do my homework because I waited until the last minute.
|
|
|
|
|
|
|
You don't know anything about C#, but you have to turn in a web site navigation assignment in 4 hours?? Good Luck!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You have everything you need in your description above. Break it down into steps. The entire project should take under 1/2 hour even if new to C#
|
|
|
|
|
First step is File -> New -> Project , or Ctrl+Shift+N for you advanced users.
|
|
|
|
|
|
I can call a JScript function from a c# App doing as follows:
SHDocVw.InternetExplorer oIe;
oIe = new SHDocVw.InternetExplorerClass();
Object strUrl = @"C:\blank.htm";
Object o=null;
oIe.Navigate2(ref strUrl ,ref o,ref o,ref o,ref o);
mshtml.HTMLDocument doc = (mshtml.HTMLDocument) oIe.Document;
doc.parentWindow.execScript("alert('Messge from JScript')", "JScript");
MessageBox.Show("Done");
oIe.Quit();
and what happens is that untill the JScrip dialog is closed my app is blocked.
How can i mak the call async? I tryed with BeginInvoke but got errors.
Regards
|
|
|
|
|
sterenzi wrote: but got errors.
What errors? We can't see them from here.
led mike
|
|
|
|
|
I get what follows:
An unhandled exception of type 'System.InvalidCastException' occurred in mscorlib.dll
You can't get with the code i provided, I'll put the sample code for errors in a few mins.
|
|
|
|
|
OK, if you try the following code you can get the error,notice that I'm not sure this is the best way to follow...
delegate Object execAsyncJScriptDelegate(string param, string lang);
private void button2_Click(object sender, System.EventArgs e)
{
SHDocVw.InternetExplorer oIe;
oIe = new SHDocVw.InternetExplorerClass();
Object strUrl = @"C:\blank.htm";
Object o=null;
oIe.Navigate2(ref strUrl ,ref o,ref o,ref o,ref o);
mshtml.HTMLDocument doc = (mshtml.HTMLDocument) oIe.Document;
try
{
execAsyncJScriptDelegate jFunc = new execAsyncJScriptDelegate(doc.parentWindow.execScript);
IAsyncResult ar = jFunc.BeginInvoke("alert('Message from JScript')", "JScript", null, null);
MessageBox.Show("Done");
oIe.Quit();
while (!ar.IsCompleted)
{
Application.DoEvents();
}
jFunc.EndInvoke(ar);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
|
|
|
|
|
Well in .NET 2.0 I emulated your attempt using WebBrowser.Document.InvokeScript(). It did not throw an exception but the script did not execute and the IAsyncResult is completed upon return. So it appears that async invocation of scripts might not be supported.
led mike
|
|
|
|
|
I have a windows application from which I "call" a method from a web service. The method returns an array of some objects (objects are from a class I created and they are located on the service side.)Objects have their public methods.
Now, on the client side (the win application), I accept that array, but I can't access the methods of the object... Why?
The code is something like this (the client side):
Service srvce = new Service();
Service.MyClass[] arrayObjects = new Service.MyClass[1000];
arrayObjects = srvce.GetArrayOfObjects(); //this returns the array I was talking about
//since that class has a public GetMyProperty() method, I should call that method from tha client side, right?
int myProperty = arrayObjects[0].GetMyProperty();
//but that doesn't work, I can't call any of the methods... IntelliSense gives me nothing after arrayObjects[0]
//it doesn't work when I do the conversion
int property = (arrayObjects[0] as Service.MyClass).GetProperty();
So, I can't call the methods, it's like they are private - and they're not, they're public, I just can't see them from client, and why is that?
I'm stuck... Help!
|
|
|
|
|
Are the objects in the array marked as [Serializable]? When you debug, can you see the objects in the array?
|
|
|
|
|
Well, actually, they're not marked as [Serializable]. During debugging, I can see there are 5 array members, and the debugger returns the correct type (MyWebService.MyClass, for example), but that's it, I can't access them, I can't do anything with them. Now, that's probably because that array of objects are created on the service side, and they sre returned to the client. Maybe it would help if I instantiated the array on the client, and send that array to the service to be "filled"? But the problem is the size of the array - I can't predict that, and it would be silly to set it to 100 and it's count is only 3.... Maybe I can use ArrayList instead? The problem is that I'm new to web services (although not to win forms programming), so I don't know much about serialization... So any tips will be appreciated...
|
|
|
|
|
I want to create one bluetooth application which can send commands to a robot which is having a bluetooth receiver.I am clear till the application that sends the bt signals to robot but from receiver side what should I do?Can Any one tel me.How can I do programming there in C#.
nishu
|
|
|
|
|
Hi guys,
I have a class that extends an IMenuProvider interface and belongs to a plug-in project. In the UI project(other project) I've developed a menuService class that finds plug-ins that implement a IMenuProvider interface and execute the constructor method by using the invoke method. Here's the code.
<code>...
Type[] types = assembly.GetTypes();
foreach (Type type in types)
{
if (type.GetInterface("IMenuProvider") != null)
{
if (!ht.ContainsKey(type.FullName))
{
ConstructorInfo cinfo = type.GetConstructor(System.Type.EmptyTypes);
IMenuProvider imp = (IMenuProvider)cinfo.Invoke(null); **
ht.Add(type.FullName, imp);
RegisterProvider(imp);
}
}
}
...
</code>
So what happens is the line marked with ** returns an error saying "Unable to cast object of type 'TestPlugin.PluginMenuProvider' to type 'Enki.UI.ComponentModel.IMenuProvider'."
I know that I’m attempting to invoke the constructor method of the subclass PluginMenuProvider through the extension IMenuProvider but i don’t want to have to specify every subclass that extends the IMenuProvider interface.
Now, my question is how can i invoke the constructor without having to declare and than cast each class type that extends the interface IMenuProvider like the line marked with ** does?
Best regards.
Pedro M.
|
|
|
|
|
Jost Pedro wrote: execute the constructor method by using the invoke method
Invoking constructors might have a place but I would avoid it. From a design perspective I would use a Creational Design Pattern.
led mike
|
|
|
|
|