Marauder hat folgendes geschrieben: |
der Interop-Services und das Verwenden des Attributes DLLImport. |
Naja, er fragte nicht für Delphi.Net und somit kann er aber
muss nicht den namespace in die Imports clause aufnehmen.
Beispiel aus der SDK Doku um den inline namespace ergänzt:
1: 2: 3: 4: 5: 6: 7: 8:
| <System.Runtime.InteropServices.DllImport("KERNEL32.DLL", EntryPoint := "MoveFileW", _ SetLastError := True, CharSet := CharSet.Unicode, _ ExactSpelling := True, _ CallingConvention := CallingConvention.StdCall)> _ Public Shared Function MoveFile(src As String, dst As String) As Boolean ' Leave function empty - DLLImport attribute forwards calls to MoveFile to ' MoveFileW in KERNEL32.DLL. End Function |
Auch wenn es Jahre an harter Arbeit gekostet hat, VB.Net noch hässlicher als VB zu machen, es verhält sich wenigstens wie eine normale .Net Sprache.
@Heiko
Für mehr Infos einfach das VS bzw die SDK Doku öffnen und nach DllImportAttribute suchen.