The error below:
Component MSDATGRD.OCX or one of its dependencies not correctly registered: a file is missing or invalid
is probably because you haven't registered the ocx component. If you are manually distributing this component, then you also need to register it in the user's machine. To do so you issue the following command:
regsvr32 msdatgrd.ocx
from the command line (note that you need to have admin rights).
If you don' want to install the application in a typical application directory (i.e.: C:\Program Files) you can use the %APPDATA% or %LOCALAPPDATA% variables to get Romaming (if on a network) and Local user's application directory, respectively. You can also use Windows API to do that. For example:
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, szPathName)))
{
PathAppend(szPathNam, _L"\\YourCompany\\YourProduct\\") );
}
Besides the .ocx (which is a Dll that implements specific interfaces), you should note that if you use other methods from a DLL you wrote inside your setup.exe then you have to export them. Nice articles below:
http://msdn.microsoft.com/en-us/library/z4zxe9k8.aspx
http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL
c++ exporting and using dll function
EDIT:
I found this:
Use OCX without registering it
Be aware the Windows XP will be descontinued in April 2014!! Also note that doing this is a dirty hack and should be avoided. I don't know what happens on Windows 7 and Windows 8 (honestly you shouldn't spend time with tricks, but changing to a portable dll component)
Also I heard about http://boxedapp.com/ I've never used but it worth a look.