#include "d3dx9.h"
#pragma comment(lib, "d3dx9.lib")
HRESULT TakeScreenshot(LPDIRECT3DDEVICE9 pDev, char *pszFileName)
{
HRESULT hr; D3DDISPLAYMODE mode;
hr = pDev->GetDisplayMode(0, &mode);
if(FAILED(hr))
{
return hr;
} // create the image surface to store the front buffer image
LPDIRECT3DSURFACE9 pSurf;
hr = pDev->CreateOffscreenPlainSurface(mode.Width, mode.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &pSurf, NULL);
if(FAILED(hr))
{
return hr;
} // read the front buffer into the image surface
hr = pDev->GetFrontBufferData(NULL, pSurf);
if(SUCCEEDED(hr))
{
// D3DXIFF_BMP = 0
// D3DXIFF_JPG = 1
// D3DXIFF_TGA = 2
// D3DXIFF_PNG = 3
// D3DXIFF_DDS = 4
// D3DXIFF_PPM = 5
// D3DXIFF_DIB = 6
// D3DXIFF_HDR = 7
// D3DXIFF_PFM = 8
hr = D3DXSaveSurfaceToFile(pszFileName, D3DXIFF_PNG, pSurf, NULL, NULL);
}  // release the image surface
if(pSurf)
{
pSurf->Release();
} return hr;
}
出现这个错误:LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/111.exe : fatal error LNK1120: 1 unresolved externals 
工程-> link属性:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/111.pdb" /debug /machine:I386 /out:"Debug/111.exe" /pdbtype:sept 如果/subsystem:windows改成/subsystem:console  那么它又出现这个情况LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/111.exe : fatal error LNK1120: 1 unresolved externals
不知道该怎么改了  哪位好心人 解答一下。。