Creating a new GX file with new function!

Hello there,

I wrote a GX file to apply a new filter over my data in Oasis Montaj. But I don't know how to deal with new function and where should I write it. For instance, in the following code, where you use a function for getting the result, I want to use a new function like KFilter_DU ( I called it KFilter_DU), which is not in the OM. My question is where should I put the code for calculating the KFilter_DU and should I write it in C language?

I have downloaded the gxc-9.10 and did this:

set "PATH=%PATH%;C:\Program Files\Geosoft\Desktop Applications 9\bin"
set "INCLUDE=c:\geosoft_code\gxc\include"

And I tested some of the examples and were okay.

// --- Go through all selected lines ---

   ProgName_SYS("", 1);
   Line = FirstSelLine_DB(Data);
   while (iIsLineValid_DB(Data, Line))
      // --- Update the progress bar ---

      GetSymbName_DB(Data, Line, sTemp);
      UnLockSymb_DB(Data, Line);

      Strcpy_STR(sLabel, _("Filtering line: "));
      Strcat_STR(sLabel, sInCh);
      ProgName_SYS(sLabel, 0);
      ProgUpdateL_SYS(iLine, iTotLines);

      // --- Apply filter ---

      KFilter_DU(Data, Line, InCh, OutCh, rQ, rR, rP);

      // --- Advance to next line ---

      Line = NextSelLine_DB(Data, Line);

I do appreciate it if you could guide me. Thank you.



  • DumitruIon

    If you haven't done that already, you may need to read "Extending Oasis Montaj" section associated with the GX developer version you are using. It may be useful to take a look at older versions as well, where you may find additional examples, complementary in some respects to the newest ones.

    Look for GX Based DLL Development: create a DLL for your own function(s) as suggested in the associated GX developer documentation, for example as in:
    Part 2: Extending Oasis montaj - GX Developer 8.4 - Confluence (

    The above link is just an example, you may go for a more recent version.

    You can clearly integrate the above in Visual Studio and configure a project to develop both GX and DLL at once, with your preferred language, e.g. .NET or C.

    I would suggest a great resource to guide you in this is USGS_GX_OM90 by Jeffrey D. Phillips:
    of07-1355.pdf (
    At page 2, you get the link for downloading the corresponding source code, and then this code could help you further.
  • FarzadGholamian
    Thank you so much for the answer and the links. I will check them to find the solutions. I would appreciate it if you could guide me later if I have some issues. Thank you.