Monday, 15 September 2014

Automate MapInfo with C# -


Hello, I am developing an application that after parsing data, after that I used some data on the map using MapInfo Imagine, I created a MapInfo example properly but I still do not know how to display the example data or how to use it, whatever example I have created, is not visible even after being visible is.

Below is my code

name space JA3_Trace_Viewer {public partial class JA3Main: form {public JA3Main () {InitializeComponent (); } Private Zero JA3Main_Load (Object Sender, EventArgs e) {MapInfo.MapInfoApplication mapinfoinstance = New MapInfo.MapInfoApplication (); Mapinfoinstance.Visible = True; DDockWindow winM = newDDockWindow (); WinM.Activate (); }}

The data I want to visualize on the map is longitude and latitude and other columns allow them to call, so please if you help me.

Thanks in advance.

New Code:

  Public Partial Category Form 1: Form {// sets the parent of a window. [DllImport ("User32", Charset = Charset Auto, Exact Spelling = True)] Internal Stable Extension Interpetor Setpelt (Interrupt HWNDT, Interpet HWP) // Set Window Properties [DllImport ("USER32.DLL")] Public Stabilization Extern int SetWindowLong (IntPtr hWnd, int nIndex, int dwNewLong); // window features [DllImport ("USER32.DLL")] becomes public static extern int GetWindowLong (IntPtr hWnd, int nIndex); // Mixed Constants Need Public Stable Int GWL_STYLE = -16; Public Stable Int WS_CHILD = 0x40000000; // Child Window Public Stable Int WS_BORDER = 0x00800000; // windows with border static id WS_DLGFRAME = 0x00400000; // Window with double border but no title Public Stable Int WS_CAPTION = WS_BORDER | WS_DLGFRAME; // windows with a title bar public static id WS_MAXIMIZE = 0x1000000; Public Form 1 () {Initialization (); } Private Zero Button 1_Click (Object Sender, EventArgs E) {// Create a new example of MapInfo. MapInfoApplication mapinfo = new mapInfo (application); // Handle in the entire map info application. // 9 = SYS_INFO_MAPINFOWND string handle = mapinfo.Eval ("SystemInfo (9)"); // Convert iTTPTR old hand = new interface (convert to .iint 32 (handle)) in an interrupt type of handle; // Make a Mapini View otherwise it will not be visible in our control. Mapinfo.Visible = True; // Set a MapInfo parent for a picture box on the form. Setpant (old thing, this picture box 1. hand); // Get the current window style of MapInfo window int style = GetWindowLong (old handwritten, GWL_STYLE); // Take the current window style and remove WS_CAPTION (title bar) from it SetWindowLong (old handwritten, GWL_STYLE, (style & amp; ~ WS_CAPTION)); // Mapify so that it fits in our control. Mapinfo.Do ("Set Window 1011 Max"); }}  

class MapInfoApplication Code> () and Eval () , you can pass a command string, eg. See mapbasic samples in the mapinfoinstance.Do ('Open Table foo_bar.TAB foo')

Folder in the folder Sample \ Dotnet \ ... These are your MapBasic folders.


No comments:

Post a Comment