That site is very bad, since it lacks any error checking at all. Every directX call that returns HRESULT MUST be checked for errors. If it returns S_OK everything is ok. Check the documentation and make sure you check EVERY directX return value.
Your shader probably has errors and fails to compile so you probably pass a NULL pointer to CreateVertexShader.
Here is how I check for errors:
First put this somewhere (you don't need all of those includes and libs for this, but I'm not sure which are a must for this to work):
#include <D3D11.h>
#include <DXGI.h>
#include <DxErr.h>
#include <D3D11Shader.h>
#include <D3Dcompiler.h>
#include <D3DX11async.h>
#if defined(_DEBUG)
#pragma comment(lib,"d3dx11d.lib")
#else
#pragma comment(lib,"d3dx11.lib")
#endif
#pragma comment(lib,"d3d11.lib")
#pragma comment(lib,"dxgi.lib")
#pragma comment(lib,"DxErr.lib")
#pragma comment(lib,"d3dcompiler.lib")
#ifndef HR
#define HR(x){HRESULT hr=x;if(FAILED(hr)){DXTraceW(__FILE__,(DWORD)__LINE__,hr,L#x,true);TRUE;}}
#endif
Now, for every directX call that returns HRESULT (all Create* calls or the compile_shader_from_file calls), do this:
HR(device->CreateVertexShader(shaderBlob->GetBufferPointer(),shaderBlob->GetBufferSize(),NULL,&vs));
Note the "HR(" at the beggining and obviously another ")" at the very end. If this directX call fails you will get an error message.
Additionaly for shaders you must get some more data to see what you actually screwed up when writing HLSL code. Here is how I do it:
ID3D10Blob* shaderBlob=NULL;
ID3D10Blob* errorBlob=NULL;
HR(D3DX11CompileFromFileA(fileName.c_str(),macros,NULL,mainFunction.c_str(),shaderModel.c_str(),
shaderCompileFlags,0,NULL,&shaderBlob,&errorBlob,NULL));
if(errorBlob)
{
char* es=reinterpret_cast<char*>(errorBlob->GetBufferPointer());
NXMsg("ERROR",es);// Shows error message box
errorBlob->Release();
return NULL;
}
The format of the files with the HLSL code doesn't matter. Usually people choose something like .hlsl, .vs (vertex shader), .ps(pixel shader) or whatever.