Hi,
I'm hooked with the wizard scripting and I'm trying to understand it better with my limited programming skills.
I like the scripting because I get instant result and C::B don't disappear if I make something wrong it just throws a warnings and tells me where to look at. I'm trying to make me a new project wizard, but having trouble with this part of the code:
startupScript = project.AddBuildTarget( _T("Startup") );
TargetIndex = project.GetBuildTarget( startupScript );
ProjectManager.AddFileToProject( _T("src\\test.c"), project , TargetIndex ) ;
I looked at the sdk files, and I found out that GetBuildTarget has two versions, one I can pass an index and get a name, the other I can pass a name and get and index. I get an error with 3rd line of above code,
TargetIndex seems not correct. What is the correct way to get the index of the targets?
I looked at the sdk files, and I found out that GetBuildTarget has two versions, one I can pass an index and get a name, the other I can pass a name and get and index. I get an error with 3rd line of above code,
Both of them returns a ProjectBuildTarget pointer.
Change the code to-
startupScript = project.AddBuildTarget( _T("Startup") );
ProjectManager.AddFileToProject( _T("src\\test.c"), project , -1 ) ;
This should work.