using COM methods in Navision via automation variable
jks
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.
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.
0
Comments
-
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.0
-
It does. In COM, Interfaces are immutable. When you regsvr32 a COM DLL, it registers the Interface of the DLL in the registry.Navision still looks at old version of DLL. I believe when you build DLL, it maintains DLL versions.
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.
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.OR remove the versioning from your DLL.0 -
I believe it was a activex dll. I remember Visual Studio in VB allowed disable it.0
-
An ActiveX dll is in fact a COM DLL.I believe it was a activex dll.
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.Visual Studio in VB allowed disable it.
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=UTF80
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
