Why have a DLL at all then if you just want to embed it inside the EXE?
[snip, edit]
So, to do this, you just need to add the DLL file as a resource, and use FindResource
/ LoadResource
to extract it somewhere. You will need to write it to the filesystem if you want to load the DLL. Here's a function (C++) I use in a project to load a text file from a resource. You should be able to easily modify this for your purposes. NOTE that there is no error checking here; it's just to show you the basic idea.
std::string LoadTextFileResource(HINSTANCE hInstance, LPCTSTR szResName, LPCTSTR szResType)
{
HRSRC hrsrc=FindResource(hInstance, szResName, szResType);
if(!hrsrc) return L"";
HGLOBAL hg1 = LoadResource(hInstance, hrsrc);
DWORD sz = SizeofResource(hInstance, hrsrc);
void* ptr1 = LockResource(hg1);
// assume the encoding is ASCII.
return std::string((const char*)ptr1, sz);
}