質問

I've converted an old Visual C++ 6.0 project to a new Visual C++ 2010 one. It functions but I have a problem with the post build event which I took from the old project. It registered the target file (an .ocx) on the computer:

copy $(ProjDir)\PDFXChange\dll.Debug\*.* $(TargetDir) 
regsvr32 /s /c "$(TargetPath)" 
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"

In my new solution it doesn't work. I've also tested it in single commands: of the three commands (copy, regsvr32 and echo) only the last one could be executed. What could be my error.

Error:

error MSB3073: The command "copy \PDFXChange\dll.Debug\*.* C:\_tests_\ocx2010\Debug\ 
regsvr32 /s /c "C:\_tests_\ocx2010\.\Debug\LayoutBox.dll" 
echo regsvr32 exec. time > ".\Debug\\regsvr32.trg"
:VCEnd" exited with code 3. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets

COPY and REGSVR32 seem not to work.

役に立ちましたか?

解決

The problem was in the name of the macro $(ProjDir). In Visual C++ 2010 it's $(ProjectDir)

$(ProjDir) -> $(Proj ect Dir)

Some macros altered their names (after so many years)!

The command copy \PDFXChange\dll.Debug*.* C:tests\ocx2010\Debug should copy some DLLs into the folder where the next command regsvr32 /s /c "C:tests\ocx2010.\Debug\LayoutBox.dll tried to register the target file. It couldn't find any DLLs there, so it quit with the error message.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top