Error While migration asp to ASP.Net on Windows 2008 R2(64 bit) Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mahesh Burte
    New Member
    • Sep 2012
    • 1

    Error While migration asp to ASP.Net on Windows 2008 R2(64 bit) Server

    We are porting our 32 bit (ASP) application to 64 bit (ASP.NET). Current we facing problem on sending Image (binary) Data from ASPX to Com DLL.

    Below is ASPX and Com Code.

    ASPX Code:

    Dim MyStream As System.IO.Strea m
    Dim FileInByteArr As Byte() = New Byte(FileLen) {}

    'Initialize the stream.
    MyStream = PostedFile.Inpu tStream

    ' Read the file into the byte array.
    MyStream.Read(F ileInByteArr, 0, FileLen)

    objsign = CreateObject("I mgCom.Image")

    retval = objsign.SaveIma ge(xmldoc.xml, FileInByteArr, FileLen, ErrMsg1)

    if retval = 0 Then
    Errmsg = 0
    else
    Errmsg = ErrMsg1
    end if

    Com Code:

    SaveImage( VARIANT pv_request,
    VARIANT *pv_binary,
    VARIANT v_lImageSize,
    VARIANT *p_err_msg,
    VARIANT *p_retval
    )
    {
    SAFEARRAY* l_img_dtl_array ;
    unsigned char *l_ptr_temp;
    unsigned char *l_image_str;
    int l_image_len = 0;

    l_img_dtl_array = pv_binary->parray; // on 32 bit its working fine getting data correct but on 64bit window getting Cry junk data

    CM_show_debug(" \n l_img_dtl_array : %d ", l_img_dtl_array );


    l_image_len = l_img_dtl_array->rgsabound[0].cElements;

    CM_show_debug(" \n l_image_len : %d ", l_image_len);



    memset(l_image_ str,0,sizeof(l_ image_str));

    l_ptr_temp = static_cast<BYT E*> (l_img_dtl_arra y->pvData); // length goes in minus on 64 bit windows ...

    CM_show_debug(" \n l_ptr_temp : %d ", l_ptr_temp);


    memcpy(l_image_ str,l_ptr_temp, l_image_len);

    // opration to save in Database
    }

    above code is working fine on 32 bit system but on 64 bit it fails getting junk Data.

    on console output getting as mention below.

    *************** **** Windows 2003 (32 bit) Working *************** ***

    l_img_dtl_array : 922480
    l_image_len : 7429
    l_ptr_temp : 1016856

    *************** **** Windows 2008 (64 Bit) *************** ***
    l_img_dtl_array : 4829760
    l_image_len : 1
    l_ptr_temp : -2013265840

    Any kind of help or articles regarding this would be of great help.
  • JamieHowarth0
    Recognized Expert Contributor
    • May 2007
    • 537

    #2
    Hi there,

    Have you tried checking that the app pool in which ASP.NET is running has got "Enable 32-bit applications" set?

    Best,

    Benjamin

    Comment

    Working...