diff options
author | Veronika Irvine | 2004-12-16 21:23:59 +0000 |
---|---|---|
committer | Veronika Irvine | 2004-12-16 21:23:59 +0000 |
commit | 2a80b0283d6dbaa0760372cca4c2d987b77727a2 (patch) | |
tree | 648da16498e99325f9b187ead3bf274ad7874a24 | |
parent | 3df01f1dfcce5cfbf90215bdd41e9437d26339e5 (diff) | |
download | eclipse.platform.swt-2a80b0283d6dbaa0760372cca4c2d987b77727a2.tar.gz eclipse.platform.swt-2a80b0283d6dbaa0760372cca4c2d987b77727a2.tar.xz eclipse.platform.swt-2a80b0283d6dbaa0760372cca4c2d987b77727a2.zip |
Check address of callback after creation
2 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java index f3bd50ccc6..a83d04d042 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java @@ -11,6 +11,7 @@ package org.eclipse.swt.internal.ole.win32; import java.util.Hashtable; +import org.eclipse.swt.*; import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.win32.*; @@ -29,6 +30,7 @@ public COMObject(int[] argCounts) { for (int i = 0, length = argCounts.length; i < length; i++){ if ((Callbacks[i][argCounts[i]]) == null) { Callbacks[i][argCounts[i]] = new Callback(this.getClass(), "callback"+i, argCounts[i] + 1, true, COM.E_FAIL); //$NON-NLS-1$ + if (Callbacks[i][argCounts[i]].getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); } callbackAddresses[i] = Callbacks[i][argCounts[i]].getAddress(); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java index 243758e35c..8bc59dc0d7 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java @@ -157,6 +157,7 @@ private static void initMsgHook(Display display) { if (display.getData(HHOOK) != null) return; final Callback callback = new Callback(OleFrame.class, "getMsgProc", 3); //$NON-NLS-1$ int address = callback.getAddress(); + if (address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); int threadId = OS.GetCurrentThreadId(); final int hHook = OS.SetWindowsHookEx(OS.WH_GETMESSAGE, address, 0, threadId); if (hHook == 0) { @@ -216,10 +217,10 @@ static int getMsgProc(int code, int wParam, int lParam) { return 0; } } + } } } } - } return OS.CallNextHookEx(hHook.intValue(), code, wParam, lParam); } /** |