|
I want to create an XML web service that allows a user to enter two U.S. addresses, and be able to obtain step-by-step driving directions.
At first I was hoping that Yahoo or Mapquest would have a web-based API that I can use, but I can't find any APIs for them. PLEASE let me know if they (or any other map sites) have these APIs.
So my second alternative is to find a free XML web service somewhere out there that can provide more or less the same functionality. That way, I can still create my custion XML web service, and have it call the 3rd party web service to do the job.
Microsoft's MapPoint.NET web service (http://www.microsoft.com/mappoint/webservice/default.mspx) would have been the perfect solution for me, but it's not free. I'm doing this for a school project and, as a student, I can't cough up what Microsoft is charging for using its MapPoint.NET service.
So, I would like to know if anyone knows of another map web service that is free. Thanks.
|
|
|
|
|
.Net use a stranger approach to pass data into event handler, all event handler has the same prototype:
void eventhandler(object sender, System.EventArgs e)
but there is no event-specific data contained in the EventArgs object, so how can i get event-specific data (such as X/Y in a mouse event)?
in my case, i wrote a event handler for the Click event of ListView, when user click on one of the subitem in the ListView, I want to know whick subitem is clicked.
any comments is welcome
|
|
|
|
|
ListViewItem Selected = MyListView.SelectedItem;
or, if you have multiple ListView's and they all use the same event handler
<br />
ListView MyListView = (ListView) sender;<br />
ListViewItem Selected = MyListView.SelectedItem;<br />
|
|
|
|
|
thanks, Wjousts
what i really want is the sub item be clicked
ListViewItem Selected = MyListView.SelectedItem;
this code will get the selected item, not sub item.
I have found an approach, send a WIN32 message LVM_GETSUBITEMRECT to the ListView window, it's work, but I think there must be some better way.
|
|
|
|
|
Wjousts wrote:
MyListView.SelectedItem
Sorry! Doesn't work. Use MyListView.FocusedItem instead.
|
|
|
|
|
You should set the ListView.FullRowSelect=true, otherwise ListView.SelectedItem will always be empty.
|
|
|
|
|
|
ispring wrote:
but there is no event-specific data contained in the EventArgs object, so how can i get event-specific data (such as X/Y in a mouse event)?
Try the MouseDown or MouseUp events - they have MouseEventArgs e instead of EventArgs e .
To get which sub-item was clicked, either use the Windows API, or first get the GetItemAt() method to get the item, then use the GetItemRect(index, portion) overload of GetItemRect() to get all its subitems and hit-test them.
|
|
|
|
|
I want to display my debug info in a simple console windows as various events are fired from my program. I can not figure out how to open a Console from my form and then to writeline to it. Can someone point me in the right direction...
rod
www.bigmansoftware.com
|
|
|
|
|
There is only one console per app, and you can easily show this console even if your app is a WinForms app. I don't know what the option is called in VS.NET, but in SharpDevelop, it's called "Hide Console Output".
|
|
|
|
|
Here is what I have tried.
Console c - new Console(); - did not like that, got a protection err
so then...
Console.Writeline("test"); - nothing shows, a Console never appears.
I just want a Console open with my Window form to write data and displays too.
rod
|
|
|
|
|
just change you app to be a console app...
Project, Properties, Common Properties, General, "Output Type" = Console Appliation.
You will need to create main as per a console app, and the will have to show the main form...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
I am C# Student and I have an application that I am developing that I need to get a string value from a text box in the child form into the parent form where I am converting it to an int to use in a random number generation. I have not been able to get any help or find the solution anywhere, so any help would be great. Please only give me C# code as I have never programmed anything but this. Thank you for your time.
Thanks,
Brad
"If you fell sad about your life, just go to the mall"
|
|
|
|
|
hi,
how can TcpClient detect other side closed the connection?
i want to check when the server close connection and i can start process received data afterward.
any help?
regards,
jim
|
|
|
|
|
I'm redesigning the way our application saves and restores sessions. Presently it's serializing using SOAPFormatter, and that's not so good. Most importantly, it's not backwards or forwards compatible. So I want to use XML so that the format is forwards-compatible, and future versions of the application are backwards-compatible with older formats.
Does anyone have any tips regarding this? Any good techniques or interfaces to use? XmlDocument vs. XmlWriter/XmlReader?
Since some of my data involves Rectangle and Point objects, for instance, and Color objects, too, etc., is there a good way to handle that data without having to handle them specially and write extra code for that?
XmlSerializer even seems tantalizing because it might be quick and easy, but I'm afraid that it will be too tied to the internal data representation or class/package structures.
Thanks!
|
|
|
|
|
Hmm, maybe Reflection will somehow help me with the System classes.
|
|
|
|
|
Do most people use databinding with winforms or
do they use a homegrown solution. My experience with
databinding has been problematic at best. I've ran into
numerous problems with anything other then a simple form.
These problems range from programmatically setting a value
in a text box, and the databinding ignoring it, to strange
problems with nulls. I guess I'm stuck in my ways but I
prefer the old ddx, ddv validation of atl and mfc. Although
I am willing to change
I'm also curious about ado versus ado.net.
Is a In memory database really needed? When and were
would the decision between the two be made.
Also does anyone know of any orm tools for c++ and classic ado.
I dont want to cross post to two boards so I am hopeing this is the
correct place. I apologize if they are not.
Thank you
|
|
|
|
|
Data binding is a done in a new way in C#. I think the best thing to do is research and find out. I love .NET databinding. Its very flexible and powerful.
Same story with ASP.net it has been totaly redon based on the .net framework. It runs a lot fast (some people say up to 3 times faster) and is way more powerful and flexible.
About orm tools im not sure.
|
|
|
|
|
Hiya
What exactly is the get and set used for?? I have looked in a number of books but still don't understand what they are for..
Thanks.
|
|
|
|
|
look for accessors
(Properties in VB)
Free your mind...
|
|
|
|
|
The quick and easy is as follows. If you want to control assignment of values to an object you use a private/public variable system. The object accesses the data via the private variable and the public variable is how other objects interact with the object.
Example:
private string username = "";
public string Username
{
get
{
return username;
}
set
{
if !(socket.Connected) username = value;
}
}
This only allows another object to change the username of the object when "socket.Connected" is false. If you didn't use public/private with get/set you would not be able to control the value assignment and other objects would always be able to change the value and set it to whatever they want.
|
|
|
|
|
Does anyone know why PageScale doesn't work while double buffering?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hi,
My app runs a DOS program as a process. Most of the time, given the right command line arguments, the DOS process runs by itself without needing any user intervention, but there is a certain situation that can arise where it expects the user to respond "y" or "n" to a question. Is there any way to detect that the process is waiting for this user input?
Thanks
|
|
|
|
|
Is it really a DOS program, or is it a Win32 console-mode program?
There are probably only two cases:
1) You need to be parsing the output of the program in order to decide whether to respond with a 'y' or an 'n'. In that case, you should be reading the program's standard output and you will see when the question appears.
2) You don't care are are always going to give the same answer. In this case, just go ahead and stuff a 'y' or 'n' into the standard input and it will be buffered for the application to read.
The less likely options where you might need something more complicated involve the application intentionally flushing buffers and such, but don't go there until you've considered the options above.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Blake Coverett wrote:
1) You need to be parsing the output of the program in order to decide whether to respond with a 'y' or an 'n'. In that case, you should be reading the program's standard output and you will see when the question appears.
Well, that's want I'm doing at the moment, but I was wondering if there was a more flexible and fool-proof way of doing things. Right now I'm comparing strings coming out of the stdout (actually, it's the stderr) to a string I know will appear if it decides to ask this question. Then my program will pop up a yes/no message box and, depending on the users response, sends either a 'y' or 'n' to the stdin. The problem is, what if that string changes in the DOS program I'm running (I didn't write it), and what if there are other situations that might need a users response (again, I didn't write it).
|
|
|
|