diff options
author | Alexey Kulakov <panda75@bk.ru> | 2014-03-12 18:07:10 +0000 |
---|---|---|
committer | Alexey Kulakov <panda75@bk.ru> | 2014-03-12 18:07:10 +0000 |
commit | 156f0f7a236221c615e7b9e32741935bbe5e6644 (patch) | |
tree | 094ff53d26620a983f1c457286761756e12e7f5d | |
parent | ce11751a330c954e08e2ca4bbe2285bfbc0c4fb3 (diff) |
Miranda API fix
small actman optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@8585 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | include/delphi/m_core.inc | 7 | ||||
-rw-r--r-- | plugins/Actman30/iac_call.pas | 12 | ||||
-rw-r--r-- | plugins/ExternalAPI/delphi/m_dropbox.inc | 22 |
3 files changed, 37 insertions, 4 deletions
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index be65468933..dc999a0d7c 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -133,6 +133,7 @@ function db_event_add(hContact:TMCONTACT; dbei:PDBEVENTINFO):THANDLE; stdcall; Gets the number of events in the chain belonging to a contact in the database.
Returns the number of events in the chain owned by hContact or -1 if hContact
is invalid. They can be retrieved using the db_event_first/last() services.
+Returns 0 for Subcontacts (use db_event_last to recognize empty history)
}
function db_event_count(hContact:TMCONTACT):int; stdcall;
external CoreDLL name 'db_event_count';
@@ -579,10 +580,12 @@ procedure List_ObjCopy(src:PSortedList; dst:PSortedList; size:size_t); stdcall; function mir_createLog(pszName:PAnsiChar; ptszDescr, ptszFile:PWideChar; options:Cardinal):THANDLE; stdcall;
external CoreDLL name 'mir_createLog';
+procedure mir_closeLog(hLogger:THANDLE); stdcall;
+ external CoreDLL name 'mir_closeLog';
-function mir_writeLogA(hLog:THANDLE; format:PAnsiChar):int; cdecl;
+function mir_writeLogA(hLogger:THANDLE; format:PAnsiChar):int; cdecl;
external CoreDLL name 'mir_writeLogA';
-function mir_writeLogW(hLog:THANDLE; format:PWideChar):int; cdecl;
+function mir_writeLogW(hLogger:THANDLE; format:PWideChar):int; cdecl;
external CoreDLL name 'mir_writeLogW';
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Actman30/iac_call.pas b/plugins/Actman30/iac_call.pas index 074646f149..80a944ec0b 100644 --- a/plugins/Actman30/iac_call.pas +++ b/plugins/Actman30/iac_call.pas @@ -113,6 +113,7 @@ var res:LRESULT;
largv:array [0..MaxArgCount-1] of uint_ptr;
i:integer;
+ loaded:bool;
begin
result:=0;
if (dllname =nil) or (dllname^ =#0) or
@@ -122,7 +123,13 @@ begin exit;
end;
- hDLL:=LoadLibraryA(dllname);
+ loaded:=false;
+ hDLL:=GetModuleHandleA(dllname);
+ if hDLL=0 then
+ begin
+ loaded:=true;
+ hDLL:=LoadLibraryA(dllname);
+ end;
// hDLL:=GetDllHandle(dllname);
if hDLL<>0 then
begin
@@ -220,7 +227,8 @@ begin end;
// FreeDllHandle(hDLL);
- FreeLibrary(hDLL);
+ if loaded then
+ FreeLibrary(hDLL);
end;
end;
diff --git a/plugins/ExternalAPI/delphi/m_dropbox.inc b/plugins/ExternalAPI/delphi/m_dropbox.inc new file mode 100644 index 0000000000..e2b6ab0cba --- /dev/null +++ b/plugins/ExternalAPI/delphi/m_dropbox.inc @@ -0,0 +1,22 @@ +{$IFNDEF M_DROPBOX}
+{$DEFINE M_DROPBOX}
+
+const
+//upload file on Dropbox
+//wParam = (MCONTACT)hContact
+//lParam = (LPARAM)(const wchar_t*)path - full path to file
+// returns file htansfer handle or NULL on failure
+// returns immediately, without waiting for the send
+ MS_DROPBOX_SEND_FILE:PAnsiChar = 'Dropbox/Send/File';
+
+// notifies a caller about file send end
+// wParam = (MCONTACT)hContact
+// lParam = (LPARAM)(const wchar_t*)url - "\r\n" separated download link to file
+ ME_DROPBOX_SEND_SUCCEEDED:PAnsiChar = 'Dropbox/Send/Succeeded';
+
+// notifies a caller about file send failure
+// wParam = (MCONTACT)hContact
+// lParam = (LPARAM)(HANDLE)hProcess
+ ME_DROPBOX_SEND_FAILED:PAnsiChar = 'Dropbox/Send/Failed';
+
+{$ENDIF}
|