diff dwt/ole/win32/OleAutomation.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 ecba636b634e
children fd9c62a2998e
line wrap: on
line diff
--- a/dwt/ole/win32/OleAutomation.d	Sat Apr 26 10:01:48 2008 +0200
+++ b/dwt/ole/win32/OleAutomation.d	Mon May 05 00:12:38 2008 +0200
@@ -102,7 +102,7 @@
  */
 public final class OleAutomation {
     private IDispatch objIDispatch;
-    private char[] exceptionDescription;
+    private String exceptionDescription;
     private ITypeInfo objITypeInfo;
 
 this(IDispatch idispatch) {
@@ -156,23 +156,23 @@
 IDispatch getAddress() {
     return objIDispatch;
 }
-public char[] getHelpFile(int dispId) {
+public String getHelpFile(int dispId) {
     if (objITypeInfo is null) return null;
     BSTR file;
     HRESULT rc = objITypeInfo.GetDocumentation(dispId, null, null, null, &file );
     if (rc is OLE.S_OK) {
-        char[] str = WCHARzToStr( file, -1 );
+        String str = WCHARzToStr( file, -1 );
         COM.SysFreeString(file);
         return str;
     }
     return null;
 }
-public char[] getDocumentation(int dispId) {
+public String getDocumentation(int dispId) {
     if (objITypeInfo is null) return null;
     BSTR doc;
     HRESULT rc = objITypeInfo.GetDocumentation(dispId, null, &doc, null, null );
     if (rc == OLE.S_OK) {
-        char[] s = WCHARzToStr(doc, -1);
+        String s = WCHARzToStr(doc, -1);
         COM.SysFreeString(doc);
         return s;
     }
@@ -221,7 +221,7 @@
     data.documentation = getDocumentation(funcdesc.memid);
     data.helpFile = getHelpFile(funcdesc.memid);
 
-    char[][] names = getNames(funcdesc.memid, funcdesc.cParams + 1);
+    String[] names = getNames(funcdesc.memid, funcdesc.cParams + 1);
     if (names.length > 0) {
         data.name = names[0];
     }
@@ -267,25 +267,25 @@
     return typeattr;
 }
 
-public char[] getName(int dispId) {
+public String getName(int dispId) {
     if (objITypeInfo is null) return null;
     BSTR name;
     HRESULT rc = objITypeInfo.GetDocumentation(dispId, &name, null, null, null );
     if (rc == OLE.S_OK) {
-        char[] s = WCHARzToStr(name, -1);
+        String s = WCHARzToStr(name, -1);
         COM.SysFreeString(name);
         return s;
     }
     return null;
 }
 
-public char[][] getNames(int dispId, int maxSize) {
-    if (objITypeInfo is null) return new char[][0];
+public String[] getNames(int dispId, int maxSize) {
+    if (objITypeInfo is null) return new String[0];
     BSTR[] names = new BSTR[maxSize];
     uint count;
     HRESULT rc = objITypeInfo.GetNames(dispId, names.ptr, maxSize, &count);
     if (rc == OLE.S_OK) {
-        char[][] newNames = new char[][count];
+        String[] newNames = new String[count];
         for(int i=0; i<count; ++i){
             newNames[i] = WCHARzToStr(names[i], -1);
             COM.SysFreeString(names[i]);
@@ -304,7 +304,7 @@
  * @return positive integer values that are associated with the specified names in the same
  *         order as the names where provided; or null if the names are unknown
  */
-public int[] getIDsOfNames(char[][] names) {
+public int[] getIDsOfNames(String[] names) {
 
     int count = names.length;
     wchar*[] wcNames = new wchar*[count];
@@ -324,7 +324,7 @@
  *
  * @return a description of the last error encountered
  */
-public char[] getLastError() {
+public String getLastError() {
 
     return exceptionDescription;