Q&A

  • comdrv32 컴포넌트에서 에러가 발생합니다(소스 첨부)
언제서 부터인가 이 컴포넌트가 에러가 뜹니다.



function TCommPortDriver.SendData( DataPtr: pointer; DataSize: integer ): nteger;

var nToSend, nsent: integer;

t1: longint;

begin

{ 0 bytes sent }

Result := 0;

{ Do nothing if not connected }

if not Connected then

exit;

{ Current time }

t1 := GetTickCount;

{ Loop until all data sent or timeout occurred }

while DataSize > 0 do

begin

{ Get output buffer free space }

nToSend := OutFreeSpace;

{ If output buffer has some free space... }

if nToSend > 0 then

begin

{ Don't send more bytes than we actually have to send }

if nToSend > DataSize then

nToSend := DataSize;

{ Send }

이부분-> WriteFile( FComPortHandle, DataPtr^, DataSize, nsent, nil ); <- 이부분

{ Update number of bytes sent }

Result := Result + abs(nsent);

{ Decrease the count of bytes to send }

DataSize := DataSize - abs(nsent);

{ Get current time }

t1 := GetTickCount;

{ Continue. This skips the time check below (don't stop

trasmitting if the FOutputTimeout is set too low) }

continue;

end;

{ Buffer is full. If we are waiting too long then

invert the number of bytes sent and exit }

if (GetTickCount-t1) > FOutputTimeout then

begin

Result := -Result;

exit;

end;

end;

end;



[Error] ComDrv32.pas(611): Types of actual and formal var parameters must be identical

[Warning] ComDrv32.pas(624): Combining signed and unsigned types - widened both operands

[Fatal Error] dclusr50.dpk(34): Could not compile used unit '........Backupcomponentcomm32ComDrv32.pas'



이런 에러 메세지가....



그럼 답변 부탁드립니다.





혹시 이것에 대해 아시는 분없나요?



또는 해결책이나요...

고수님 리플부탁드립니다.

2  COMMENTS
  • Profile
    황광일 2000.11.18 04:20
    [Error] ComDrv32.pas(611): Types of actual and formal var parameters must be identical



    요 에러메시지가 떴따...하면 windows Api에 인수를 넘길때 인수형이 안 맞는게

    있다...라는 뜻입니다..



    이부분-> WriteFile( FComPortHandle, DataPtr^, DataSize, nsent, nil ); <- 이부분



    즉... 이런 경우는 주로 DELPHI3용으로 맹글었던거이 DELPHI4,5형으로 바뀌면서..

    생기는 문제로서

    INT64를 지원한 때부터 저런 에러메시지를 만나게 될 겁니다.



    컴포넌트의 소스를 참고하셔서...

    DataSize, nsent의 형이 Integer인지 DWORD인지...형을 살펴서..

    같은 형으로 DataSize와 nSent를 맞춰 선언해주시면...

    통과가 될 것입니다..



    그럼..













    초보 wrote:

    > 언제서 부터인가 이 컴포넌트가 에러가 뜹니다.

    >

    > function TCommPortDriver.SendData( DataPtr: pointer; DataSize: integer ): nteger;

    > var nToSend, nsent: integer;

    > t1: longint;

    > begin

    > { 0 bytes sent }

    > Result := 0;

    > { Do nothing if not connected }

    > if not Connected then

    > exit;

    > { Current time }

    > t1 := GetTickCount;

    > { Loop until all data sent or timeout occurred }

    > while DataSize > 0 do

    > begin

    > { Get output buffer free space }

    > nToSend := OutFreeSpace;

    > { If output buffer has some free space... }

    > if nToSend > 0 then

    > begin

    > { Don't send more bytes than we actually have to send }

    > if nToSend > DataSize then

    > nToSend := DataSize;

    > { Send }

    > 이부분-> WriteFile( FComPortHandle, DataPtr^, DataSize, nsent, nil ); <- 이부분

    > { Update number of bytes sent }

    > Result := Result + abs(nsent);

    > { Decrease the count of bytes to send }

    > DataSize := DataSize - abs(nsent);

    > { Get current time }

    > t1 := GetTickCount;

    > { Continue. This skips the time check below (don't stop

    > trasmitting if the FOutputTimeout is set too low) }

    > continue;

    > end;

    > { Buffer is full. If we are waiting too long then

    > invert the number of bytes sent and exit }

    > if (GetTickCount-t1) > FOutputTimeout then

    > begin

    > Result := -Result;

    > exit;

    > end;

    > end;

    > end;

    >

    > [Error] ComDrv32.pas(611): Types of actual and formal var parameters must be identical

    > [Warning] ComDrv32.pas(624): Combining signed and unsigned types - widened both operands

    > [Fatal Error] dclusr50.dpk(34): Could not compile used unit '........Backupcomponentcomm32ComDrv32.pas'

    >

    > 이런 에러 메세지가....

    >

    > 그럼 답변 부탁드립니다.

    >

    >

    > 혹시 이것에 대해 아시는 분없나요?

    >

    > 또는 해결책이나요...

    > 고수님 리플부탁드립니다.

  • Profile
    정성훈 2000.11.18 04:09
    안녕하세요.

    저도 몇번 당해본건데. 그 컴퍼넌트 제거했다가 다시 설치해보세요..

    전 그렇게 했는데..되더군요..

    자세한건.저도 초보라..돔을 못드리네요..그럼..



    초보 wrote:

    > 언제서 부터인가 이 컴포넌트가 에러가 뜹니다.

    >

    > function TCommPortDriver.SendData( DataPtr: pointer; DataSize: integer ): nteger;

    > var nToSend, nsent: integer;

    > t1: longint;

    > begin

    > { 0 bytes sent }

    > Result := 0;

    > { Do nothing if not connected }

    > if not Connected then

    > exit;

    > { Current time }

    > t1 := GetTickCount;

    > { Loop until all data sent or timeout occurred }

    > while DataSize > 0 do

    > begin

    > { Get output buffer free space }

    > nToSend := OutFreeSpace;

    > { If output buffer has some free space... }

    > if nToSend > 0 then

    > begin

    > { Don't send more bytes than we actually have to send }

    > if nToSend > DataSize then

    > nToSend := DataSize;

    > { Send }

    > 이부분-> WriteFile( FComPortHandle, DataPtr^, DataSize, nsent, nil ); <- 이부분

    > { Update number of bytes sent }

    > Result := Result + abs(nsent);

    > { Decrease the count of bytes to send }

    > DataSize := DataSize - abs(nsent);

    > { Get current time }

    > t1 := GetTickCount;

    > { Continue. This skips the time check below (don't stop

    > trasmitting if the FOutputTimeout is set too low) }

    > continue;

    > end;

    > { Buffer is full. If we are waiting too long then

    > invert the number of bytes sent and exit }

    > if (GetTickCount-t1) > FOutputTimeout then

    > begin

    > Result := -Result;

    > exit;

    > end;

    > end;

    > end;

    >

    > [Error] ComDrv32.pas(611): Types of actual and formal var parameters must be identical

    > [Warning] ComDrv32.pas(624): Combining signed and unsigned types - widened both operands

    > [Fatal Error] dclusr50.dpk(34): Could not compile used unit '........Backupcomponentcomm32ComDrv32.pas'

    >

    > 이런 에러 메세지가....

    >

    > 그럼 답변 부탁드립니다.

    >

    >

    > 혹시 이것에 대해 아시는 분없나요?

    >

    > 또는 해결책이나요...

    > 고수님 리플부탁드립니다.