You must move the declaration of the hInst variable into the MEMORY.H header file. This ensures that the variable is accessible in all segments. The hInst variable is used in the WinMain and MemoryWndProc functions.