Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
Ошибка DLL
|
|||
|---|---|---|---|
|
#18+
Кто знает подскажите пожалуйста, почему при закрытии моего приложения появляется ошибка типа Invalid pointer opration и как избавится от нее. Ниже привожу код DLL фрагмент программы вызивающей функцию library fvigr; { Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results. This applies to all strings passed to and from your DLL--even those that are nested in records and classes. ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL. To avoid using BORLNDMM.DLL, pass string information using PChar or ShortString parameters. } uses SysUtils,Messages, Variants,Windows,Controls, Classes; {$R *.res} function StrToOem(const AnsiStr: string): string;stdcall; {$IFNDEF WIN32} var Src, Dest: array[0..255] of Char; {$ENDIF} begin SetLength(Result, Length(AnsiStr)); if Length(Result) > 0 then {$IFDEF WIN32} AnsiToOem(PChar(AnsiStr), PChar(Result)); {$ELSE} begin StrPCopy(Src, AnsiStr); AnsiToOem(Src, Dest); Result := StrPas(Dest); end; {$ENDIF} end; function OemToAnsiStr(const OemStr: string): string;stdcall; begin SetLength(Result, Length(OemStr)); if Length(Result) > 0 then {$IFDEF WIN32} OemToCharBuff(PChar(OemStr), PChar(Result), Length(Result)); {$ELSE} OemToAnsiBuff(@OemStr[1], @Result[1], Length(Result)); {$ENDIF} end; function intform (s:string):boolean;stdcall; const digit=['0','1','2','3','4','5','6','7','8','9']; begin result:=(length(s)=1) and (s[1] in digit); end; function typnum (tp:string):boolean;stdcall; const digit=['0','1','2','3','4','5','6','7','8','9']; begin result:= (length(tp)=2) and (tp[1] in digit)and (tp[2] in digit); end; function ValidDate(const d: Tdate): Boolean;stdcall; BEGIN Result := True; try Datetostr(d); except ON EConvertError DO Result := False; end; END; function SqlUpdate(Values : string; TablName : string; ColNames : string; WhereClause : string) : string;stdcall; const // Возврат и перевод каретки CrLf = #13#10; var RetVar: string; //i : integer; begin RetVar := 'update ' + tablname + ' set ' + CrLf; RetVar := RetVar + ColNames + '=' + values + ' '; Delete(RetVar,length(RetVar),1); RetVar := RetVar + CrLf + 'where '+ colnames+'='+ WhereClause; Result := RetVar; end; exports SqlUpdate, intform, typnum, ValidDate, OemToAnsiStr, StrToOem; end. программа unit tecoper; interface uses sharemem,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, DBTables, StdCtrls, DbPrgrss,roz; type Ttoper = class(TForm) Button1: TButton; Query1: TQuery; DataSource1: TDataSource; DBProgress1: TDBProgress; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var toper: Ttoper; Year, Month, Day:word; implementation {$R *.dfm} procedure Ttoper.Button1Click(Sender: TObject); var i:integer; old_cod:array [1..13] of string; new_cod:array [1..13] of string; old_num:array [1..13] of string; new_num:array [1..13] of string; begin old_cod[1]:='01'; old_cod[2]:='02'; old_cod[3]:='03'; old_cod[4]:='05'; old_cod[5]:='43'; old_cod[6]:='23'; old_cod[7]:='32'; old_cod[8]:='33'; old_cod[9]:='34'; old_cod[10]:='36'; old_cod[11]:='35'; old_cod[12]:='99'; old_cod[13]:='37'; new_cod[1]:='11'; new_cod[2]:='12'; new_cod[3]:='12'; new_cod[4]:='41'; new_cod[5]:='13'; new_cod[6]:='44'; new_cod[7]:='61'; new_cod[8]:='67'; new_cod[9]:='62'; new_cod[10]:='63'; new_cod[11]:='65'; new_cod[12]:='47'; new_cod[13]:='61'; for i:=1 to 13 do begin query1.sql.Clear; query1.SQL.Text:=SqlUpdate(ansiquotedstr(new_cod ,''''),'amt','c_tec_oper', ansiquotedstr(old_cod,'''')); query1.ExecSQL; end; showmessage('Конвертирование техопераций завершено'); end; end. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.12.2003, 15:18 |
|
||
|
Ошибка DLL
|
|||
|---|---|---|---|
|
#18+
может для начала это прочитать? { Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results. This applies to all strings passed to and from your DLL--even those that are nested in records and classes. ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL. To avoid using BORLNDMM.DLL, pass string information using PChar or ShortString parameters. } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.12.2003, 15:27 |
|
||
|
Ошибка DLL
|
|||
|---|---|---|---|
|
#18+
А если добавить ShareMem к DLL первым номером? Как и рекомендуется в текстике вначале? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.12.2003, 15:28 |
|
||
|
Ошибка DLL
|
|||
|---|---|---|---|
|
#18+
ну начнем с того... Автор топика судя по всему новичек в dll, отсюда вывод НИКАКИХ СТРОК НЕ ПЕРЕДАВАТЬ И НЕ ПОЛУЧАТЬ В/ИЗ DLL . Всякие ShareMem от лукавого и юзать их настоятельно не рекомендую. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.12.2003, 03:08 |
|
||
|
|

start [/forum/topic.php?fid=58&fpage=1970&tid=2115356]: |
0ms |
get settings: |
8ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
33ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
43ms |
get tp. blocked users: |
1ms |
| others: | 222ms |
| total: | 340ms |

| 0 / 0 |
