locked
Problem Webservice RRS feed

  • Question

  • User919629066 posted

    in the ATL dll project there is one function with BYTE* Parameter.
     

    STDMETHODIMP CMSDllServer::sum22(byte* aa)
    {
    	AFX_MANAGE_STATE(AfxGetStaticModuleState()); 
    	
    	for(int i=1;i<5;i++)
    	{
    		aa[i]=i;
    	}
      return S_OK;
    }

     

    in use during from this function in a windowes application c# doesnot exist no problem and array values returned to truth

     

    	byte[] Packet = new byte[5];
     
    	dllServer.sum22(ref Packet[0]);
     
           //out put :   1,2,3,4,5
    


     
    but

    the same function in a webservice returned to only first index array and exist very big problem

           byte[] Packet = new byte[5];
    	dllServer.sum22(ref Packet[0]);
       
           //out put:    1,0,0,0,0

     

     
    Frown | :( D'Oh! | :doh: Confused | :confused:
    help me pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeee

    thanx

    Monday, May 13, 2013 1:01 AM

Answers

  • User-488622176 posted

    Is there a reason you do this:

    for(int i=1;i<5;i++)
    	{
    		aa[i]=i;
    	}

    and not

    for(int i=0;i<5;i++)
    	{
    		aa[i]=i+1;
    	}

    C++ uses 0 as base index. 


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 14, 2013 9:34 AM