Long in C # and long in C ++

Source: Internet
Author: User

Microsoft is very good. c ++ is a very good computer language. C # is better than C ++, and C # = C ++. # Does it contain four + numbers? Microsoft invented C #! In C #, long is twice as long as in C ++ !!. Believe it or not:

I am using. net write a program for booking queues, because a previously written Control for displaying registration information through VC, now use C # re-booking program, the schdule control written by VC must be called. I encapsulated MFC through C ++. NET and created a usercontrol, which is called by C. Here, there is a function additem (begintime, endtime, stext, backcolor). In the function of the MFC version, the backcolor parameter type is colorref, while C ++. net encapsulation data type is long, C # Will call C ++. the additem function in the. NET format. C # reads the color value from the database and stores it in a long variable, then pass the long data of this C # version as a parameter to C ++.. Net version of additem. As a result, the program is incorrectly described during compilation, and the system prompts that the last parameter of additem is incorrect.

After careful analysis, we found that the original C ++. the long type in net is 32-bit, while the long type in C # is 64-bit. Although it looks the same on the surface, it is actually different. The final solution is in C ++. in. net, replace long with int64, compile and run properly.

I hope you will pay attention to this problem ..

 

Related Article

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.