Q&A

  • DLL에서 폼을 생성하면 Access Violation에러가 납니다.
DLL 을 만들었습니다....
일반 프로그램에서 폼 Create 하여 사용하면 괜찮은데...
DLL로 만들어서 사용하면
        access violation at address 41001C14 in module 'BORLNDMM.DLL'.
        read of address FFFFFFFF.
Error 가 납니다.     조회기능이며 StringGrid 를 사용했습니다.
조회화면에서 두번까지는 조회가 가능하며 세번째 조회할때 Error가 발생
합니다..           고수님들의 답변 부탁드립니다....   꾸벅...




//   coding   //

      Screen.Cursor := crHourGlass;

      rm1 := 0;

      for i := 0 to sgd_mri01.ColCount - 1 do
      begin
           for j := 0 to sgd_mri01.RowCount - 1 do
           begin
                sgd_mri01.cells[i, j] := '';
           end;
      end;

      search_date := FormatDateTime('yyyy-mm-dd', dtp_rsv_dte.date);

      rm1 :=  r_d_03_sel_rsv_view ( search_date,
                                   labem_cd,
                                   labrm_cd,
                                   labrm_nm,
                                   rsv_time,
                                   patsect,
                                   tst_stat );

      if RpcCallNoError(Sel, rm1, 'sr_d_03_sel_rsv_view', RpcErrorMsg) then
      begin

           if rm1 = 0 then
           begin
                for i := 0 to sgd_mri01.ColCount - 1  do
                begin
                     for j := 0 to sgd_mri01.RowCount - 1 do
                     begin
                          sgd_mri01.cells[i, j] := '';
                     end;
                end;
           end
           else
           begin

                for i := 0 to rm1 - 1 do
                begin

                     if (labrm_nm[i] <> '') and (sgd_mri01.cells[0, 0] = '') then
                     begin
                          sgd_mri01.Cells[0, 0]  := AlignedText(Font.Handle, Trim(labrm_nm[i]), sgd_mri01.ColWidths[0], taLeftJustify);

                     end;

                     if (tst_stat[i] = 'E') or (tst_stat[i] = 'D') or (tst_stat[i] = 'N') then
                         sgd_mri01.cells[i + 1, 0] := 'Y'
                     else if (tst_stat[i] = 'A') or (tst_stat[i] = 'C') then
                         sgd_mri01.cells[i + 1, 0] := 'N'
                     else
                         sgd_mri01.cells[i + 1, 0] := '';
                end;
           end;

      end;

      Screen.Cursor := crDefault;
0  COMMENTS