Using third party DLL / problem creating instance

tvandongentvandongen Member Posts: 78
edited 2005-05-02 in Navision Attain
I need to make a form within NF, which will be used to send data to industrial printers. For this we have a demo version (full version, but not yet paid) to test if this is possible.
I also got an example of Visual Basic in which is detailed described how it can be done using COM / DCOM.
Problem is that I don't have experience with Visual Basic and never has done anything with COM / DCOM.

I have almost been able to get the sample program running using the Visual Basic editor from Word 2000. Got some minor problems but that I can solve, but when I compile only the declariation of the DLL's I don't get any error.

If I try to translate the functions to Navision, then I get an error on most of the automation servers I declare (some of the Automation Servers don't give the error). The error I get is "....Could not create an instance of the OLE control) at the moment I use the create(AUvariable) function.

I tried it on NF 2.60A (our current version) and on NF 3.60 (Cronus database, W1 version of this site), and got the same error on both situations.

If I try to manually add the DLL using Extra --> Custom Controls, Navision performes an illegal windows operation and closes. (maybe because the name of the DLL is CLCLIENT.EXE in stead of *.DLL or *.OCX???)

Does anybody know what is the best way of going further:

- Call my third party supplier and tell them their program is faulty (or at least missing some parts ?)
- Create a program in the Visual Basic editor of Word and call that with a macrofunction, which will be called from NF (how complex can we make it ?)
- Accept that I can't use these controls in NF in any way (really hate to do that)
- Any other suggestions ?

Comments

  • janpieterjanpieter Member Posts: 298
    CLClIENT.exe is probably a DCOM automation library. Navision can't just use that as is. You need to create a wrapper.

    This is best done in Visual Basic 6. Start an activx dll project. I reccomend you buy a book how to create an activx dll.
    In a world without Borders or Fences, who needs Windows and Gates?
  • SaalekSaalek Member Posts: 181
    Hi
    I Agree !
    The best solution ist create an DLL or OCX (I prefer this option because has less conflicts with Navision).

    I use this for create an communication componet to retrieve information from a Truck bascule (to weigh the truck, I don't know if "Bascule" is used in English but I don't find the translation from Spanish)

    It work fine

    Bye
  • janpieterjanpieter Member Posts: 298
    The word is familiar in dutch :mrgreen:
    In a world without Borders or Fences, who needs Windows and Gates?
  • tvandongentvandongen Member Posts: 78
    Janpieter,

    Can you explain what a wrapper is ?

    Do you know a good book for creating an activx dll. (Dutch if possible).

    Thanks.
  • janpieterjanpieter Member Posts: 298
    A wrapper dll is a dll that enables in this case navision to communicate with a component navision is normally not able to communicate with.

    Navision is a product with limitations so you have to build something between navision and the component so navision can use this component through the wrapper.

    When you create a wrapper DLL you try to program the DLL with the exact same subroutines, properties and events and the same parameters then your component. The only thing those subroutines/properties/events do in your wrapper is pass the request to your component and backwards to navision.

    I don't have references for books. I'm not a walkthrough guy. My source is MSDN but that is not in dutch and a not really a walkthrough. Though i think there have been written a lot of good books have a look at www.bol.com (oops are commercials allowed here :roll: ). Good Dutch books however i think are hard to find.

    Jan-Pieter
    In a world without Borders or Fences, who needs Windows and Gates?
Sign In or Register to comment.