ASNA DataGate® Component Suite 5.0

Contents

Important Issues

Installing DCS

Accessing the Type Library

Accessing the Help File

Examples and Sample Programs

Deployment

.NET Interoperability

 

 

Important Issues:

This release contains changes that can potentially break existing programs written against a previous release of the DataGate Component Suite library, adbactvx.dll.  These changes were required to facilitate future upgrades and add required functionality.  The modifications are centered primarily to the PrintFileContent object and its default interface, IPrintFileContent. 

If your DCS program fits all of the following criteria, you will need to at least rebuild it using the new type library before deploying the program with this new release. 

1.        Uses the PrintFileContent object for print file access.

2.        “Early binding” or “vtable binding” programming language or COM support; for example C++ or Visual Basic 6 .EXE or component compilation.  .NET Interop COM support uses early binding as well.  AVR programs and scripted environments such as Active Server Pages use “late binding” and should not be affected. 

If regeneration is necessary, follow these steps to make sure you pick up the changes in your program:

1.        Register adbactvx.dll.  This is normally done during the “setup” installation of DCS, but if you want to be sure, you can use the REGSVR32.EXE command.  Click Start, Run, then enter REGSVR32.EXE <full path to adbactvx.dll here>.  For example: regsvr32 "C:\Program Files\Common Files\ASNA Shared\adbactvx.dll"

2.        Regenerate your program.  Generally, this will involve recompiling or rebuilding into a binary format. 

If your program does not use PrintFileContent or does not require early binding, then regeneration of the program should not be necessary. 

If you are programming in a more strongly typed language such as C++ or C#, you may have a bit more work to do.  In the new type library, IPrintFileContent no longer inherits from the IFileContent interface, as it did in the previous release.  IPrintFileContent still contains all of the methods of IFileContent that are relevant to, and implemented for print files.  But several methods that are irrelevant, such as SeekKey, etc., have been removed.  This is significant if your vtable-based code expects IPrintFileContent pointers to also be usable as IFileContent pointers.  If so, then you could get compilation errors when you rebuild.  Unfortunately, in this case you will be forced to redesign your print file access logic. 

Also of significance is the use of the Record.SetNew and Record.Add methods.  Note that these methods have been changed to expect an IDispatch (Object in VB6) parameter rather than IFileContent.  This is because these methods can now accept either an IFileContent or an IPrintFileContent parameter.  This change shouldn’t have any effect on your C++ code that passes COM pointers to these methods, since IPrintFileContent and IFileContent both still derive from IDispatch.  In C# however, Interop forces you to type cast an object reference to the required type in order to use it in a method call.  Thus, your C# program may have code that looks like the following:

  ADBAx.PrintFileContent printFile = new

       ADBAx.PrintFileContentClass();

  ADBAx.Record recHeader = new ADBAx.RecordClass();

. . . other code here to open the print file . . .

  recHeader.SetNew((ADBAx.FileContent)printFile, "rptHeader");

. . . other code here to initialize record . . .

  recHeader.Add ((ADBAx.FileContent)printFile);

Notice that in the recHeader.SetNew and recHeader.Add calls, the PrintFile object reference is being cast to a FileContent reference.  Because of the way Interop exposes COM interfaces, this code will compile without errors with the new type library.  However, at run time, the casts will fail, because IPrintFileContent references are no longer also IFileContent references.  Simply removing the casts as below will allow the code to work with the new DCS release, because the methods now accept generic object references to PrintFileContent and FileContent objects. 

    . . . (other code here to open the print file) . . .

   recHeader.SetNew(printFile, "rptHeader");

   . . . (other code here to initialize record) . . .

   recHeader.Add (printFile);

Back to Top

Installing DCS

There is a file to assist you in properly installing/uninstalling DataGate Component Suite.  The file is titled DCS_Installation_Notes.htm, and can be located in C:\Program Files\Common Files\ASNA Shared, or from the ASNA Suite CD Browser.

Back to Top

Accessing the Type Library

The first step to accessing and using the ASNA DataGate Component Suite after it has been installed, is to reference the type library, so you can "see" the objects it contains. 

To Access the DCS Type Library

1.    Set a reference to the DCS Type Library by using the application's References dialog box. To open the References dialog box, select References (which may reside on the Tools menu, Project menu, etc.  

2.    Select the reference titled "ASNA DataGate Component Suite Type Library" and select OK.

3.    To view the objects within the Type Library, select the Object Browser menu option, which is typically from the View menu, or by pressing F2 or Ctrl+F2 (depending upon the application used). 

4.    Click on the arrow to the right of the listing of referenced Type Libraries for this project, and select ADBAX, which is strictly the namespace qualifier for the DCS Type Library.