Differences Between the C/FRONT API DLL and the OCX

There are a number of differences between the C/FRONT API DLL and the OCX. The C/FRONT API DLL is primarily intended for C programmers, but can be used with any language and compiler that can load and use DLLs and that use the _CDECL calling convention. The OCX is primarily used for gaining easy access to Navision databases from environments like Microsoft Excel and Microsoft Word, or Microsoft Visual Basic.

The C/FRONT Reference Guide is really intended for the DLL and for the C programmer but can be used with the OCX as well. It provides some background information, and contains a considerable number of examples.

If you are acquainted with the DLL, or the C-Toolkit for Navision 3.XX (the old text-based version), it is recommended that you read the online Help for a function before you use it through the OCX - there are a number of differences. Furthermore, some functions in the DLL have no equivalent in the OCX, and there are a couple of new functions in the OCX. You should also note that errors are handled differently. For example, you cannot install your own error or message handler to replace the default one when you use the OCX.

General Differences

Functions without equivalents

There is no longer any need for the conversion functions, because functions such as GetFieldData and AssignField use the Variant data type.

The following functions therefore have no equivalents in the OCX:

Alpha_2_Str

BCD_2_Str

Date_2_Str

Date_2_YMD

HMST_2_Time

Str_2_Alpha

Str_2_BCD

Str_2_Date

Str_2_Time

Time_2_HMST

Time_2_Str

YMD_2_Date

 

Error handling is different in the OCX - see Error Handling - and you cannot replace the default error or message handler with a function of your own.

The following functions have therefore no equivalents in the OCX:

SetExceptionHandler

SetMessageShowHandler

 

When the OCX is used, there is no need for explicit initialization and de-initialization.

The following functions therefore have no equivalents in the OCX:

Exit

Init

 

The following two functions have been omitted because the changed functionality of GetFieldData makes them less necessary and also because the environments from where the OCX will typically be used do not support the use of pointers to the same degree as C does.

GetFieldDataAddr

GetFieldDataSize

 

The following function is still retained in the DLL in order to make it easier to port applications from the C-Toolkit for Navision 3.XX. This function is not needed in the OCX.

FieldDataOffset

 



© 2009 Microsoft Corporation. All rights reserved.