ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文

  メンテナンス 前画面に戻る

対象スレッド 件名: VB.NET 文字列と整数 (値渡し)
名前: lightbox
処理選択
パスワード

件名 VB.NET 文字列と整数 (値渡し)
名前 lightbox
コメント
[[旧形式(非推奨)]]
@DIV
Imports System.Text

Module MyModule

REM ********************************************************
REM * DLL 内 関数宣言
REM ********************************************************
Declare Function GetSystemDirectory Lib "kernel32" Alias _
"GetSystemDirectoryA" (ByVal lpBuffer As StringBuilder, ByVal nSize As Integer) As Integer

REM ********************************************************
REM * 実行
REM ********************************************************
Sub Main()

	Dim strPath As new StringBuilder( 512 )
	Call GetSystemDirectory( strPath, strPath.Capacity )

	Call System.Console.WriteLine( strPath )

End Sub

End Module
@END

[[推奨]]
@DIV
Imports System.Text
Imports System.Runtime.InteropServices

Module MyModule

REM ********************************************************
REM * DLL 内 関数インターフェイス定義
REM ********************************************************
<DllImport("Kernel32.dll", CharSet:=CharSet.Auto)> _
Public Function GetSystemDirectory( _
	ByVal lpBuffer As StringBuilder, _
	ByVal nSize As Integer) As Integer
End Function

REM ********************************************************
REM * 実行
REM ********************************************************
Sub Main()

	Dim strPath As new StringBuilder( 512 )
	Call GetSystemDirectory( strPath, strPath.Capacity )

	Call System.Console.WriteLine( strPath )

End Sub

End Module
@END