From f04d64869f3b1de54fb343f28f955584780001b8 Mon Sep 17 00:00:00 2001 From: mataes2007 Date: Sat, 26 Nov 2011 15:41:10 +0000 Subject: Project folders rename part 3 git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@215 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- SecureIM/rtfconv.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 SecureIM/rtfconv.cpp (limited to 'SecureIM/rtfconv.cpp') diff --git a/SecureIM/rtfconv.cpp b/SecureIM/rtfconv.cpp new file mode 100644 index 0000000..271e62a --- /dev/null +++ b/SecureIM/rtfconv.cpp @@ -0,0 +1,46 @@ +#include "commonheaders.h" + + +HINSTANCE hRtfconv = NULL; +RTFCONVSTRING pRtfconvString = NULL; + + +BOOL load_rtfconv () { + + hRtfconv = LoadLibrary( "rtfconv.dll" ) ; + if ( hRtfconv == NULL ) { + hRtfconv = LoadLibrary( "plugins\\rtfconv.dll" ) ; + if ( hRtfconv == NULL ) + return FALSE; + } + + pRtfconvString = (RTFCONVSTRING) GetProcAddress( hRtfconv, "RtfconvString" ) ; + if ( pRtfconvString == NULL ) { + FreeLibrary( hRtfconv ) ; + return FALSE; + } + + return TRUE; +} + +void free_rtfconv () { + + if ( hRtfconv ) + FreeLibrary( hRtfconv ) ; + pRtfconvString = NULL; + hRtfconv = NULL; +} + + +void rtfconvA(LPCSTR rtf, LPWSTR plain) { + + pRtfconvString( rtf, plain, 0, 1200, CONVMODE_USE_SYSTEM_TABLE, (strlen(rtf)+1)*sizeof(WCHAR) ); +} + + +void rtfconvW(LPCWSTR rtf, LPWSTR plain) { + + pRtfconvString( rtf, plain, 0, 1200, CONVMODE_USE_SYSTEM_TABLE, (wcslen(rtf)+1)*sizeof(WCHAR) ); +} + +// EOF -- cgit v1.2.3