Visual Studio2005 Beta2 & "Add Link to existing Item"

N

Norbert

Hello

I have a weird behavior from VS2005 Beta2
Probably I missusing the feature...

What I want:
I have an PPC project.
but I also want to run it on a normal PC (for testing purposes)

I created a new "Windows Project" and added all the necessary files
from
the orignal project with
Add -> existing Item -> Add as Link

I modified the code where necassery with the following lines (for
example)
#if PPC_VERSION
private Microsoft.WindowsCE.Forms.InputPanel inputPanel1;
#endif

and in the PPC project I added the entry PPC_VERSION to the "Project
properties"
It builds without problems for the PPC-Project (as it was intended)

But if I compile the normal PC project it tells me, he cannot find the
"Microsoft.WindowsCE.Forms" Namespace, because he is compiling this
lines!
But I definitly never added a the PPC_VERSION define to the pc-project!

What I'm doing wrong??

I tried the approach from
http://www.danielmoth.com/Blog/2005/01/deploy-to-my-computer.html
but acutaly I destroyed my VS2005 installation, so I'm not able to
deploy to any device!!! Thats the reason for using another approach.

Regards

Norbert
 
D

Daniel Moth

1. The "Deploy to My Computer" steps on the blog entry you refer to are for
November CTP (as stated there) - for Beta 2 you need to follow alternative
steps which are at the bottom (read the last line). If you have done the
latter and are still having problems contact the appropriate person from the
link.

2. Sharing code between both platforms works as advertised and your approach
is correct; except you shouldn't try to share forms code since the designer
will regenerate the code! Note that with VS2005 there is already a constant
defined for you so you don't need to redefine your own (PocketPc)

3. Regardless, you should double click on the compiler error to see which
line it takes you to. I suspect that you have not wrapped all references to
InputPanel with #if. I tried to replicate your problem and it all works
nicely as expected on mine.

If you still think you are doing everything right, zip the project up and
make it available to us for comment.

Cheers
Daniel
 
N

Norbert

Thanks for the answer

I tried the same approach again, with the same files
-> now its working (I have no clue what I done wrong the first time
:-? )

How is the name of the already defined constant?
"PocketPc" doesn't seem to work...
When is the variable set?
Do I have to change some projekt settings?

br Norbert
 
D

Daniel Moth

How is the name of the already defined constant?
Create a *new* device project. Go to project properties, Build tab and look
under General at the Compilation Symbols.

Intellisense doesn't help you in code but since you are using C# you can see
if any constant is defined by the colorization of the code enclosed in the
#if (grey means it is not defined; normal it is). Any VBers out there go
vote for this to be added to VB:
http://lab.msdn.microsoft.com/produ...edbackid=30b8d0b2-e0f1-487e-89bc-5c0ba420629f

Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top