Integrating MapBasic with .NET Problem with TextBox Controls












0















I'm trying to integrate Map-Basic with .NET
The final goal is to get an app capable to set address numbers to segment in a friendly and automated way
The problem I having is that TextBoxes in the .NET form are not responsive at all. They don't even get the initial value.
Here is a simplified example code.



Form1.Designer.cs



partial class Form1
{
private System.ComponentModel.IContainer components = null;

protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(68, 67);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(255, 26);
this.textBox1.TabIndex = 0;
this.textBox1.TabStop = false;
this.textBox1.Text = "Initial text";
//
// button1
//
this.button1.Location = new System.Drawing.Point(68, 184);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(255, 56);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();

}

public System.Windows.Forms.TextBox textBox1;
private Button button1;
}


This is Form1.cs



public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Click");
}
}


And finally a class with static method



public class InterfaceClass
{
static Form1 form;
public static void showMainWindow(int hwnd)
{
form = new Form1();
form.Show();
form.PerformLayout();
}
}


My MB (MapBasic) File looks like this. (Having removed some sub declares. It compiles successfully)



Include "mapbasic.def"



Declare Method showMainWindow Class "SetNumberLib.InterfaceClass" Lib "SetNumberLib.dll" (ByVal hwnd As Integer)



Sub Main



Create Menu "Map Numbering" As
"Show Window" Calling ShowWindow,
"Exit" Calling EndApp
Alter Menu bar Add "Map Numbering"


End Sub



Sub ShowWindow



Dim hwndPro As Integer
hwndPro = SystemInfo(SYS_INFO_MAPINFOWND)
Call showMainWindow(hwndPro)


End Sub



Back to the form. The Button works fine. The messagebox is shown when clicked
The textbox is like a non reactive picture. Worse. I doubt it gets the redraw.
Any idea?
Am I missing something.
By the way. When I test the dll from a Net App the text-boxes work fine.



Any help will be highly appreciated.



New Info:
RichTextBOx Works fine. The problem is still with TextBoxes.
Any Clue?










share|improve this question





























    0















    I'm trying to integrate Map-Basic with .NET
    The final goal is to get an app capable to set address numbers to segment in a friendly and automated way
    The problem I having is that TextBoxes in the .NET form are not responsive at all. They don't even get the initial value.
    Here is a simplified example code.



    Form1.Designer.cs



    partial class Form1
    {
    private System.ComponentModel.IContainer components = null;

    protected override void Dispose(bool disposing)
    {
    if (disposing && (components != null))
    {
    components.Dispose();
    }
    base.Dispose(disposing);
    }

    private void InitializeComponent()
    {
    this.textBox1 = new System.Windows.Forms.TextBox();
    this.button1 = new System.Windows.Forms.Button();
    this.SuspendLayout();
    //
    // textBox1
    //
    this.textBox1.Location = new System.Drawing.Point(68, 67);
    this.textBox1.Name = "textBox1";
    this.textBox1.Size = new System.Drawing.Size(255, 26);
    this.textBox1.TabIndex = 0;
    this.textBox1.TabStop = false;
    this.textBox1.Text = "Initial text";
    //
    // button1
    //
    this.button1.Location = new System.Drawing.Point(68, 184);
    this.button1.Name = "button1";
    this.button1.Size = new System.Drawing.Size(255, 56);
    this.button1.TabIndex = 1;
    this.button1.Text = "button1";
    this.button1.UseVisualStyleBackColor = true;
    this.button1.Click += new System.EventHandler(this.button1_Click);
    //
    // Form1
    //
    this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.ClientSize = new System.Drawing.Size(800, 450);
    this.Controls.Add(this.button1);
    this.Controls.Add(this.textBox1);
    this.Name = "Form1";
    this.Text = "Form1";
    this.ResumeLayout(false);
    this.PerformLayout();

    }

    public System.Windows.Forms.TextBox textBox1;
    private Button button1;
    }


    This is Form1.cs



    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }
    private void button1_Click(object sender, EventArgs e)
    {
    MessageBox.Show("Click");
    }
    }


    And finally a class with static method



    public class InterfaceClass
    {
    static Form1 form;
    public static void showMainWindow(int hwnd)
    {
    form = new Form1();
    form.Show();
    form.PerformLayout();
    }
    }


    My MB (MapBasic) File looks like this. (Having removed some sub declares. It compiles successfully)



    Include "mapbasic.def"



    Declare Method showMainWindow Class "SetNumberLib.InterfaceClass" Lib "SetNumberLib.dll" (ByVal hwnd As Integer)



    Sub Main



    Create Menu "Map Numbering" As
    "Show Window" Calling ShowWindow,
    "Exit" Calling EndApp
    Alter Menu bar Add "Map Numbering"


    End Sub



    Sub ShowWindow



    Dim hwndPro As Integer
    hwndPro = SystemInfo(SYS_INFO_MAPINFOWND)
    Call showMainWindow(hwndPro)


    End Sub



    Back to the form. The Button works fine. The messagebox is shown when clicked
    The textbox is like a non reactive picture. Worse. I doubt it gets the redraw.
    Any idea?
    Am I missing something.
    By the way. When I test the dll from a Net App the text-boxes work fine.



    Any help will be highly appreciated.



    New Info:
    RichTextBOx Works fine. The problem is still with TextBoxes.
    Any Clue?










    share|improve this question



























      0












      0








      0








      I'm trying to integrate Map-Basic with .NET
      The final goal is to get an app capable to set address numbers to segment in a friendly and automated way
      The problem I having is that TextBoxes in the .NET form are not responsive at all. They don't even get the initial value.
      Here is a simplified example code.



      Form1.Designer.cs



      partial class Form1
      {
      private System.ComponentModel.IContainer components = null;

      protected override void Dispose(bool disposing)
      {
      if (disposing && (components != null))
      {
      components.Dispose();
      }
      base.Dispose(disposing);
      }

      private void InitializeComponent()
      {
      this.textBox1 = new System.Windows.Forms.TextBox();
      this.button1 = new System.Windows.Forms.Button();
      this.SuspendLayout();
      //
      // textBox1
      //
      this.textBox1.Location = new System.Drawing.Point(68, 67);
      this.textBox1.Name = "textBox1";
      this.textBox1.Size = new System.Drawing.Size(255, 26);
      this.textBox1.TabIndex = 0;
      this.textBox1.TabStop = false;
      this.textBox1.Text = "Initial text";
      //
      // button1
      //
      this.button1.Location = new System.Drawing.Point(68, 184);
      this.button1.Name = "button1";
      this.button1.Size = new System.Drawing.Size(255, 56);
      this.button1.TabIndex = 1;
      this.button1.Text = "button1";
      this.button1.UseVisualStyleBackColor = true;
      this.button1.Click += new System.EventHandler(this.button1_Click);
      //
      // Form1
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(800, 450);
      this.Controls.Add(this.button1);
      this.Controls.Add(this.textBox1);
      this.Name = "Form1";
      this.Text = "Form1";
      this.ResumeLayout(false);
      this.PerformLayout();

      }

      public System.Windows.Forms.TextBox textBox1;
      private Button button1;
      }


      This is Form1.cs



      public partial class Form1 : Form
      {
      public Form1()
      {
      InitializeComponent();
      }
      private void button1_Click(object sender, EventArgs e)
      {
      MessageBox.Show("Click");
      }
      }


      And finally a class with static method



      public class InterfaceClass
      {
      static Form1 form;
      public static void showMainWindow(int hwnd)
      {
      form = new Form1();
      form.Show();
      form.PerformLayout();
      }
      }


      My MB (MapBasic) File looks like this. (Having removed some sub declares. It compiles successfully)



      Include "mapbasic.def"



      Declare Method showMainWindow Class "SetNumberLib.InterfaceClass" Lib "SetNumberLib.dll" (ByVal hwnd As Integer)



      Sub Main



      Create Menu "Map Numbering" As
      "Show Window" Calling ShowWindow,
      "Exit" Calling EndApp
      Alter Menu bar Add "Map Numbering"


      End Sub



      Sub ShowWindow



      Dim hwndPro As Integer
      hwndPro = SystemInfo(SYS_INFO_MAPINFOWND)
      Call showMainWindow(hwndPro)


      End Sub



      Back to the form. The Button works fine. The messagebox is shown when clicked
      The textbox is like a non reactive picture. Worse. I doubt it gets the redraw.
      Any idea?
      Am I missing something.
      By the way. When I test the dll from a Net App the text-boxes work fine.



      Any help will be highly appreciated.



      New Info:
      RichTextBOx Works fine. The problem is still with TextBoxes.
      Any Clue?










      share|improve this question
















      I'm trying to integrate Map-Basic with .NET
      The final goal is to get an app capable to set address numbers to segment in a friendly and automated way
      The problem I having is that TextBoxes in the .NET form are not responsive at all. They don't even get the initial value.
      Here is a simplified example code.



      Form1.Designer.cs



      partial class Form1
      {
      private System.ComponentModel.IContainer components = null;

      protected override void Dispose(bool disposing)
      {
      if (disposing && (components != null))
      {
      components.Dispose();
      }
      base.Dispose(disposing);
      }

      private void InitializeComponent()
      {
      this.textBox1 = new System.Windows.Forms.TextBox();
      this.button1 = new System.Windows.Forms.Button();
      this.SuspendLayout();
      //
      // textBox1
      //
      this.textBox1.Location = new System.Drawing.Point(68, 67);
      this.textBox1.Name = "textBox1";
      this.textBox1.Size = new System.Drawing.Size(255, 26);
      this.textBox1.TabIndex = 0;
      this.textBox1.TabStop = false;
      this.textBox1.Text = "Initial text";
      //
      // button1
      //
      this.button1.Location = new System.Drawing.Point(68, 184);
      this.button1.Name = "button1";
      this.button1.Size = new System.Drawing.Size(255, 56);
      this.button1.TabIndex = 1;
      this.button1.Text = "button1";
      this.button1.UseVisualStyleBackColor = true;
      this.button1.Click += new System.EventHandler(this.button1_Click);
      //
      // Form1
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(800, 450);
      this.Controls.Add(this.button1);
      this.Controls.Add(this.textBox1);
      this.Name = "Form1";
      this.Text = "Form1";
      this.ResumeLayout(false);
      this.PerformLayout();

      }

      public System.Windows.Forms.TextBox textBox1;
      private Button button1;
      }


      This is Form1.cs



      public partial class Form1 : Form
      {
      public Form1()
      {
      InitializeComponent();
      }
      private void button1_Click(object sender, EventArgs e)
      {
      MessageBox.Show("Click");
      }
      }


      And finally a class with static method



      public class InterfaceClass
      {
      static Form1 form;
      public static void showMainWindow(int hwnd)
      {
      form = new Form1();
      form.Show();
      form.PerformLayout();
      }
      }


      My MB (MapBasic) File looks like this. (Having removed some sub declares. It compiles successfully)



      Include "mapbasic.def"



      Declare Method showMainWindow Class "SetNumberLib.InterfaceClass" Lib "SetNumberLib.dll" (ByVal hwnd As Integer)



      Sub Main



      Create Menu "Map Numbering" As
      "Show Window" Calling ShowWindow,
      "Exit" Calling EndApp
      Alter Menu bar Add "Map Numbering"


      End Sub



      Sub ShowWindow



      Dim hwndPro As Integer
      hwndPro = SystemInfo(SYS_INFO_MAPINFOWND)
      Call showMainWindow(hwndPro)


      End Sub



      Back to the form. The Button works fine. The messagebox is shown when clicked
      The textbox is like a non reactive picture. Worse. I doubt it gets the redraw.
      Any idea?
      Am I missing something.
      By the way. When I test the dll from a Net App the text-boxes work fine.



      Any help will be highly appreciated.



      New Info:
      RichTextBOx Works fine. The problem is still with TextBoxes.
      Any Clue?







      c# .net map-basic






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 9:45









      Nick Chapsas

      3,0311515




      3,0311515










      asked Nov 21 '18 at 7:43









      mdevmdev

      181413




      181413
























          1 Answer
          1






          active

          oldest

          votes


















          0














          It turned out to be that this miss behaviour stooped the next day when I restarted Mapinfo.
          The real solution is beyond my hands but a fresh Mapinfo instance works fine integrated with .NET.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407339%2fintegrating-mapbasic-with-net-problem-with-textbox-controls%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It turned out to be that this miss behaviour stooped the next day when I restarted Mapinfo.
            The real solution is beyond my hands but a fresh Mapinfo instance works fine integrated with .NET.






            share|improve this answer




























              0














              It turned out to be that this miss behaviour stooped the next day when I restarted Mapinfo.
              The real solution is beyond my hands but a fresh Mapinfo instance works fine integrated with .NET.






              share|improve this answer


























                0












                0








                0







                It turned out to be that this miss behaviour stooped the next day when I restarted Mapinfo.
                The real solution is beyond my hands but a fresh Mapinfo instance works fine integrated with .NET.






                share|improve this answer













                It turned out to be that this miss behaviour stooped the next day when I restarted Mapinfo.
                The real solution is beyond my hands but a fresh Mapinfo instance works fine integrated with .NET.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 22 '18 at 15:13









                mdevmdev

                181413




                181413
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407339%2fintegrating-mapbasic-with-net-problem-with-textbox-controls%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

                    How to change which sound is reproduced for terminal bell?

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?