C# programming with Mapinfo

954 views
Skip to first unread message

mbvb

unread,
Apr 1, 2008, 5:29:06 AM4/1/08
to MapInfo-L
I would like to know anyone has c# sample program that can open the
mapinfo map window and also the use some of the function from mapinfo.
THanks.

Gajendra Salunkhe

unread,
Apr 1, 2008, 5:38:31 AM4/1/08
to mapi...@googlegroups.com
Hi

I have uploaded a Sample MapInfo C# sample some time back. You can find it in "Files section" of Group (need to go to group URL).

Regards
Gajendra Salunkhe

mbvb

unread,
Apr 1, 2008, 6:30:33 AM4/1/08
to MapInfo-L
Hi Gajendra,

Got it. Thanks a lot.

Best regards,
mbvb
> > THanks.- Hide quoted text -
>
> - Show quoted text -

jongo

unread,
Apr 1, 2008, 9:11:32 PM4/1/08
to MapInfo-L
Hi Gajendra,

That was helpful. But i would like to ask it is possible to convert
mapbasic source files into C# source? If not is it possible to convert
mapbasic source to DLL and use it in C#? Thanks a lot for your
support.

Best regards,
Jon
> > - Show quoted text -- Hide quoted text -

Gajendra Salunkhe

unread,
Apr 2, 2008, 2:10:34 AM4/2/08
to mapi...@googlegroups.com
Hi

As far as I know we can convert MabBasic Code to C#.Excluding the GUI Part(Tool Bar etc) you can covert. I have done it my project.

By Convert I mean Writing same mapbasic code under "mi.do("")". Once you are able to pass the string, rest all is fine.

The thing that I am not able to do is communication between C# and .MBX file using RemoteMSGHandler(), Which is used to pass and get the values. To accomplish this I have written all the .MB code into C#.

Regards
Gajendra Salunkhe

jongo

unread,
Apr 2, 2008, 10:16:10 AM4/2/08
to MapInfo-L
Hi Gajendra,

Do you think where i can find more source code for c# on GIS
application. Currently i am trying to develop a GIS tool using C# and
i really don't where to start. I can do it in mapbasic but not c#. Do
you have any sample program that i refer to? All help much
appreciated. THanks.

On Apr 2, 2:10 pm, "Gajendra Salunkhe" <gsalun...@gmail.com> wrote:
> Hi
>

mbvb

unread,
Apr 3, 2008, 3:04:23 AM4/3/08
to MapInfo-L
Hi Gajendra,

I can't seems to anchor or dock the mapinfo picture box to expand
together with the form in your code? Any idea how i can do this?
Thanks.


On Apr 1, 5:38 pm, "Gajendra Salunkhe" <gsalun...@gmail.com> wrote:

Gajendra Salunkhe

unread,
Apr 3, 2008, 6:01:23 AM4/3/08
to mapi...@googlegroups.com
HI Jason

You can do this, I have not tried this using C# I have done this in VB6.0, in the sample code that comes with MapBasic 6.0 it was there also in help under Integrated Mapping you can see how they have done in VB 6.0. TRY to simulate same in C#. I think that will solve the issue

Regards
Gajendra Salunkhe

Gajendra Salunkhe

unread,
Apr 3, 2008, 6:10:43 AM4/3/08
to mapi...@googlegroups.com
Hi

I have not searched on web regarding source code with C#.

Have you done coding in VB?

If yes then I can explain you further

If No, then The sample which I have provided gives you the basic Idea how you can proceed.

There are two things that I have done

1) Initiate a MapInfo instance.
2) Pass the MapBasic command to MapInfo Instance.

Now keeping this in Mind you can write code. There is one more thing called SetCallBack. Regarding this you can search in MapBasic help, They have provided a sample code in VB6.0 which shows almost all the possibilities. SetCallBack is used to pass the values MapInfo and VB6.0 or C#  and Vice Versa.

Thats all BASIC you need to know.

Now its up to you weather you do it as .DLL or as a class Module etc(All C# specific features)

Hope this helps

Gajendra Salunkhe

unread,
Apr 3, 2008, 6:17:07 AM4/3/08
to mapi...@googlegroups.com
AND you should know how to code in C#. As you have said that you know MapBasic, its similar to VB. But C# is completely different in terms of coding (its like Java).

The problem I faced in C# is passing MapBasic commands as strings.
Reply all
Reply to author
Forward
0 new messages