更新 : 2007 年 11 月
CommentMarkAtProfile メソッドは、タイムスタンプ値、数値マーク、コメント文字列を .vsp ファイルに挿入します。タイムスタンプ値を使用して外部イベントと同期できます。CommentMarkAtProfile 関数を含むスレッドのプロファイル実行は、挿入されるマークとコメントについてオンにしておく必要があります。
名前空間 : Microsoft.VisualStudio.Profiler
アセンブリ : Microsoft.VisualStudio.Profiler (Microsoft.VisualStudio.Profiler.dll 内)
構文
'宣言
Public Shared Function CommentMarkAtProfile ( _
timestamp As Long, _
markId As Integer, _
markText As String _
) As MarkOperationResult
'使用
Dim timestamp As Long
Dim markId As Integer
Dim markText As String
Dim returnValue As MarkOperationResult
returnValue = DataCollection.CommentMarkAtProfile(timestamp, _
markId, markText)
public static MarkOperationResult CommentMarkAtProfile(
long timestamp,
int markId,
string markText
)
public:
static MarkOperationResult CommentMarkAtProfile(
long long timestamp,
int markId,
String^ markText
)
public static function CommentMarkAtProfile(
timestamp : long,
markId : int,
markText : String
) : MarkOperationResult
パラメータ
timestamp
型 : System.Int64タイムスタンプ値を表す 64 ビット整数値。
markId
型 : System.Int32挿入する数値マーカー。マーカーは 0 以上の値にする必要があります。
markText
型 : System.String挿入するテキスト文字列へのポインタ。この文字列は、NULL 終端文字を含めて 256 文字未満にする必要があります。
戻り値
型 : Microsoft.VisualStudio.Profiler.MarkOperationResult
戻り値の MarkOperationResult は列挙型です。
解説
Mark コマンドまたは API 関数 (CommentMarkAtProfile、CommentMarkProfile、または MarkProfile) でマークとコメントが挿入されたとき、マークのプロファイル関数を含むスレッドでは、プロファイル状態をオンにする必要があります。プロファイル マークは、スコープ内でグローバルです。たとえば、あるスレッドに挿入したプロファイルマークを、.vsp ファイル内の任意のスレッドで使用し、データ セグメントの開始または終了をマークできます。
重要 : |
|---|
CommentMarkAtProfile メソッドは、インストルメンテーションでのみ使用してください。 |
例
CommentMarkAtProfile メソッドを呼び出す例を次に示します。
public void ExerciseCommentMarkAtProfile()
{
// Declare and initalize variables to pass to
// CommentMarkAtProfile. The values of these
// parameters are assigned based on the needs
// of the code; and for the sake of simplicity
// in this example, the variables are assigned
// arbitrary values.
long timestamp = 0x1111;
int markId = 01;
string markText = "Exercising CommentMarkAtProfile...";
// Declare MarkOperationResult Enumerator.
// Holds return value from call to CommentMarkAtProfile.
MarkOperationResult markResult;
markResult = DataCollection.CommentMarkAtProfile(
timestamp,
markId,
markText);
// Check result of CommentMarkAtProfile call.
Console.WriteLine("CommentMarkAtProfile returned {0}",
markResult);
}
アクセス許可
- 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。
重要 :