This paper describes an example of VC to realize Gobang game, the algorithm uses Minimax pruning game algorithm, interested readers can modify and improve the imperfect part of the program.
This design mainly includes: data structure, valuation function, victory and defeat judgment, search algorithm
The program running interface is as follows:
The following steps are implemented:
1. Data structure
Record each move, you can establish a li
This paper briefly introduces the two ways to achieve the height of the task bar VC, the specific code as shown below, the reader can choose according to their own needs or improve the modification.Method One:
Trect RT;
SystemParametersInfo (Spi_getworkarea, 0, rt, 0);
The taskbar is below the height
int y =:: GetSystemMetrics (Sm_cyscreen)-rt. Height ();
Above
y = rt.top;
Left
y = rt.left;
Right
y =:: GetSystemMetrics (Sm_cxscreen)-rt. Width ();
I believe anyone who has studied VC knows the use of the MessageBox () function:
int MessageBox (
hwnd hwnd, //Handle to owner window
LPCTSTR lptext, //text in message box
LPCTSTR LP Caption,//message box title
UINT utype //message box style
);
Although you can specify some styles in the parameter utype, there is not much you can define in your program for the appearance of the MessageBox. The reason is that when the Messa
This paper mainly introduces the VC programmable control parts Class Htcontrol Chtgdimanager GDI resource Management Class Usage, MFC provides the CBitmap class LoadBitmap interface can only obtain the bitmap from the exe inside, but in many cases need to obtain from the EXE outside, The Chtgdimanager class provides an interface for obtaining bitmaps from outside the EXE, using the following methods:
M_hbmpbtnclosenormal = M_htgdimanager.getbi
coordinates | | Output parameters: none | | return value: none | | Description: When the parent form background uses a static bitmap and the form itself is transparent (including form use | |
Bitmap has transparency or the form does not have a background bitmap), you need to call this interface | /void Setparentbgbitmap (HBITMAP
Hparentbgbitmap, int x = 0, int y = 0); /****************************************************************************
| function function: Set parent form backgrou
On the multiplication table, here is not much nonsense, we all understand, the following next use VC + + implementation of the idea code:
Multiplication table. cpp
Copy Code code as follows:
#include int main ()
{int i,j;
for (i=1;i{for (j=1;jprintf ("%d¡á%d =%2d", j,i,i*j);
Putchar (' \ n ');
}
GetChar (); GetChar ();
return 0;
}
Multiplication Formula Table 2.cpp
Copy Code code as follows:
#i
("congratulations!");
}
Else
{
printf ("Sorry, you failed!");
}
Getch ();
return 0;
}
/*
Special keys are two bytes, the first byte is a special key (the normal key is a byte), the second byte is the key of the ASCII code,
When the "normal key" is pressed, its low 8 digits hold the ASCII code of the character.
For special keys, the lower 8 digits are 0. Special keys include arrow keys, function keys, and so on. High 8-bit byte to store the scan code of the key
#define Key_left K Le
The use of VC + + can write their own software installation program. Here just create the installer type of MSI file, with Orca Open is the correct file format, worth recording, MSI database inside the various table relationship is complex, not won't be can study clearly. This article only makes one simple analysis, realizes writes a program to attach to the software program's behind, thus may have the installer MSI file directly after the compilation
VC Read XML Simple Example
XML has recently been blown marvellous, a lot of data exchange, including a lot of middleware systems, WebService, software configuration files, are in the XML technology, is really a good thing, I preface, wrote a read the XML snippet, with some of MSXML's interface.
I read the configuration file for the BT software, and the XML content is as follows:
The code is as follows:
#include "stdafx.h
Using VC to draw logarithmic coordinate system
Objective: To draw the logarithmic coordinates with any frequency as the starting point and at any frequency as the end point, and to scale the coordinates arbitrarily.
Implementation method:
= = = "Update 2013-12-18": =========================================================
It's a stupid way to find out the way you used to be today. In fact, as long as you know the x coordinates of any two points and i
http://www.gissky.com/GIS/ShowArticle.asp?SID=12ID=1178
Combining GIS tool software with today's visual development language integration two times development method is the mainstream of GIS application development. Its advantage is that can make full use of the GIS tool software to the spatial database management, the analysis function, but also may use other visual development language to have the high efficiency, the convenience and so on programming merit, sets both the director ...
MAPX is
Encryption and decryption EXE algorithmAES encryption and decryption algorithm may have been implemented by others, there are also some of the VC code on how to manipulate custom resources, I just put them in a combination, applied together, and used some small memory manipulation techniques, today will be done before the function summed up ... Search on the Internet, as if there are few related to this use, is the original bar, interested friends can
1. The exported function of VC + + DLL is defined as the export function of standard C:
Copy Code code as follows:
#ifdef Lrdlltest_exports
#define LRDLLTEST_API __declspec (dllexport)
#else
#define LRDLLTEST_API __declspec (dllimport)
#endif
extern "C" Lrdlltest_api int Sum (int a, int b);
extern "C" Lrdlltest_api void GetString (char* pchar);
A + b
LRDLLTEST_API int Sum (int a, int b)
{
return a + B;
}
In programming, it is often necessary to use random numbers, of course, the program (function) itself can not generate so-called real random number, but also need a random seed, and then according to the established algorithm to calculate a definite result. If we only need a finite time or a random number of times to require a longer interval, we can also use the current time (timestamp) as a random number. Since time can be a random number, why do we need a special random function? This involve
, when you create a control by hand, you build a control object and then create a control window on the screen using the CREATE function, which means that the control's creation is done by the control object. The idea of a dynamic connection is different, and SubclassDlgItem can dynamically connect the controls that are already in the dialog box to a Window object that takes over the message processing of the control, giving the control a new feature. The declaration of the SubclassDlgItem funct
In VC mapping, the direct mapping to the screen of the CDC, because the surface of the time is stuck in different times caused the screen flicker. The solution to this problem is to first draw the picture onto the memory canvas, at once to the screen, memory mapped to the screen quickly, so it does not cause flicker.
CDC m_dcMem; //创建内存画布 CBitmap m_bmpMemDC; //创建内存画布的 //初始化内存画布 CDC* pDC = GetDC(); if(pDC->GetSafeHdc()) {
One, what is WebService?
WebService is actually a web-based application that provides a certain calling interface to external programs. An external (remote) program that can be invoked via the Web.
Second, the characteristics of WebService:
1. Because WebService is published via a Web server, it can go through the firewall more smoothly than DCOM. This is also one of the advantages of WebService, it can be said that WebService, for the development of distributed applications, provides a good
Environment: Windows 2003,VC 6.0
Absrtact: Start with a COM service program, then transform an MFC project into a service program, and finally let this program display a graphical interface at startup.
Keyword: Windows service program COM Service starts NT service and desktop interaction before booting
One, what is the Windows service program?
You can see it using the following methods.
Open the Control Panel, then the Management tool, which has
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.