Aracılığıyla paylaş


VERIFY

mfc hata ayıklama sürümünü bağımsız olarak değerlendirilir.

VERIFY(booleanExpression )

Parametreler

  • booleanExpression
    Sıfır veya 0 olarak değerlendirir bir ifade (işaretçi değerleri dahil) belirtir.

Notlar

Sonuç 0 ise, makro tanılama iletisi yazdırır ve program durur.Koşul sıfır ise, hiçbir şey yapmaz.

Tanılama iletisini formu vardır.

assertion failed in file <name> in line <num>

Burada ad kaynak dosyasının adıdır ve num satır kaynak dosyada başarısız belirtilme sayısıdır.

mfc, yayın sürümünde doğrulama ifade olarak değerlendirilir ancak yazdırmak veya programı kesmez.İfade bir işlev çağrısı, örneğin, arama yapılır.

Örnek

// VERIFY can be used for things that should never fail, though
// you may want to make sure you can provide better error recovery
// if the error can actually cause a crash in a production system.

// It _is_ possible that GetDC() may fail, but the out-of-memory
// condition that causes it isn't likely. For a test application,
// this use of VERIFY() is fine. For any production code, this
// usage is dubious.

// get the display device context
HDC hdc;
VERIFY((hdc = ::GetDC(hwnd)) != NULL);

// give the display context back
::ReleaseDC(hwnd, hdc);

Gereksinimler

Başlık: afx.h

Ayrıca bkz.

Başvuru

ASSERT (MFC)

Kavramlar

mfc makrolar ve Globals