You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue from Fri, 07 Sep 2012 13:09:23 GMTOriginally opened at https://clrinterop.codeplex.com/workitem/10470
The code generated by this tool is very verbose. Since the general use case is to hand edit the generated code, it should be made more terser for readability.
First of all all attribute decorations should not include the word Attribute. e.g DllImportAttribute should become DllImport. Secondly, there should be an option to not qualify attributes with namespaces. Here is a real life example:
Currently:
[System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="TraceOpenLogFile")]
public static extern short TraceOpenLogFile(
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder s,
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder t,
uint w) ;
After
[DllImport("", EntryPoint="TraceOpenLogFile")]
public static extern short public static short TraceOpenLogFile(
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder s,
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder t,
uint w);
In both cases i formatted the code slightly.
The text was updated successfully, but these errors were encountered:
Issue from Fri, 07 Sep 2012 13:09:23 GMT Originally opened at https://clrinterop.codeplex.com/workitem/10470
The code generated by this tool is very verbose. Since the general use case is to hand edit the generated code, it should be made more terser for readability.
First of all all attribute decorations should not include the word Attribute. e.g DllImportAttribute should become DllImport. Secondly, there should be an option to not qualify attributes with namespaces. Here is a real life example:
Currently:
[System.Runtime.InteropServices.DllImportAttribute("", EntryPoint="TraceOpenLogFile")]
public static extern short TraceOpenLogFile(
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder s,
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder t,
uint w) ;
After
[DllImport("", EntryPoint="TraceOpenLogFile")]
public static extern short public static short TraceOpenLogFile(
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder s,
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder t,
uint w);
In both cases i formatted the code slightly.
The text was updated successfully, but these errors were encountered: