473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Franson GPS Tools & C#

Hi Guys,

I am trying to get a fix from a GPS using a SDK called Franson GPS
tools. http://www.franson.com/gpstools

I have gotten quite far on my own but am stuck - when I create a
instance of class called GpsFix i get a compile error that no
constructors are defined.

It appears to me that I must set the position property of gpsfix before
I use it? But I also see that position is a class in itself?

My code is below. If someone can see where I am going wrong please
advise.

Thanks heaps.

-Al
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

GpsToolsNET.License objLicense = new GpsToolsNET.License();
objLicense.LicenseKey = "o8h1j88qlSqkaJHiu27oixldj7redk4YoCh3";

// Create parser
GpsToolsNET.NmeaParser objparser = new GpsToolsNET.NmeaParser();
GpsToolsNET.GpsFix objFix = new GpsToolsNET.GpsFix();

objparser.NoEvents = true;
objparser.PortEnabled = true;

objparser.GetGpsFix(3000, 2);
}

private void btnConvert_Click(object sender, EventArgs e)
{
MessageBox.Show(textBoxLatitude.Text + " " + textBoxLongitude.Text);
}
}
}

Aug 15 '06 #1
3 3829
I see now that I get access to the GpsFix object with a line like:

GpsToolsNET.GpsFix objFix = objparser.GetGpsFix(3000, 2);

What I dont understand is why the syntax is different, I mean so far I
have seen that instances of classes are created with:

GpsToolsNET.GpsFix objFix = new GpsToolsNET.GpsFix();

So why does creating this object (instance) differ from the syntax
above?

Cheers

-Al

Aug 15 '06 #2
GpsFix might not have a default contructor.

chanmm

<Bi******@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
>I see now that I get access to the GpsFix object with a line like:

GpsToolsNET.GpsFix objFix = objparser.GetGpsFix(3000, 2);

What I dont understand is why the syntax is different, I mean so far I
have seen that instances of classes are created with:

GpsToolsNET.GpsFix objFix = new GpsToolsNET.GpsFix();

So why does creating this object (instance) differ from the syntax
above?

Cheers

-Al

Aug 16 '06 #3
Bi******@gmail.com wrote:
I see now that I get access to the GpsFix object with a line like:

GpsToolsNET.GpsFix objFix = objparser.GetGpsFix(3000, 2);

What I dont understand is why the syntax is different, I mean so far I
have seen that instances of classes are created with:

GpsToolsNET.GpsFix objFix = new GpsToolsNET.GpsFix();

So why does creating this object (instance) differ from the syntax
above?
Constructors are special methods that are defined and invoked with a
particular syntax. But there's nothing to stop other methods of the
class returning an instance of the class. For example, String.Replace
returns a new String.

And some classes might hide their constructors and require clients to
call a factory method if they want an instance. The same effect can
sometimes be achieved by having no parameterless constructor, and
therefore requiring clients to provide parameters, but having an
explicit factory method makes it more obvious what's happening.

For example, the Graphics class in WinForms cannot be directly created,
because there's not really any such thing as a standalone Graphics - if
you want one, you have to provide an Image, or a window, or a DC, for
the Graphics to be tied to. So the Graphics class has:

public static Graphics FromImage(Image image)
public static Graphics FromHwnd(IntPtr hwnd)
public static Graphics FromHdc(IntPtr hdc)

Note that in this case we couldn't readily use parameterised
constructors instead, because both the latter two take an IntPtr and
there would be no way to tell what it was if we just had

public Graphics(IntPtr handle) // handle to what?

--
Larry Lard
la*******@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version
Aug 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: SK | last post by:
Hello group, I happened to check the review of C++ Templates & Tools (By Scott Robert Ladd) at http://accu.org. The book is in the "Not recommended" category. I will like to hear if you anyone...
1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
72
by: Mel | last post by:
Are we going backwards ? (please excuse my spelling...) In my opinion an absolute YES ! Take a look at what we are doing ! we create TAGS, things like <H1> etc. and although there are tools...
1
by: code | last post by:
Hi Grp http://www.books-download.com/?Book=1493-PHP+Hacks+%3a+Tips+%26+Tools+For+Creating+Dynamic+Websites+(Hacks) Description Programmers love its flexibility and speed; designers love its...
1
by: Grzegorz ¦lusarek | last post by:
Hi everyone. I'm looking for javascript tools for web browser like IE and OPERA. I want find something like javascript shell http://www.squarefree.com/shell/shell.html for IE and OPERA. Does anyone...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
0
by: BigAl.NZ | last post by:
Hi Guys, I am trying to write/copy some code that uses events with a GPS. Everytime the GPS position updates the event fires. The GPS code is from a SDK Library that I got called GPS Tools...
0
by: gbadamosi | last post by:
I am new to this. Please provide me information on Embedded Development and Debugging PC Tools for Python Programming. I need information on programming mode and debugging mode setting. Available...
3
by: Nilam2477 | last post by:
I need to do the code coverage for my ASP.Net Web page application. I know NCover tool can be used for Windows application but i'm not sure how to use it for Web pages? bec in NCoverExplorer we...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.