Posts

Showing posts from September, 2012

Refer to .net assemblies from vc9/.net 3.5 apps

Our partner gave us some components built with .net 4.0, and our hosting application is mixed application based on 3.5, when trying to refer to them, the compiler complains with errors. Finally figure out how to make it work. After inserting the reference, unload the project, manually adding the 1: < ProjectReference Include ="XXXX.csproj" > 2: < Project > {2897acf2-f168-4c4b-8a4e-b1dedd8733fc} </ Project > 3: < SpecificVersion > true </ SpecificVersion > 4: </ ProjectReference > <SpecificVersion> node also applies to the assembly reference. Then force the app to load .net 4.0 during the runtime:   1: < startup useLegacyV2RuntimeActivationPolicy ="true" > 2: < supportedRuntime version ="v4.0" /> 3: </ startup > If using visual studio 2010 to build vc9/3.5 c++ apps, change the target to vc9, then manually change the target framework to 3.5: 1: ...

Trigraph in C literal string

Image
Last week, one of my colleague asked me one question, the c++ codes like: char *p = "??--AB"; will be translated to “~-AB” automatically by the compiler. After checking the standard reference document, found Really an interesting point for old C codes The wiki says: History The basic character set of the C programming language is a subset of the ASCII character set that includes nine characters which lie outside the ISO 646 invariant character set. This can pose a problem for writing source code when the keyboard being used does not support any of these nine characters. The ANSI C committee invented trigraphs as a way of entering source code using keyboards that support any version of the ISO 646 character set. [ edit ]Implementations Trigraphs are not commonly encountered outside compiler test suites . [1] Some compilers support an option to turn recognition of trigraphs off, or disable trigraphs by default and require an option to turn them on. Some can is...