Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Error using activeX in C#

Featured Replies

I'm trying to talk to FM10 via the activeX. The problem is when I try to set the value of a FMPRO70Lib.Documents the ActiveX throws an error.

Here's a sample


FMPRO70Lib.Application fmApp;

FMPRO70Lib.Documents fmDocs;



fmApp = new FMPRO70Lib.Application();



fmApp.Visible = 1;



fmDocs = (FMPRO70Lib.Documents) fmApp.Documents; // Error here!



...

Does anyone know why?

No, works just fine here. You did make a reference to the FM COM object, right?


using FMPRO70Lib;



namespace test_FMactiveX

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }



        private void button1_Click(object sender, EventArgs e)

        {

            FMPRO70Lib.Application fmApp;

            FMPRO70Lib.Documents fmDocs;



            fmApp = new FMPRO70Lib.Application();



            fmApp.Visible = 1;



            fmDocs = (FMPRO70Lib.Documents)fmApp.Documents;

            this.label1.Text = fmDocs.Count.ToString();

        }

    }

}

  • Author

I don't know why, but when I rebooted my computer everything went fine.

Thanx

Haven't had time to test this in 10 but keep in mind that there is known bug in the FM activeX implementation that if you hit it a number of times in quick succession, FM will go deaf and you'll get errors or scripts won't execute when you call them.

The only cure is to quit FM and restart it...

  • Author

Even if I quit FM and/or kill the process, I still had the null error. I really needed to reboot the computer. Might be something wrong with the internal addressing.

By the way, do you know how to get the current instance of FM? Or the object will get it automatically when I instanciate it?

Edited by Guest

yes, it will hook into the running instance of FMP. If FMP is not running it will launch the last version you launched manually. So if you have FMP8, 9 and 10 installed on your machine (or FMP and FMPA) and none is running, the call to FMPRO will launch the last one you used.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.