-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Let me setup the environment.  I have 2 machines:

(A) windows 2000 server pro, activeperl 5.8.4, visualstudio 6, vertex 3.0 sales
tax software, 1.2 GB ram

(B) windows 2000 server pro, activeperl 5.8.4, visualstudio 6, vertex 3.0 sales
tax software. 1 GB ram

Both have Service pack 4 installed.

I have inline::c modules that wraps the vertex libraries so I can use them from
perl.  The libraries are Vst.lib & Location.lib (There are corresponding Vst.dll
& Location.dll for the vertex applications)

The code will follow, but the problem is that on the machine (A) it compiles and
runs just fine.  On machine (B) I get an exception:

"The instruction at "0x029e2d99" referenced memory at "0x029a322c". The memory
could not be "written""

When I try to debug it, I get
"Unhandled exception in perl.exe (VST.DLL): 0xC0000005: Access Violation"


Needless to say I have no idea where to look next.

Any hints?  Ideas?

Thanks.


The beginning of the vertex.pm is:

__BEGIN__

package vertex;

use Exporter ();

@ISA = qw(Exporter);
@EXPORT = qw(openVertex calcTaxRate closeVertex);

use Inline Config =>
        NAME => 'vertex',
        DIRECTORY => '/opt/project/vertex/_Inline',
        ENABLE => 'PRINT_INFO',
        ENABLE => 'BUILD_NOISY',
        ;

use Inline C => Config =>
                ENABLE => AUTOWRAP,
                LIBS => '-L/opt/project/vertex/lib -lVst',
                INC => '-I/opt/project/vertex/include',
                ;

use Inline C;
Inline->init;

1;

__DATA__
__C__
#ifndef PORT_WINDOWS_EXE
#define PORT_WINDOWS_EXE
#endif

#include "port.h"   /* Resolves porting issues between operating systems */
#include "loc.h"    /* Location module function prototypes */
.....
__END__

and the beginning of the geocoder.pm is:

__BEGIN__

package geocoder;

use Exporter ();

@ISA = qw(Exporter);
@EXPORT = qw(openGeoCoder getGeoCode closeGeoCoder);

use Inline Config =>
        NAME => 'geocoder',
        DIRECTORY => '/opt/project/vertex/_Inline',
        ENABLE => 'PRINT_INFO',
        ENABLE => 'BUILD_NOISY',
        DISABLE => 'SAFEMODE',
        ;

use Inline C => Config =>
                ENABLE => AUTOWRAP,
                LIBS => '-L/opt/project/vertex/lib -lLocation',
                INC => '-I/opt/project/vertex/include'
                ;

use Inline C;
Inline->init;

1;

__DATA__
__C__

#ifndef PORT_WINDOWS_EXE
#define PORT_WINDOWS_EXE
#endif

#include "port.h"   /* Resolves porting issues between operating systems */
#include "loc.h"    /* Location module function prototypes */
...
__END__

I have a wrapper library, vertexWrapper.pm:

__BEGIN__
# TAX_RATE.pl
require      Exporter;
@ISA       = qw(Exporter);
@EXPORT    = qw(openVertexDB taxRate closeVertexDB openGeoCoderDB geoCode
closeGeoCoderDB);

use vertex;
use geocoder;

my $DEBUG=0;
my $INDOFFGEO = 265101270;
my $id = "1";
my $vertexInit=0;
my $geoCoderInit=0;

sub openVertexDB {
  shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
  openVertex();
  $vertexInit=1;
  return 1;
}

sub closeVertexDB {
  shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
  closeVertex();
  $vertexInit=0;
  return 1;
}

sub openGeoCoderDB {
  shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
  openGeoCoder();
  $geoCoderInit=1;
  return 1;
}

sub closeGeoCoderDB {
  shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
  closeGeoCoder();
  $geoCoderInit=0;
  return 1;
}

## Can be called with only a geocode, else the rest are NULL.
#
# args are 1) GEOCODE
#          2) $AMOUNT
#          3) Customer Code
#          4) Customer Class Code
#
# return = tax
#
sub taxRate {
  shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
  my ($arg1,$amount,$custCd,$custClassCd) = @_;
  my ($geoCode) = $arg1 =~ /(\d+)/;
  my $tax;
  if($geoCode){
    openVertex() unless $vertexInit;
    $tax=&calcTaxRate($id,$geoCode,$amount,$INDOFFGEO,$custCd,$custClassCd);
    closeVertex() unless $vertexInit;
    if ($DEBUG) {
      printf STDERR "ID:                |%s|\n", $id;
      printf STDERR "GEOCODE:           |%s|\n", $geoCode;
      printf STDERR "TAX:               |%7.5f|\n\n", $tax;
      printf STDERR "TAX RATE:          |%7.5f|\n\n", $tax/$amount;
    }
    return $tax;
  }
  return -1;
}
__END__

Thanks.
- --
Brian Millett
[EMAIL PROTECTED]   "Heaven can not exist,
(636) 458-9106       If the family is not eternal"
 6B-GSCTHP                 F. Ballard Washburn




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Remi - http://enigmail.mozdev.org

iD8DBQFGcEwqDVN3ZP5gvv0RAkFRAJ0euNvdpgx63H/FXfVwqy72XMoE4ACgixQo
pMMlHoXMM1/BZAuVCCCibl4=
=OqkT
-----END PGP SIGNATURE-----

Reply via email to