I'm confused as to what you are doing. AVR Studio is designed to be used with a programmer to program a "bare" AVR chip. I suppose you could make use of the bootloader burned into the Arduino chips, tho. But since you list the ATmega168, does this mean you actually have an Arduino? Or the Arduino environment?
I going to go out on a limb here and guess that what you have is either a naked chip or one of the Arduino boards, and a programmer which you have hooked up to the 6-pin header on the Arduino. But then you are compiling your code within the AVR Studio environment.
The code example you give below is correct and particular to the Arduino environment. I find it likely that these functions do not have the same names in the AVR Studio environment, and thus your code won't compile. I've been working with avr-gcc myself, and the basic library set doesn't use anything like "pinMode(pin, OUTPUT)" as a function.
(But perhaps that function is in a library in the Arduino folder? It would be specific to the ATmega168 only, tho, right?)
In any case. This entirely depends on what your desired process it. But it looks like you should make a choice, for the present between;
A) Use the complete Arduino (hardware and software environment) as designed; use Arduino 11 to compile and load a program through the USB connection to a chip with a pre-existing bootloader, or
B) Read up on the equivalent functions and code examples in AVR Studio, and load to any AVR chip (including the one sitting on an Arduino board), via the 6-pin programming header.
Am I making any sense?