Changeset 108

Show
Ignore:
Timestamp:
12/09/07 15:57:42 (9 months ago)
Author:
JJR
Message:

Update svn with patched source and fixes for dmd 1.024

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/current/win32/import/dwt/accessibility/accessible.d

    r82 r108  
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    1717private import dwt.accessibility.acc; 
    1818private import dwt.accessibility.accevents; 
    19   
     19 
    2020private import dwt.widgets.control; 
    2121private import dwt.widgets.table; 
     
    3939    private import std.c.windows.windows; 
    4040    private import std.c.windows.com; 
    41      
     41 
    4242    Accessible  parent; 
    4343    this(Accessible p) { parent = p; } 
     
    124124    ULONG AddRef()  { return parent.AddRef(); } 
    125125    ULONG Release() { return parent.Release(); } 
    126          
    127     // interface of IEnumVARIANT        
     126 
     127    // interface of IEnumVARIANT 
    128128    HRESULT Next(ULONG celt, VARIANT *rgvar, ULONG *pceltFetched) { return parent.Next(celt, rgvar, pceltFetched); } 
    129129    HRESULT Skip(ULONG celt) { return parent.Skip(celt); } 
     
    144144 * accessible control listener to implement accessibility for a 
    145145 * custom control. 
    146  *  
     146 * 
    147147 * @see Control#getAccessible 
    148148 * @see AccessibleListener 
     
    150150 * @see AccessibleControlListener 
    151151 * @see AccessibleControlEvent 
    152  *  
     152 * 
    153153 * @since 2.0 
    154154 */ 
     
    159159    private import std.thread; 
    160160 
    161      
     161 
    162162    int refCount = 0, enumIndex = 0; 
    163163    _IAccessibleImpl objIAccessible; 
    164164    _IEnumVARIANTImpl objIEnumVARIANT; 
    165      
     165 
    166166    IAccessible iaccessible; 
    167167    Vector!(DWTEventListener) accessibleListeners ; 
     
    177177 
    178178        this.control = control; 
    179          
     179 
    180180        HRESULT result = COM.CreateStdAccessibleObject(control.handle, COM.OBJID_CLIENT, &COM.IIDIAccessible, cast(void**)&iaccessible); 
    181181        if (result == COM.E_NOTIMPL) return; 
    182182        if (result != COM.S_OK) OLE.error(__FILE__, __LINE__, OLE.ERROR_CANNOT_CREATE_OBJECT, result); 
    183183        iaccessible.AddRef(); 
    184          
    185         objIAccessible = new _IAccessibleImpl(this);        
     184 
     185        objIAccessible = new _IAccessibleImpl(this); 
    186186        objIEnumVARIANT = new _IEnumVARIANTImpl(this) ; 
    187187        AddRef(); 
    188188    } 
    189      
     189 
    190190    /** 
    191191     * Invokes platform specific functionality to allocate a new accessible object. 
     
    231231        accessibleListeners.addElement(listener); 
    232232    } 
    233      
    234      
     233 
     234 
    235235    /** 
    236236     * Adds the listener to the collection of listeners who will 
     
    280280     * @see AccessibleTextListener 
    281281     * @see #removeAccessibleTextListener 
    282      *  
     282     * 
    283283     * @since 3.0 
    284284     */ 
     
    286286        checkWidget (); 
    287287        if (listener is null) DWT.error(__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    288         textListeners.addElement (listener);        
    289     } 
    290      
    291     /** 
    292      * Returns the control for this Accessible object.  
     288        textListeners.addElement (listener); 
     289    } 
     290 
     291    /** 
     292     * Returns the control for this Accessible object. 
    293293     * 
    294294     * @return the receiver's control 
     
    315315        Release(); 
    316316    } 
    317      
     317 
    318318    /** 
    319319     * Invokes platform specific functionality to handle a window message. 
     
    402402     * @see AccessibleTextListener 
    403403     * @see #addAccessibleTextListener 
    404      *  
     404     * 
    405405     * @since 3.0 
    406406     */ 
     
    419419     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> 
    420420     * </ul> 
    421      *  
     421     * 
    422422     * @since 3.0 
    423423     */ 
     
    432432     * 
    433433     * @param childID an identifier specifying a child of the control 
    434      *  
     434     * 
    435435     * @exception SWTException <ul> 
    436436     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> 
     
    448448     * 
    449449     * @param index the new caret index within the control 
    450      *  
     450     * 
    451451     * @exception SWTException <ul> 
    452452     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> 
     
    460460        COM.NotifyWinEvent (COM.EVENT_OBJECT_LOCATIONCHANGE, control.handle, COM.OBJID_CARET, COM.CHILDID_SELF); 
    461461    } 
    462      
     462 
    463463    /** 
    464464     * Sends a message to accessible clients that the text 
     
    474474     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> 
    475475     * </ul> 
    476      *  
     476     * 
    477477     * @see ACC#TEXT_INSERT 
    478478     * @see ACC#TEXT_DELETE 
    479      *  
     479     * 
    480480     * @since 3.0 
    481481     */ 
     
    484484        COM.NotifyWinEvent (COM.EVENT_OBJECT_VALUECHANGE, control.handle, COM.OBJID_CLIENT, COM.CHILDID_SELF); 
    485485    } 
    486      
     486 
    487487    /** 
    488488     * Sends a message to accessible clients that the text 
     
    500500        // not an MSAA event 
    501501    } 
    502      
     502 
    503503    HRESULT QueryInterface(REFIID riid, void ** ppvObject){ 
    504504        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    505505 
    506506        if (COM.IsEqualGUID(riid, &COM.IIDIUnknown)) { 
    507             *ppvObject = cast(IUnknown)objIAccessible
     507            *ppvObject = cast(void*)(cast(IUnknown)objIAccessible)
    508508            AddRef(); 
    509509            return COM.S_OK; 
     
    511511 
    512512        if (COM.IsEqualGUID(riid, &COM.IIDIDispatch)) { 
    513             *ppvObject = cast(IDispatch)objIAccessible
     513            *ppvObject = cast(void*)(cast(IDispatch)objIAccessible)
    514514            AddRef(); 
    515515            return COM.S_OK; 
     
    517517 
    518518        if (COM.IsEqualGUID(riid, &COM.IIDIAccessible)) { 
    519             *ppvObject = cast(IAccessible)objIAccessible
     519            *ppvObject = cast(void*)(cast(IAccessible)objIAccessible)
    520520            AddRef(); 
    521521            return COM.S_OK; 
     
    523523 
    524524        if (COM.IsEqualGUID(riid, &COM.IIDIEnumVARIANT)) { 
    525             *ppvObject = cast(IEnumVARIANT)objIEnumVARIANT
     525            *ppvObject = cast(void*)(cast(IEnumVARIANT)objIEnumVARIANT)
    526526            AddRef(); 
    527527            enumIndex = 0; 
     
    545545//              objIAccessible.dispose(); 
    546546            objIAccessible = null; 
    547                          
     547 
    548548//          if (objIEnumVARIANT !is null) 
    549549//              objIEnumVARIANT.dispose(); 
     
    581581        short[] shortArr; 
    582582        shortArr ~= COM.VT_I4; 
    583         COM.MoveMemory(pvarID, shortArr, 2); 
     583        COM.MoveMemory(pvarID, shortArr.ptr, 2); 
    584584        int[] intArr; 
    585585        intArr ~= childIDToOs(childID); 
    586         COM.MoveMemory(pvarID + 8, intArr, 4); 
    587         return COM.S_OK; 
    588     } 
    589      
     586        COM.MoveMemory(pvarID + 8, intArr.ptr, 4); 
     587        return COM.S_OK; 
     588    } 
     589 
    590590    HRESULT accLocation(LONG* pxLeft, LONG* pyTop, LONG* pcxWidth, LONG* pcyHeight, VARIANT varID) { 
    591591        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    599599        if (code == COM.S_OK) { 
    600600            int[] pLeft = new int[1], pTop = new int[1], pWidth = new int[1], pHeight = new int[1]; 
    601             COM.MoveMemory(pLeft, pxLeft, 4); 
    602             COM.MoveMemory(pTop, pyTop, 4); 
    603             COM.MoveMemory(pWidth, pcxWidth, 4); 
    604             COM.MoveMemory(pHeight, pcyHeight, 4); 
     601            COM.MoveMemory(pLeft.ptr, pxLeft, 4); 
     602            COM.MoveMemory(pTop.ptr, pyTop, 4); 
     603            COM.MoveMemory(pWidth.ptr, pcxWidth, 4); 
     604            COM.MoveMemory(pHeight.ptr, pcyHeight, 4); 
    605605            osLeft = pLeft[0]; osTop = pTop[0]; osWidth = pWidth[0]; osHeight = pHeight[0]; 
    606606        } 
     
    618618        int[] intArr; 
    619619        intArr ~= event.x; 
    620         COM.MoveMemory(pxLeft, intArr, 4); 
     620        COM.MoveMemory(pxLeft, intArr.ptr, 4); 
    621621        int[] intArr2; 
    622622        intArr2 ~= event.y; 
    623         COM.MoveMemory(pyTop, intArr2, 4); 
     623        COM.MoveMemory(pyTop, intArr2.ptr, 4); 
    624624        int[] intArr3; 
    625625        intArr3 ~= event.width; 
    626         COM.MoveMemory(pcxWidth, intArr3, 4); 
     626        COM.MoveMemory(pcxWidth, intArr3.ptr, 4); 
    627627        int[] intArr4; 
    628628        intArr4 ~= event.height; 
    629         COM.MoveMemory(pcyHeight, intArr, 4); 
    630         return COM.S_OK; 
    631  
    632     } 
    633      
     629        COM.MoveMemory(pcyHeight, intArr.ptr, 4); 
     630        return COM.S_OK; 
     631 
     632    } 
     633 
    634634    HRESULT accNavigate(LONG navDir, VARIANT varStart, VARIANT* pvarEnd) { 
    635635        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    639639        return code; 
    640640    } 
    641      
     641 
    642642    HRESULT accSelect(LONG flagsSelect, VARIANT varID) { 
    643643        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    671671 
    672672    } 
    673      
     673 
    674674    HRESULT get_accChildCount(LONG* pcountChildren) { 
    675675        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    681681        if (code == COM.S_OK) { 
    682682            int[] pChildCount = new int[1]; 
    683             COM.MoveMemory(pChildCount, pcountChildren, 4); 
     683            COM.MoveMemory(pChildCount.ptr, pcountChildren, 4); 
    684684            osChildCount = pChildCount[0]; 
    685685        } 
     
    695695        int[] intArr; 
    696696        intArr ~= event.detail; 
    697         COM.MoveMemory(pcountChildren, intArr, 4); 
    698         return COM.S_OK; 
    699  
    700     } 
    701      
     697        COM.MoveMemory(pcountChildren, intArr.ptr, 4); 
     698        return COM.S_OK; 
     699 
     700    } 
     701 
    702702    HRESULT get_accDefaultAction(VARIANT varID, BSTR* pszDefaultAction) { 
    703703        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    704704        if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    705          
     705 
    706706        /* Get the default defaultAction from the OS. */ 
    707707        char[] osDefaultAction = null; 
     
    725725        *pszDefaultAction = ptr; 
    726726        return COM.S_OK; 
    727      
    728     } 
    729      
     727 
     728    } 
     729 
    730730    HRESULT get_accDescription(VARIANT varID, BSTR* pszDescription) { 
    731731        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    732732        if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    733          
     733 
    734734        /* Get the default description from the OS. */ 
    735735        char[] osDescription = null; 
     
    744744            } 
    745745        } 
    746          
     746 
    747747        AccessibleEvent event = new AccessibleEvent(this); 
    748748        event.childID = osToChildID(varID.n1.n2.n3.lVal); 
     
    757757        return COM.S_OK; 
    758758    } 
    759      
     759 
    760760    HRESULT get_accFocus(VARIANT* pvarChild) { 
    761761        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    798798        return COM.S_OK; 
    799799    } 
    800      
     800 
    801801    HRESULT get_accHelp(VARIANT varID, BSTR* pszHelp) { 
    802802        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    803803        if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    804          
     804 
    805805        /* Get the default help string from the OS. */ 
    806806        char[] osHelp = null; 
     
    825825        return COM.S_OK; 
    826826    } 
    827      
     827 
    828828    HRESULT get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, LONG* pidTopic) { 
    829829        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    837837        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    838838        if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    839          
     839 
    840840        /* Get the default keyboard shortcut from the OS. */ 
    841841        char[] osKeyboardShortcut = null; 
     
    860860        return COM.S_OK; 
    861861    } 
    862      
     862 
    863863    HRESULT get_accName(VARIANT varID, BSTR* pszName) { 
    864864        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    887887        return COM.S_OK; 
    888888    } 
    889      
     889 
    890890    HRESULT get_accParent(LPDISPATCH* ppdispParent) { 
    891891        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    893893        return iaccessible.get_accParent(ppdispParent); 
    894894    } 
    895      
     895 
    896896    HRESULT get_accRole(VARIANT varID, VARIANT* pvarRole) { 
    897897        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    906906        if (code == COM.S_OK) { 
    907907            short[] pvt = new short[1]; 
    908             COM.MoveMemory(pvt, pvarRole, 2); 
     908            COM.MoveMemory(pvt.ptr, pvarRole, 2); 
    909909            if (pvt[0] == COM.VT_I4) { 
    910910                int[] pRole = new int[1]; 
    911                 COM.MoveMemory(pRole, pvarRole + 8, 4); 
     911                COM.MoveMemory(pRole.ptr, pvarRole + 8, 4); 
    912912                osRole = pRole[0]; 
    913913            } 
     
    932932        short[] shortArr; 
    933933        shortArr ~= COM.VT_I4; 
    934         COM.MoveMemory(pvarRole, shortArr, 2); 
     934        COM.MoveMemory(pvarRole, shortArr.ptr, 2); 
    935935        int[] intArr; 
    936936        intArr ~= role; 
    937         COM.MoveMemory(pvarRole + 8, intArr, 4); 
    938         return COM.S_OK; 
    939     } 
    940      
     937        COM.MoveMemory(pvarRole + 8, intArr.ptr, 4); 
     938        return COM.S_OK; 
     939    } 
     940 
    941941    HRESULT get_accSelection(VARIANT* pvarChildren) { 
    942942        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    948948        if (code == COM.S_OK) { 
    949949            short[] pvt = new short[1]; 
    950             COM.MoveMemory(pvt, pvarChildren, 2); 
     950            COM.MoveMemory(pvt.ptr, pvarChildren, 2); 
    951951            if (pvt[0] == COM.VT_I4) { 
    952952                int[] pChild = new int[1]; 
    953                 COM.MoveMemory(pChild, pvarChildren + 8, 4); 
     953                COM.MoveMemory(pChild.ptr, pvarChildren + 8, 4); 
    954954                osChild = osToChildID(pChild[0]); 
    955955            } else if (pvt[0] == COM.VT_UNKNOWN) { 
     
    978978        if (childID == ACC.CHILDID_MULTIPLE) { 
    979979            pvarChildren.vt = COM.VT_UNKNOWN; 
    980              
     980 
    981981            /* Should return an IEnumVARIANT for this... so the next line is wrong... need better API here... */ 
    982982            pvarChildren.punkVal = objIAccessible; 
     
    992992        return COM.S_OK; 
    993993    } 
    994      
     994 
    995995    HRESULT get_accState(VARIANT varID, VARIANT* pvarState) { 
    996996        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
     
    10051005        if (code == COM.S_OK) { 
    10061006            short[] pvt = new short[1]; 
    1007             COM.MoveMemory(pvt, pvarState, 2); 
     1007            COM.MoveMemory(pvt.ptr, pvarState, 2); 
    10081008            if (pvt[0] == COM.VT_I4) { 
    10091009                int[] pState = new int[1]; 
    1010                 COM.MoveMemory(pState, pvarState + 8, 4); 
     1010                COM.MoveMemory(pState.ptr, pvarState + 8, 4); 
    10111011                osState = pState[0]; 
    10121012            } 
     
    10481048        short[] shortArr; 
    10491049        shortArr ~= COM.VT_I4; 
    1050         COM.MoveMemory(pvarState, shortArr, 2); 
     1050        COM.MoveMemory(pvarState, shortArr.ptr, 2); 
    10511051        int[] intArr; 
    10521052        intArr ~= state; 
    1053         COM.MoveMemory(pvarState + 8, intArr, 4); 
    1054         return COM.S_OK; 
    1055     } 
    1056      
     1053        COM.MoveMemory(pvarState + 8, intArr.ptr, 4); 
     1054        return COM.S_OK; 
     1055    } 
     1056 
    10571057    HRESULT get_accValue(VARIANT varID, BSTR* pszValue) { 
    10581058        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    10591059        if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    1060          
     1060 
    10611061        /* Get the default value string from the OS. */ 
    10621062        char[] osValue = null; 
     
    10681068            if (size > 0) { 
    10691069                wchar[] buffer = new wchar[(size + 1) /2]; 
    1070                 COM.MoveMemory(buffer, *pszValue, size); 
     1070                COM.MoveMemory(buffer.ptr, *pszValue, size); 
    10711071                osValue = std.utf.toUTF8(buffer); 
    10721072            } 
     
    10851085        return COM.S_OK; 
    10861086    } 
    1087      
     1087 
    10881088    HRESULT put_accName(VARIANT varID, BSTR* szName) { 
    10891089        // MSAA: this method is no longer supported 
     
    10941094        return code; 
    10951095    } 
    1096      
     1096 
    10971097    HRESULT put_accValue(VARIANT varID, BSTR* szValue) { 
    10981098        // MSAA: this method is typically only used for edit controls 
     
    11051105 
    11061106    /* IEnumVARIANT methods: Next, Skip, Reset */ 
    1107     /* Retrieve the next celt items in the enumeration sequence.  
     1107    /* Retrieve the next celt items in the enumeration sequence. 
    11081108     * If there are fewer than the requested number of elements left 
    11091109     * in the sequence, retrieve the remaining elements. 
    1110      * The number of elements actually retrieved is returned in pceltFetched  
     1110     * The number of elements actually retrieved is returned in pceltFetched 
    11111111     * (unless the caller passed in NULL for that parameter). 
    11121112     */ 
     
    11201120            if (code != COM.S_OK) return code; 
    11211121            uint[] celtFetched = new uint[1]; 
    1122             code = ienumvariant.Next(celt, rgvar, celtFetched); 
    1123             COM.MoveMemory(pceltFetched, celtFetched, 4); 
     1122            code = ienumvariant.Next(celt, rgvar, celtFetched.ptr); 
     1123            COM.MoveMemory(pceltFetched, celtFetched.ptr, 4); 
    11241124            return code; 
    11251125        } 
     
    11351135            } 
    11361136            variants = event.children; 
    1137         }   
     1137        } 
    11381138        Object[] nextItems = null; 
    11391139        if (variants !is null && celt >= 1) { 
     
    11621162                    COM.MoveMemory(rgvar + i * 16 + 8, &item, 4); 
    11631163                } else { 
    1164                     void* obj = (cast(Accessible) nextItem).objIAccessible
     1164                    void* obj = cast(void*)((cast(Accessible) nextItem).objIAccessible)
    11651165                    short type = COM.VT_DISPATCH; 
    11661166                    COM.MoveMemory(rgvar + i * 16, &type, 2); 
     
    11711171                int[] intArr; 
    11721172                intArr ~= nextItems.length; 
    1173                 COM.MoveMemory(pceltFetched, intArr, 4); 
     1173                COM.MoveMemory(pceltFetched, intArr.ptr, 4); 
    11741174            } 
    11751175            if (nextItems.length == celt) return COM.S_OK; 
     
    11781178                int[] intArr; 
    11791179                intArr ~= 0; 
    1180                 COM.MoveMemory(pceltFetched, intArr, 4); 
     1180                COM.MoveMemory(pceltFetched, intArr.ptr, 4); 
    11811181            } 
    11821182        } 
    11831183        return COM.S_FALSE; 
    11841184    } 
    1185      
     1185 
    11861186    /* Skip over the specified number of elements in the enumeration sequence. */ 
    11871187    HRESULT Skip(ULONG celt)  { 
     
    12051205        return COM.S_OK; 
    12061206    } 
    1207      
     1207 
    12081208    /* Reset the enumeration sequence to the beginning. */ 
    12091209    HRESULT Reset() { 
     
    12181218            return code; 
    12191219        } 
    1220          
     1220 
    12211221        enumIndex = 0; 
    12221222        return COM.S_OK; 
    12231223    } 
    1224      
     1224 
    12251225    int childIDToOs(int childID) { 
    12261226        if (childID == ACC.CHILDID_SELF) return COM.CHILDID_SELF; 
     
    12501250        return OS.SendMessage (control.handle, OS.TVM_MAPACCIDTOHTREEITEM, osChildID, 0); 
    12511251    } 
    1252      
     1252 
    12531253    int stateToOs(int state) { 
    12541254        int osState = 0; 
     
    12711271        return osState; 
    12721272    } 
    1273      
     1273 
    12741274    int osToState(int osState) { 
    12751275        int state = ACC.STATE_NORMAL; 
  • trunk/current/win32/import/dwt/browser/website.d

    r82 r108  
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    5252    HRESULT QueryInterface(REFIID riid, void ** ppvObject) { return parent.QueryInterface(riid, ppvObject); } 
    5353    ULONG AddRef()  { return parent.AddRef(); } 
    54     ULONG Release() { return parent.Release(); }    
    55      
     54    ULONG Release() { return parent.Release(); } 
     55 
    5656    // interface IDocHostUIHandler : IUnknown 
    5757    HRESULT ShowContextMenu( DWORD dwID, POINT* ppt, IUnknown pcmdtReserved, IDispatch pdispReserved){ 
     
    8181    private import std.c.windows.com; 
    8282 
    83      
     83 
    8484    WebSite parent; 
    8585    this(WebSite p) { parent = p; } 
     
    8888    HRESULT QueryInterface(REFIID riid, void ** ppvObject) { return parent.QueryInterface(riid, ppvObject); } 
    8989    ULONG AddRef()  { return parent.AddRef(); } 
    90     ULONG Release() { return parent.Release(); }    
    91          
     90    ULONG Release() { return parent.Release(); } 
     91 
    9292    // interface IDocHostShowUI : IUnknown 
    9393    HRESULT ShowMessage( HWND hwnd, LPOLESTR lpstrText, LPOLESTR lpstrCaption, DWORD dwType, LPOLESTR lpstrHelpFile, DWORD dwHelpContext, LRESULT * plResult){ 
     
    109109    private import std.c.windows.com; 
    110110 
    111      
    112     WebSite parent; 
    113     this(WebSite p) { parent = p; } 
    114 extern (Windows) : 
    115     // interface of IUnknown 
    116     HRESULT QueryInterface(REFIID riid, void ** ppvObject) { return parent.QueryInterface(riid, ppvObject); } 
    117     ULONG AddRef()  { return parent.AddRef(); } 
    118     ULONG Release() { return parent.Release(); }     
    119      
    120     // interface IServiceProvider : IUnknown  
    121     HRESULT QueryService(REFGUID guidService, REFIID riid, void **ppv){ 
    122         return parent.QueryService(guidService, riid, ppv); 
    123     } 
    124 
    125  
    126 // TODO: 
    127 /* 
    128 // <Shawn> I have problem to make this work, commented for temporarily 
    129  
    130 class _IInternetSecurityManagerImpl : IInternetSecurityManager { 
    131  
    132     private import std.c.windows.windows; 
    133     private import std.c.windows.com; 
    134  
    135      
     111 
    136112    WebSite parent; 
    137113    this(WebSite p) { parent = p; } 
     
    142118    ULONG Release() { return parent.Release(); } 
    143119 
    144     // interface IInternetSecurityManager : IUnknown  
     120    // interface IServiceProvider : IUnknown 
     121    HRESULT QueryService(REFGUID guidService, REFIID riid, void **ppv){ 
     122        return parent.QueryService(guidService, riid, ppv); 
     123    } 
     124
     125 
     126// TODO: 
     127/* 
     128// <Shawn> I have problem to make this work, commented for temporarily 
     129 
     130class _IInternetSecurityManagerImpl : IInternetSecurityManager { 
     131 
     132    private import std.c.windows.windows; 
     133    private import std.c.windows.com; 
     134 
     135 
     136    WebSite parent; 
     137    this(WebSite p) { parent = p; } 
     138extern (Windows) : 
     139    // interface of IUnknown 
     140    HRESULT QueryInterface(REFIID riid, void ** ppvObject) { return parent.QueryInterface(riid, ppvObject); } 
     141    ULONG AddRef()  { return parent.AddRef(); } 
     142    ULONG Release() { return parent.Release(); } 
     143 
     144    // interface IInternetSecurityManager : IUnknown 
    145145    HRESULT SetSecuritySite(LPINTERNETSECURITYMGRSITE pSite) { return Browser.INET_E_DEFAULT_ACTION; } 
    146146    HRESULT GetSecuritySite(LPINTERNETSECURITYMGRSITE *ppSite) { return Browser.INET_E_DEFAULT_ACTION; } 
     
    148148        return parent.MapUrlToZone(pwszUrl, pdwZone, dwFlags); 
    149149    } 
    150     HRESULT GetSecurityId(LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved){  
    151         return Browser.INET_E_DEFAULT_ACTION;  
     150    HRESULT GetSecurityId(LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved){ 
     151        return Browser.INET_E_DEFAULT_ACTION; 
    152152    } 
    153153    HRESULT ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved){ 
     
    156156    } 
    157157    HRESULT QueryCustomPolicy(LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved){ 
    158         return Browser.INET_E_DEFAULT_ACTION;  
     158        return Browser.INET_E_DEFAULT_ACTION; 
    159159    } 
    160160    HRESULT SetZoneMapping(DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags) { return Browser.INET_E_DEFAULT_ACTION; } 
     
    162162} 
    163163 
    164 */  
    165      
     164*/ 
     165 
    166166class WebSite : OleControlSite { 
    167167 
     
    169169    private import std.c.windows.com; 
    170170 
    171      
     171 
    172172    _IDocHostUIHandlerImpl iDocHostUIHandler; 
    173173    _IDocHostShowUIImpl iDocHostShowUI; 
    174174    _IServiceProviderImpl iServiceProvider; 
    175175//  _IInternetSecurityManagerImpl iInternetSecurityManager; 
    176      
     176 
    177177public this(Composite parent, int style, char[] progId) { 
    178     super(parent, style, progId);       
     178    super(parent, style, progId); 
    179179} 
    180180 
    181181protected void createCOMInterfaces () { 
    182182    super.createCOMInterfaces(); 
    183      
     183 
    184184    iDocHostUIHandler = new _IDocHostUIHandlerImpl(this); 
    185185    iDocHostShowUI = new _IDocHostShowUIImpl(this); 
     
    190190package void disposeCOMInterfaces() { 
    191191    super.disposeCOMInterfaces(); 
    192      
     192 
    193193    iDocHostUIHandler = null; 
    194194    iDocHostShowUI = null; 
     
    201201    if (result == COM.S_OK) return result; 
    202202    if (riid is null || ppvObject is null) return COM.E_INVALIDARG; 
    203          
     203 
    204204    if (COM.IsEqualGUID(riid, &COM.IIDIDocHostUIHandler)) { 
    205         *ppvObject = cast(IDocHostUIHandler)iDocHostUIHandler
     205        *ppvObject = cast(void*)(cast(IDocHostUIHandler)iDocHostUIHandler)
    206206        AddRef(); 
    207207        return COM.S_OK; 
    208208    } 
    209209    if (COM.IsEqualGUID(riid, &COM.IIDIDocHostShowUI)) { 
    210         *ppvObject = cast(IDocHostShowUI)iDocHostShowUI
     210        *ppvObject = cast(void*)(cast(IDocHostShowUI)iDocHostShowUI)
    211211        AddRef(); 
    212212        return COM.S_OK; 
    213213    } 
    214214    if (COM.IsEqualGUID(riid, &COM.IIDIServiceProvider)) { 
    215         *ppvObject = cast(IServiceProvider)iServiceProvider
     215        *ppvObject = cast(void*)(cast(IServiceProvider)iServiceProvider)
    216216        AddRef(); 
    217217        return COM.S_OK; 
    218218    } 
    219219// TODO: <Shawn> I have problem to make IInternetSecurityManager interface work, 
    220 // commented for temporarily    
     220// commented for temporarily 
    221221//  if (COM.IsEqualGUID(riid, &COM.IIDIInternetSecurityManager)) { 
    222222//      *ppvObject = cast(IInternetSecurityManager)iInternetSecurityManager; 
     
    268268    * Feature on Internet Explorer.  By default the embedded Internet Explorer control runs 
    269269    * the Internet Explorer shortcuts. F5 causes refresh).  This behaviour is undesired when 
    270     * rendering HTML in memory as it causes the empty page about:blank page to be reloaded.   
     270    * rendering HTML in memory as it causes the empty page about:blank page to be reloaded. 
    271271    * The workaround is to block the default F5 handling by IE when the URL is about:blank. 
    272272    */ 
     
    296296    * Feature on IE.  Executing certain ActiveX controls such as the Java or Flash plugin from within 
    297297    * a java VM can cause the application to crash.  The workaround is to disallow all ActiveX controls. 
    298     *  
     298    * 
    299299    * Feature on IE.  When IE navigates to a website that contains an ActiveX that is prevented from 
    300     * being executed, IE displays a message "Your current security settings prohibit running ActiveX  
     300    * being executed, IE displays a message "Your current security settings prohibit running ActiveX 
    301301    * controls on this page ...".  The workaround is to selectively block this alert as indicated 
    302302    * in the MSDN article "WebBrowser customization". 
    303303    */ 
    304     /* resource identifier in shdoclc.dll for window caption "Your current security settings prohibit  
    305      * running ActiveX controls on this page ..."  
     304    /* resource identifier in shdoclc.dll for window caption "Your current security settings prohibit 
     305     * running ActiveX controls on this page ..." 
    306306     */ 
    307307    int IDS_MESSAGE_BOX_CAPTION = 8033; 
     
    309309        HINSTANCE hModule = OS.LoadLibrary("SHDOCLC.DLL\0"); 
    310310        if (hModule !is null) { 
    311             /*  
     311            /* 
    312312            * Note.  lpstrText is a LPOLESTR, i.e. a null terminated unicode string LPWSTR, i.e. a WCHAR*. 
    313313            * It is not a BSTR.  A BSTR is a null terminated unicode string that contains its length 
    314             * at the beginning.  
     314            * at the beginning. 
    315315            */ 
    316316            int cnt = OS.wcslen(lpstrText); 
    317             /*  
     317            /* 
    318318            * Note.  lpstrText is unicode on both unicode and ansi platforms. 
    319319            * The nbr of chars is multiplied by the constant 2 and not by TCHAR.sizeof since 
     
    325325 
    326326            TCHAR[] lpBuffer = new TCHAR[length+1]; 
    327             int result = OS.LoadString(hModule, IDS_MESSAGE_BOX_CAPTION, lpBuffer, length); 
     327            int result = OS.LoadString(hModule, IDS_MESSAGE_BOX_CAPTION, lpBuffer.ptr, length); 
    328328            OS.FreeLibrary(hModule); 
    329             return result > 0 && (text == (Converter.TCHARzToStr(lpBuffer, result)))? COM.S_OK : COM.S_FALSE; 
     329            return result > 0 && (text == (Converter.TCHARzToStr(lpBuffer.ptr, result)))? COM.S_OK : COM.S_FALSE; 
    330330        } 
    331331    } 
     
    338338HRESULT QueryService(REFGUID guidService, REFIID riid, void **ppv) { 
    339339    if (riid is null || ppv is null) return COM.E_INVALIDARG; 
    340      
     340 
    341341// TODO: <Shawn> I have problem to make IInternetSecurityManager interface work, 
    342 // commented for temporarily    
     342