Jaa


New way to initialise C/Front with VB in Sp1 (undocumented change)

In C/Front for Microsoft Dynamics NAV Version 5 SP1, it is no longer possible to initialise it in the usual way from Visual Basic. Often you would initialise C/Front like this:

Dim CFR As Microsoft.Navision.CFront.CFrontDotNet

CFR = New Microsoft.Navision.CFront.CFrontDotNet

 

But with SP1, this syntax will give you the following error in Visual Studio:

Error 1 'Microsoft.Navision.CFront.CFrontDotNet.Private Sub New()' is not accessible in this context because it is 'Private'.

This way to initialise C/Front was removed because there were various problems (mainly with memory corruption) when disposing C/Front. So to stabilise it, the public constructor of CFrontDotNet was removed. Now, initialise it like this instead:

Dim

CFR As Microsoft.Navision.CFront.CFrontDotNet

CFR = Microsoft.Navision.CFront.CFrontDotNet.Instance

i.e. don't use "New", and add ".Instance". The functionality remains unchanged.

 

 

Lars Lohndorf-Larsen

Microsoft Dynamics UK

Microsoft Customer Service and Support (CSS) EMEA

These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

Comments

  • Anonymous
    June 14, 2008
    In der Version Microsoft Dynamics NAV 5 SP1 wurden Änderungen in der Initialisierung der C/Fron