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 ..