R
Rafael Campana
Hi,
I posted the messsage below last week, but no replies,
I've reproduced the problem with a VB macro, just create
one and paste the following code. Let me know of any
workarounds you can think of.
thanks,
-R a f i
' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module1
Sub TestRelPath()
Dim file As VCFile
Dim col As IVCCollection
Dim idx As Integer
Dim prj As VCProject
prj = DTE.Solution.Projects.Item(1).Object
col = prj.files
'Add a file relative to the TEMP environment
variable
Dim foo As VCFile = prj.AddFile("$(TEMP)\foo.h")
MsgBox(foo.FullPath)
'The following should return a path relative to
the env var not .\
MsgBox(foo.RelativePath)
foo.RelativePath = "C:\Documents and
Settings\bkretzler"
MsgBox(foo.RelativePath)
'The following statement does not set the
RelativePath
foo.RelativePath = "$(TEMP)\foo.h"
MsgBox(foo.RelativePath)
End Sub
End Module
----------------------------------------------
Subject: VS 2002 vs. VS 2003 wizard problem
From: "Rafi" <[email protected]> Sent: 9/10/2003
11:16:51 PM
Hi,
(not sure if this is the right newsgroup or not, please
let me know)
We've developed an add-in with wizards, etc for VS 2002,
and worked without a problem. The changes has been made
for it to work with VS 2003, but there's a roadblock that
can't get around.
The wizards adds some files to the project relative to an
environment variable for example: "$(TEMP)\foo.c". This
is shipping to customers and works great in VS 2002, now
in VS 2003 it does not work, after the wizard (no code
has changed) finishes, the relative path is ".\$(TEMP)
\foo.c" which breaks everything. I was able to modify
manually the .vcproj after it is created to be "$(TEMP)
\foo.c" and work ok, but I'd like to handle that in the
wizard, has anyone ran into this problem? any ideas,
solutions?
I've got a wizard that exhibits the problem, let me know
if you want me to send it to you all, but below is a
JScript snippet
thanks,
......
var thefile = srcFolder.AddFile(strFilePath);
// This works - get RelativePath
var filepathinfo = thefile.RelativePath;
/* Shouldn't one of the following work?: */
//thefile.RelativePath("c:\\readme.txt");
//thefile.RelativePath = "c:\\readme.txt";
/* If I can set the RelativePath I can workaround the
problem, but I can't */
I posted the messsage below last week, but no replies,
I've reproduced the problem with a VB macro, just create
one and paste the following code. Let me know of any
workarounds you can think of.
thanks,
-R a f i
' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module1
Sub TestRelPath()
Dim file As VCFile
Dim col As IVCCollection
Dim idx As Integer
Dim prj As VCProject
prj = DTE.Solution.Projects.Item(1).Object
col = prj.files
'Add a file relative to the TEMP environment
variable
Dim foo As VCFile = prj.AddFile("$(TEMP)\foo.h")
MsgBox(foo.FullPath)
'The following should return a path relative to
the env var not .\
MsgBox(foo.RelativePath)
foo.RelativePath = "C:\Documents and
Settings\bkretzler"
MsgBox(foo.RelativePath)
'The following statement does not set the
RelativePath
foo.RelativePath = "$(TEMP)\foo.h"
MsgBox(foo.RelativePath)
End Sub
End Module
----------------------------------------------
Subject: VS 2002 vs. VS 2003 wizard problem
From: "Rafi" <[email protected]> Sent: 9/10/2003
11:16:51 PM
Hi,
(not sure if this is the right newsgroup or not, please
let me know)
We've developed an add-in with wizards, etc for VS 2002,
and worked without a problem. The changes has been made
for it to work with VS 2003, but there's a roadblock that
can't get around.
The wizards adds some files to the project relative to an
environment variable for example: "$(TEMP)\foo.c". This
is shipping to customers and works great in VS 2002, now
in VS 2003 it does not work, after the wizard (no code
has changed) finishes, the relative path is ".\$(TEMP)
\foo.c" which breaks everything. I was able to modify
manually the .vcproj after it is created to be "$(TEMP)
\foo.c" and work ok, but I'd like to handle that in the
wizard, has anyone ran into this problem? any ideas,
solutions?
I've got a wizard that exhibits the problem, let me know
if you want me to send it to you all, but below is a
JScript snippet
thanks,
......
var thefile = srcFolder.AddFile(strFilePath);
// This works - get RelativePath
var filepathinfo = thefile.RelativePath;
/* Shouldn't one of the following work?: */
//thefile.RelativePath("c:\\readme.txt");
//thefile.RelativePath = "c:\\readme.txt";
/* If I can set the RelativePath I can workaround the
problem, but I can't */