Page 1 of 1

Infraction of access in kernel32.dll

Posted: Tue Sep 26, 2006 2:52 pm
by goosfancito
Hi all,

I have this lines of source, and when i run my app it produce error:

Image

Code: Select all

FUNCTION ComandoCEM( cPipe, xComando)

   LOCAL xInBuffer := 101
   LOCAL xOutbuffer
   LOCAL xRespuesta

   CallNamPip( cPipe,          ;              // lpNamedPipeName
               xComando,       ;              // lpInBuffer
               Len(xComando) + 1,           ;              // nInBufferSize
               xOutBuffer,     ;              // lpOutBuffer
               1024,           ;              // nOutBufferSize
               xRespuesta,     ;              // lpBytesRead
               20000 )              // nTimeOut

   RETURN ( NIL )

//------------------------------------------------------------------------------

DLL32 FUNCTION CallNamPip( lpNamedPipeName AS STRING,;
                           @lpInBuffer AS LPSTR,;
                           nInBufferSize AS LONG, ;
                           @lpOutBuffer AS LPSTR,;
                           nOutBufferSize AS LONG, ;
                           @lpBytesRead AS LONG,;
                           nTimeOut AS LONG ) ;
               AS LONG PASCAL;
               FROM "CallNamedPipeA" LIB "KERNEL32.DLL"
Idea?

TankĀ“s

Posted: Tue Sep 26, 2006 9:27 pm
by Antonio Linares
Gustavo,

Declare lpNamedPipeName AS LPSTR and remove @ from the DLL32 FUNCTION declaration.