From cb4a46e7fbe62d788e66ed6121c717a2d22a4d7c Mon Sep 17 00:00:00 2001 From: watcherhd Date: Thu, 21 Apr 2011 14:14:52 +0000 Subject: svn.miranda.im is moving to a new home! git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@7 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