How does. net use C ++ code? Mutual access between hosted C ++ and unmanaged C ++

Source: Internet
Author: User

Recently, a scientific research topic called Texture Synthesis (seamless texture synthesis) is proposed to solve the problems such as seams in texture ing, that is, seamless textures can be done using Photoshop, this is a program to generate seamless textures. It is a 3D design or a necessary algorithm for development. Part of this is the c ++ implementation. I only use Microsoft. net Framework, what should I do?

Using MFC? It is unwise. The best way is to host C ++ and non-hosted C ++ for mutual access.

Development Tool Microsoft Visual Studio 2008 Express (VC ++ 2008 express), of course, VC ++ 2005 can also

Key Code: (add the header file)

# Using <mscorlib. dll>

Then you can enjoy the advantages of hosting C ++ and non-hosting C ++.

For basic types, such

Int A = 4;

System: int B = 4;

A = B;

B =;

For string, the string can be:

// String example;
Char examplefile [900] = "";
Int I = 0;
For each (char C in example)
{
Examplefile [I] = C;
I = I + 1;
}

Note: The C ++ implementation does not use Unicode, and the string cannot contain Chinese characters. Otherwise, a strange problem occurs.

Example: Texture Synthesis http://download.csdn.net/source/457002

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.