Options

Calling Windows API function from Navision?

NavDevNavDev Member Posts: 21
hi experts,

is it possible to call Windows API functions from Navision code. If so, a code example would be very welcome.

thanks in advance,

NavDev

Comments

  • Options
    janpieterjanpieter Member Posts: 298
    No you cant call API calls directly from within Navision.

    Howerver you can use ActiveX DLL functions from Navision so if you want to make API calls you can create an ActiveX wrapper to achieve this.
    In a world without Borders or Fences, who needs Windows and Gates?
  • Options
    NavDevNavDev Member Posts: 21
    thanks janpieter for your fast reply!

    is there a sample for such an ActiveX wrapper (sourcecode)? we used to have a DLL (programmed in Delphi) called from MS Word that performed specific tasks and then returned a textstring to MS Word. this shall now be done in Navision. I want to reuse the old DLL but - for being new to Navision - have no idea how to do it there.

    your help would be appreciated.
  • Options
    janpieterjanpieter Member Posts: 298
    I think you can find more info on automation.

    Do a search on automation or activex in this or other (4GL languages) forums and im sure you will find plenty of info. There are lot of books as well. Look for a walkthrough that will get you going the fastest.

    It is a bit much to explain everything about automation here.
    In a world without Borders or Fences, who needs Windows and Gates?
  • Options
    NavDevNavDev Member Posts: 21
    you are absolutely right. thanks! hope I'll find my way through it.

    kind regards,

    NavDev
  • Options
    NavDevNavDev Member Posts: 21
    Well, one last question:

    I succeeded in creating the OCX and it works fine when dropped on a Access Basic, VBA or VB form.

    However, when assigning a Navision OCX-variable to my OCX and subsequently trying to save the code unit, Navision crashes completely. Are there any limitations to the use of OCX in Navision?

    cheers,

    NavDev
  • Options
    SaalekSaalek Member Posts: 181
    Hi
    I created some OCX in VB6 and it works fine.
    An advice: Use the OCX only as a Function or procedure container. If you create the OCX with properties, you can have some compiling errors (I had some problems with the standard properties of VB6).

    Bye
  • Options
    janpieterjanpieter Member Posts: 298
    hmm cant recall simular problems but i only use activex dll not OCX.
    In a world without Borders or Fences, who needs Windows and Gates?
Sign In or Register to comment.