Thanks Tom,

I finally came to the same conclusion about an hour earlier than the
time stamp on your post.  Bits & Bytes confuse me a little.
Below is example of the code that I'm currently testing with, once I
get beyond making sure I'm getting good io to and from the DLL I'll
make loops to write/read through the binaries.

PROBLEM: I still seem to have a problem with passing
the "real"(doubles) though. 
  INTEGER Params
    nParams   = new Binary(20);   //   5 ints * 4 bytes =  20
    nParams.dWord( 0,  4);  // Numfps
    nParams.dWord( 4,  2);  // Numrm
    nParams.dWord( 8,100);  // Numpatsmx
    nParams.dWord(12,100);  // Numelsmx
    nParams.dWord(16, 60);  // Limsecs

  REAL/DOUBLE Params
    dParams   = new Binary(32);   //   4 dbl  * 8 bytes =  32
    dParams.dWord( 0,0.3400);  //  NeutralAxis
    dParams.dWord( 8,3.1900);  //  WtPerFt
    dParams.dWord(16,0.0000);  //  Cpcut
    dParams.dWord(24,3.14159); //  PI

The DLL is reading the integers correctly (dll creates a text log
with info on values it's reading), but is not reading the real/dbl
params correctly.  As you can see from:
    nParams   = new Binary(20);   //   5 ints * 4 bytes =  20
    dParams   = new Binary(32);   //   4 dbl  * 8 bytes =  32

I'm allocating 4 bytes for each Integer passed and 8 bytes for
the real/dbls.  In your comment you seem to indicate 8 bytes
allocated for integers? Should I be allocating 8?  Actually I tried
allocating 8 for the integers and the DLL didn't read it correctly.

With regard to the real/dbls, I started with 8 as above (didn't work)
and then proceeded to test progressively higher 8  16  32  64  128
512 1024 2028 4056 bytes allocated for each real/dbl (all to no
avail).

Additionally the code compiles without error but does throw warnings
that the real/dbl test data will loose precision.

Lastly, my final task with this DLL will be to read the values for
the solution written to the binaries.  I've never done this before,
so if you had any helpful hints I'd be grateful.

Thanks for you help
Tim Peterson













SPONSORED LINKS
Computer part Microsoft axapta


YAHOO! GROUPS LINKS




Reply via email to