comparison dwt/internal/ole/win32/COM.d @ 212:ab60f3309436

reverted the char[] to String and use the an alias.
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:12:38 +0200
parents fa7d7d66b9ed
children 36f5cb12e1a2
comparison
equal deleted inserted replaced
211:ff59aeb96cac 212:ab60f3309436
22 private import dwt.internal.ole.win32.EXDISP; 22 private import dwt.internal.ole.win32.EXDISP;
23 private import dwt.internal.ole.win32.MSHTMHST; 23 private import dwt.internal.ole.win32.MSHTMHST;
24 private import dwt.internal.ole.win32.extras; 24 private import dwt.internal.ole.win32.extras;
25 private import dwt.internal.ole.win32.ifs; 25 private import dwt.internal.ole.win32.ifs;
26 private import dwt.internal.ole.win32.COMAPI; 26 private import dwt.internal.ole.win32.COMAPI;
27 import dwt.dwthelper.utils;
27 28
28 private alias dwt.internal.ole.win32.COMAPI COMAPI; 29 private alias dwt.internal.ole.win32.COMAPI COMAPI;
29 30
30 31
31 public import dwt.internal.win32.OS; 32 public import dwt.internal.win32.OS;
32 33
33 template IIDFromStringT(char[] g) { 34 template IIDFromStringT(String g) {
34 static if (g.length == 38) 35 static if (g.length == 38)
35 const GUID IIDFromStringT = IIDFromStringT!(g[1..$-1]); 36 const GUID IIDFromStringT = IIDFromStringT!(g[1..$-1]);
36 else static if (g.length == 36) 37 else static if (g.length == 36)
37 const GUID IIDFromStringT = { 38 const GUID IIDFromStringT = {
38 mixin("0x" ~ g[0..8]), 39 mixin("0x" ~ g[0..8]),
101 //public static const GUID IIDIErrorInfo = IIDFromStringT!("{1CF2B120-547D-101B-8E65-08002B2BD119}"); //$NON-NLS-1$ 102 //public static const GUID IIDIErrorInfo = IIDFromStringT!("{1CF2B120-547D-101B-8E65-08002B2BD119}"); //$NON-NLS-1$
102 //public static const GUID IIDIErrorLog = IIDFromStringT!("{3127CA40-446E-11CE-8135-00AA004BB851}"); //$NON-NLS-1$ 103 //public static const GUID IIDIErrorLog = IIDFromStringT!("{3127CA40-446E-11CE-8135-00AA004BB851}"); //$NON-NLS-1$
103 //public static const GUID IIDIExternalConnection = IIDFromStringT!("{00000019-0000-0000-C000-000000000046}"); //$NON-NLS-1$ 104 //public static const GUID IIDIExternalConnection = IIDFromStringT!("{00000019-0000-0000-C000-000000000046}"); //$NON-NLS-1$
104 public static const GUID IIDIFont = IIDFromStringT!("{BEF6E002-A874-101A-8BBA-00AA00300CAB}"); //$NON-NLS-1$ 105 public static const GUID IIDIFont = IIDFromStringT!("{BEF6E002-A874-101A-8BBA-00AA00300CAB}"); //$NON-NLS-1$
105 //public static const GUID IIDIFontDisp = IIDFromStringT!("{BEF6E003-A874-101A-8BBA-00AA00300CAB}"); //$NON-NLS-1$ 106 //public static const GUID IIDIFontDisp = IIDFromStringT!("{BEF6E003-A874-101A-8BBA-00AA00300CAB}"); //$NON-NLS-1$
106 public static const /*GUID*/ char[] IIDIHTMLDocumentEvents2 = /*IIDFromStringT!(*/"{3050F613-98B5-11CF-BB82-00AA00BDCE0B}"/*)*/; 107 public static const /*GUID*/ String IIDIHTMLDocumentEvents2 = /*IIDFromStringT!(*/"{3050F613-98B5-11CF-BB82-00AA00BDCE0B}"/*)*/;
107 public static const GUID IIDIInternetSecurityManager = IIDFromStringT!("{79eac9ee-baf9-11ce-8c82-00aa004ba90b}"); //$NON-NLS-1$ 108 public static const GUID IIDIInternetSecurityManager = IIDFromStringT!("{79eac9ee-baf9-11ce-8c82-00aa004ba90b}"); //$NON-NLS-1$
108 //public static const GUID IIDILockBytes = IIDFromStringT!("{0000000A-0000-0000-C000-000000000046}"); //$NON-NLS-1$ 109 //public static const GUID IIDILockBytes = IIDFromStringT!("{0000000A-0000-0000-C000-000000000046}"); //$NON-NLS-1$
109 //public static const GUID IIDIMalloc = IIDFromStringT!("{00000002-0000-0000-C000-000000000046}"); //$NON-NLS-1$ 110 //public static const GUID IIDIMalloc = IIDFromStringT!("{00000002-0000-0000-C000-000000000046}"); //$NON-NLS-1$
110 //public static const GUID IIDIMallocSpy = IIDFromStringT!("{0000001D-0000-0000-C000-000000000046}"); //$NON-NLS-1$ 111 //public static const GUID IIDIMallocSpy = IIDFromStringT!("{0000001D-0000-0000-C000-000000000046}"); //$NON-NLS-1$
111 //public static const GUID IIDIMarshal = IIDFromStringT!("{00000003-0000-0000-C000-000000000046}"); //$NON-NLS-1$ 112 //public static const GUID IIDIMarshal = IIDFromStringT!("{00000003-0000-0000-C000-000000000046}"); //$NON-NLS-1$
439 public static const short VARIANT_TRUE = -1; 440 public static const short VARIANT_TRUE = -1;
440 public static const short VARIANT_FALSE = 0; 441 public static const short VARIANT_FALSE = 0;
441 442
442 443
443 // alias dwt.internal.ole.win32.comapi. 444 // alias dwt.internal.ole.win32.comapi.
444 // public static GUID* IIDFromString(char[] lpsz) { 445 // public static GUID* IIDFromString(String lpsz) {
445 // GUID* lpiid = new GUID(); 446 // GUID* lpiid = new GUID();
446 // if (COM.IIDFromString(Converter.StrToWCHARz(lpsz), lpiid) == COM.S_OK) 447 // if (COM.IIDFromString(Converter.StrToWCHARz(lpsz), lpiid) == COM.S_OK)
447 // return lpiid; 448 // return lpiid;
448 // return null; 449 // return null;
449 // } 450 // }
851 * instead to determine the null ended, this mean BSTRToStr() can get string 852 * instead to determine the null ended, this mean BSTRToStr() can get string
852 * which has embedded null characters. 853 * which has embedded null characters.
853 */ 854 */
854 // BSTR is aliased to wchar* 855 // BSTR is aliased to wchar*
855 // Note : Free the "bstr" memory if freeTheString is true, default false 856 // Note : Free the "bstr" memory if freeTheString is true, default false
856 char[] BSTRToStr( /*BSTR*/ inout wchar* bstr, bool freeTheString = false){ 857 String BSTRToStr( /*BSTR*/ inout wchar* bstr, bool freeTheString = false){
857 if(bstr is null) return null; 858 if(bstr is null) return null;
858 int size = (SysStringByteLen(bstr) + 1)/wchar.sizeof; 859 int size = (SysStringByteLen(bstr) + 1)/wchar.sizeof;
859 char[] result = WCHARzToStr(bstr, size); 860 String result = WCHARzToStr(bstr, size);
860 if(freeTheString) { 861 if(freeTheString) {
861 // free the string and set ptr to null 862 // free the string and set ptr to null
862 SysFreeString(bstr); 863 SysFreeString(bstr);
863 bstr = null; 864 bstr = null;
864 } 865 }