using COM methods in Navision via automation variable

jksjks Member Posts: 277
Hi all,

Facing a problem.
I have created COM interface to be used in Navision. I am accessing its methods and properties in Navision using Automation variable.

It worked fine uptil now.
Then i chaned the definition of one method from ,say Add(BSTR a, BSTR b) to Add(BSTR a, BSTR b, BSTR c). ( changes done in .h, .cpp and *.idl files)

rebuild .dll successfully.
registered it with regsvr32 test.dll successfully,

but in navision i am not able to see the new definition of the Add method. it still show me add as Add(BSTR a, BSTR b)

Please help. It is really very frustrating.

Comments

  • ara3nara3n Member Posts: 9,257
    Navision still looks at old version of DLL. I believe when you build DLL, it maintains DLL versions. So navision looks at old version. Delete the global variable and insert it again. OR remove the versioning from your DLL.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jesamjesam Member Posts: 100
    Navision still looks at old version of DLL. I believe when you build DLL, it maintains DLL versions.
    It does. In COM, Interfaces are immutable. When you regsvr32 a COM DLL, it registers the Interface of the DLL in the registry.

    If you now change the public signature of your object, you are in fact changing it's interface. If you regsvr32 this new DLL without first regsvr32 /U the old DLL, you'll run into trouble.
    OR remove the versioning from your DLL.
    How would you do that ? *Every* COM DLL has an Interface, otherwise it is no COM DLL. Every Interface of a COM DLL is by definition immutable, otherwise it is not a COM DLL.
  • ara3nara3n Member Posts: 9,257
    I believe it was a activex dll. I remember Visual Studio in VB allowed disable it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jesamjesam Member Posts: 100
    I believe it was a activex dll.
    An ActiveX dll is in fact a COM DLL.
    Visual Studio in VB allowed disable it.
    I just fired up my copy of VB6 (it has been a very long time since I did that) and I think you are referring to the Project properties.
    There is a Tab called Component which has the following option :
    Version Compatibility

    Allows you to set the level of version compatibility

    No Compatibility — Compatibility not enforced.


    Project Compatibility — If checked, the Location box is active and allows you to search for the file with which this project is to be compatible. If cleared, the Location box is not available.
    For all ActiveX project types, Project Compatibility is checked by default.

    Binary Compatibility — Useful for maintaining compatibility among projects that have been compiled using your component.


    File Location Box — Displays the name and location of the file with the project is to be compatible. You can type a name and location or can use the Browse button to display the Compatible ActiveX Server dialog box where you can locate the file.

    If you change the signature of your objects, you cannot maintain Binary Compatibility. You could maintain Project compatibility, but I think this does not work when your component has been regsvr32-ed outside of your development environment.

    Anyway, to get a deep understanding of COM and why things are like they are (which you'll need anywhow if you want to be know what you're doing), read http://www.amazon.com/gp/product/073561010X/sr=8-2/qid=1142925421/ref=sr_1_2/103-0232744-8773434?%5Fencoding=UTF8
Sign In or Register to comment.