Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / March 2007

Tip: Looking for answers? Try searching our database.

Using Envirnoment Variable to Add Existing FIle

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
libin_v - 30 Mar 2007 07:23 GMT
Hi all,
I have an Envirnoment Variable set, eg: SOMESDK_DIR to C:\somesdk ie.

<In COMMAND Window>
c:\SET SOME_DIR
c:\somesdk
<end>

Now I have some files in this SDK a.c and b.c. I want to include them
in the project. When I try adding the file, using the Add Existing
Files option, the absolute path is taken. I tried editing the vcproj
file in an editor and found the following

<CODE>
<Filter
    Name="Source Files"
    Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
    UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
    >
    <File
        RelativePath="c:\somesdk\a.c"
        >
    </File>
    <File
        RelativePath="c:\somesdk\b.c"
        >
    </File>
</Filter>
</CODE>

I replaced the above with

<CODE>
<Filter
    Name="Source Files"
    Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
    UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
    >
    <File
        RelativePath="$(SOMESDK_DIR)\a.c"
        >
    </File>
    <File
        RelativePath="$(SOMESDK_DIR)\b.c"
        >
    </File>
</Filter>
</CODE>

When I try opening the file, I get the following error

"c:\work\testproject\$(somesdk_dir)\a.c Cannot open file"

C:\work\testproject is my project dir.

Can someone please tell me who to add an Envirnoment Variable?

--
Regards
Libin
Rory Becker - 30 Mar 2007 07:45 GMT
> Can someone please tell me who to add an Envirnoment Variable?

I think ...

-------------------------------------------------------------
RelativePath="%SOMESDK_DIR%\b.c"
-------------------------------------------------------------
... will do it

--
Rory
libin_v - 30 Mar 2007 08:12 GMT
> -------------------------------------------------------------
> RelativePath="%SOMESDK_DIR%\b.c"
> -------------------------------------------------------------
> ... will do it

Rory, Still says "c:\work\testproject\%SOMESDK_DIR%\b.c Connnot Open
File"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.