Some students asked this question ,here I give the answer.
1. the most easy way,we use the guide. After you append your ocx or dll files ,you select one ,in the properties dialog you will see one option--"Self Register",if you tick this option,the final setup will register your selected dll or ocx file to the target PC. There is a premise to make the method run OK--the ocx or dll should be self-registeralbe.
Here is the running pic:
2.Another way,we use the InstallScript.
Here is the code:
string yourPath;
yourPath = TARGETDIR;
LongPathToShortPath(yourPath);
LaunchAppAndWait(WINSYSDIR ^ " RegSvr32.exe " ,yourPath ^ " *.ocx " ,WAIT);
yourPath = TARGETDIR;
LongPathToShortPath(yourPath);
LaunchAppAndWait(WINSYSDIR ^ " RegSvr32.exe " ,yourPath ^ " *.ocx " ,WAIT);
This method can solve most registering cases.
Nasky