Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[13196] 델파이7로된 카드체크 샘플이 2010에서는 안되는 이유가 뭘까요
디오시 [] 2132 읽음    2010-04-23 00:42
이번에 포스관련 카드승인  Sample를 Delphi7소스로 받았습니다.
근데 Delphi7에서 컴파일 하면 문제가 없는데 2010에서는 다음 문장이 에러는 없는데 리턴값이 안들어오네요
유니코드때문에 문법을 바꿔야 하는거 같습니다.
NicePosSend(Byte(pchar(ip)),port,Byte(pchar(SndData)),Byte(pchar(SndSignData)),Byte(RecvData));
에서 Byte형을 보내기위해 String형을 Byte(PChar(ip)) 여기가 문제인거 같은데 어찌바꿔야 할까요.
Delphi7실행파일과 2010실행파일 소스도 올려드립니다.

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Edit2: TEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  function NicePosSend(btNiceIP: Byte;iNicePort: integer; sSendData:Byte; sSendSignData: Byte; sReceveData: Byte): integer; stdcall; external 'NicePosV205.dll' name 'Pos_Send';
var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var ip: string;
    port: integer;
    SndData: string;
    SndSignData: string;
    RecvData: pchar;
    sRecvData: string;
    aryRecvData: array[0..450] of char;
    nRet: integer;
    Header : String;
    Card : String;
    Pay,Etc : String;

begin
  ip := '211.33.136.1';
  port := 40777;
  nRet := 0;
  FillChar(aryRecvData,Sizeof(aryRecvData),#20);
  RecvData := aryRecvData;
  SndData := '0256TAX23933000020323041054020020H1';

  // nRet에서 리턴값이 Delphi7에는 들어오는데 2010에서는 값이 안들어오네요
  nRet :=   NicePosSend(Byte(pchar(ip)),port,Byte(pchar(SndData)),Byte(pchar(SndSignData)),Byte(RecvData));

+ -

관련 글 리스트
13196 델파이7로된 카드체크 샘플이 2010에서는 안되는 이유가 뭘까요 디오시 2132 2010/04/23
13199     Re:감사합니다. 해결했어요..... 디오시 1978 2010/04/23
13197     Re:델파이7로된 카드체크 샘플이 2010에서는 안되는 이유가 뭘까요 장성호 2812 2010/04/23
13198         Re:Re:델파이7로된 카드체크 샘플이 2010에서는 안되는 이유가 뭘까요 박지훈.임프 2226 2010/04/23
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.