  ! This software DLOBJS.F90 is part of the Compaq Visual Fortran kit.
  ! 
  ! This software is provided as an example that demonstrates a particular
  ! feature/function of the licensed product. The software is not intended to
  ! provide a complete solution to any application problem but rather is provided
  ! as a teaching mechanism.
  ! 
  ! Users may incorporate any part of this sample into their own source after 
  ! making appropriate changes to make it suitable for the intended application.

	MODULE DLOBJS
	IMPLICIT NONE

  ! Object Pointers

	  INTEGER*4 dsappl
	  INTEGER*4 dsiappl
	  INTEGER*4 dsdocs
	  INTEGER*4 dsidocs
	  INTEGER*4 dsdoc
	  INTEGER*4 dsigendoc
	  INTEGER*4 dstextdoc
	  INTEGER*4 dstextsel
	  INTEGER*4 dsitextsel

  ! BSTRs
	  INTEGER*4 bstrFilename

	CONTAINS

	  SUBROUTINE INITOBJECTS()
		  dsappl = 0
		  dsiappl = 0
		  dsdocs = 0
		  dsidocs = 0
		  dsdoc = 0
		  dsigendoc = 0
		  dstextdoc = 0
		  dstextsel = 0
		  dsitextsel = 0

		  bstrFilename = 0
	  END SUBROUTINE
	  
	  SUBROUTINE RELEASEOBJECTS()
		  USE DFCOM
		  INTEGER*4 status
		  IF (dsappl /= 0) status = COMRELEASEOBJECT ( dsappl )
		  IF (dsiappl /= 0) status = COMRELEASEOBJECT ( dsiappl )
		  IF (dsdocs /= 0) status = COMRELEASEOBJECT ( dsdocs )
		  IF (dsidocs /= 0) status = COMRELEASEOBJECT ( dsidocs )
		  IF (dsdoc /= 0) status = COMRELEASEOBJECT ( dsdoc )
		  IF (dsigendoc /= 0) status = COMRELEASEOBJECT ( dsigendoc )
		  IF (dstextdoc /= 0) status = COMRELEASEOBJECT ( dstextdoc )
		  IF (dstextsel /= 0) status = COMRELEASEOBJECT ( dstextsel )
		  IF (dsitextsel /= 0) status = COMRELEASEOBJECT ( dsitextsel )

		  IF (bstrFilename /= 0) CALL SysFreeString(bstrFilename)
	  END SUBROUTINE


	END MODULE