riched20: Store reference to editor in ole interface.

This commit is contained in:
Kevin Koltzau 2006-02-22 23:05:11 -05:00 committed by Alexandre Julliard
parent c0cd38fbab
commit 58b2995311
3 changed files with 7 additions and 3 deletions

View File

@ -2236,7 +2236,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
{
LPVOID *ppvObj = (LPVOID*) lParam;
FIXME("EM_GETOLEINTERFACE %p: stub\n", ppvObj);
return CreateIRichEditOle(ppvObj);
return CreateIRichEditOle(editor, ppvObj);
}
case EM_SETOLECALLBACK:
if(editor->lpOleCallback)

View File

@ -233,7 +233,7 @@ void ME_QueueInvalidateFromCursor(ME_TextEditor *editor, int nCursor);
BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator);
/* richole.c */
extern LRESULT CreateIRichEditOle(LPVOID *);
extern LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *);
/* wintest.c */

View File

@ -31,6 +31,7 @@
#include "winuser.h"
#include "ole2.h"
#include "richole.h"
#include "editor.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
@ -38,6 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit);
typedef struct IRichEditOleImpl {
const IRichEditOleVtbl *lpVtbl;
LONG ref;
ME_TextEditor *editor;
} IRichEditOleImpl;
/* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/
@ -250,7 +253,7 @@ static const IRichEditOleVtbl revt = {
IRichEditOle_fnImportDataObject
};
LRESULT CreateIRichEditOle(LPVOID *ppObj)
LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj)
{
IRichEditOleImpl *reo;
@ -260,6 +263,7 @@ LRESULT CreateIRichEditOle(LPVOID *ppObj)
reo->lpVtbl = &revt;
reo->ref = 1;
reo->editor = editor;
TRACE("Created %p\n",reo);
*ppObj = (LPVOID) reo;