This example for you to share the simple C + + QQ program server-side implementation code for your reference, the specific content as follows
ServerDlg.cpp:implementation File//#include "StdAfx.h" #include "Server.h" #include "ServerDlg.h" #ifdef _DEBUG #d
Efine new debug_new #undef this_file static char this_file[] = __file__; #endif #define WM_SHOWTASK wm_user+1 #define WM_SERVER_ACCEPT wm_user+2///////////////////////////////////////////// CAboutDlg dialog used for App about class Cabo
encounter DDX_Control, SubclassWindow, SubclassDlgItem, and so on, different sub-class methods. First look at the following code: voidAFXAPI DDX_Control (cdataexchange* PDX,intNIDC, cwndRcontrol) {if((Rcontrol.m_hwnd = = null) (rcontrol.getcontrolunknown () = = null))//Not subclassed yet{ASSERT (!pdx->m_bsaveandvalidate);pD x-PrepareCtrl (NIDC); HWND Hwndctrl; PDX
through the VC Class View, the VC document view structure is more suitable for on-demand database management programs. Third, C ++ has many excellent template libraries and better generic design, which will solve major problems in key cases.
The following text is taken from msdn and describes how to call the. NET control in MFC. The controls in the example are not only applicable to user-defined controls, but also can use various built-in standard controls in. net. For example, we can directly
"owner draw"
Add two ICON resources to the project: idi_msn_icon (MSN icon) and idi_refbar_icon (Windows System icon ).
Modify the "calldlldlg. H" header file of the project:
# Include ".../mfcexpenddll/sxbutton. H" // export Class header file containing DLL# Pragma comment (Lib, "mfcexpenddll. lib") // implicitly link the DLL//////////////////////////////////////// /////////////////////////////////////// Ccalldlldlg Dialog
Class ccalldlldlg: Public cdialog{// ConstructionPublic:Ccalldlldlg (cw
processed, the I/O manager calls it once.StartioRoutine:VOID StartIo(PDEVICE_OBJECT device, PIRP Irp){ PIO_STACK_LOCATION stack = IoGetCurrentIrpStackLocation(Irp); PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) device->DeviceExtension; ...}Startio routines get control at the dispatch_level level, which means that this function cannot generate any page faults. In additionCurrentirpDomain andIRPAll parameters point to the IRP sent by the I/O manager.S
I recently looked at C ++ and wrote a program to play with it. Because the user-mode code is difficult to intercept the QQ password, write a hierarchical keyboard driver. The test results are acceptable.
Development Environment vs2008 winddk ddkwizard WindowsXP dbgview
Implementation Method
1. Mount the filter driver to the keyboard driver.
2. Set completion routine
3. output the Keyboard Scan code to debugview through kdprint
4. Read the keyboard keys from the log file of debugview.
Code
1
) {lpmeasureitemstruct->itemheight =:: G
Etsystemmetrics (Sm_cymenucheck);
}
3. Now we can test it. Drag a ListBox control, and then define a variable M_listbox for the Ccolorlistbox type. You can manually add the following code directly to the location below, or you can add it automatically via MFC ClassWizard.
Add in header file in main dialog header file
Dialog Data
//{{afx_data (clogsystemtestdlg) ...
Ccolorlistbox M_listbox;
}}afx_data
Add code to the DoDataExchange () function in t
");
//Create a Device object
Status = IoCreateDevice (
DriverObject,
sizeof (device_extension),
(unicode_string) Devname,
File_device_unknown,
0,
FALSE,
FDO);
if (! Nt_success (status))
return status;
//Get the data structure of the device extension. This data structure is generally defined by the user, saving some device-related information
Pdevice_extension PDX = (pdevice_extension) fdo->deviceextension;
//Configure th
, developers can set the properties of the control in the pop-up properties page.
To modify the property of a control on the property page, you must place some controls on the property page to modify the property value. For example, if we have added a caption attribute, we need to provide the function of modifying this attribute on the attribute page. Generally, we need to use a text input box. In this way, we place an edit control in the dialog box on the property page and set the ID to id
controls:Uint m_nwidthpixels, uint m_nheightpixels, uint m_nbitsperpixel3. Compile and run the program by clicking the button in the dialog framework.Iii. Implementation Code
//////////////////////////////////////// //// // Chngdsplymddlg. h: header file# If! Defined (afx_chngdsplymddlg_h1_1d52415e_62de_11d6_8f32_00e04ce762401_encoded _)# Define afx_chngdsplymddlg_h1_1d52415e_62de_11d6_8f32_00e04ce762401_encoded _# If _ msc_ver> 1000# Pragma once# Endif // _ msc_ver> 10
(hdropinfo );
Cdialog: ondropfiles (hdropinfo );}
Similarly, if a response is returned only when you drag a file to a specific control, you only need to check the accept files style of the control.
========================================================== ==============================================
// Reclogcheckdlg. h: header file//
# Pragma once
// Creclogcheckdlg dialog boxClass creclogcheckdlg: Public cdialog{// ConstructPublic:Creclogcheckdlg (cwnd * pparent = NULL); // standard Const
Vc6When classwizard is used on the interface, the parsing error dialog box is displayed, prompting parsing error: Expected ")" input line: "ddx_check (PDX, idc_check0, m_boutcolumn [0]);"CsdnHaibo2806 solves the problem. Thank you!
Solve the problem! As shown in the following figure, do not write the ing function manually added in the middle of the comment line. Add it to the end.
// {Afx_data_init (cassessweightpage)
// Note: The classwizard will a
Today, when I was bored at school, I made a calculator, and I wanted to go to bed on network theory. So I used VC to write a calculator. It was not perfect, but the function was implemented ..
// Calculator DLG. cpp: implementation file//
# Include "stdafx. H"# Include "Calculator. H"# Include "Calculator DLG. H"
# Ifdef _ debug# Define new debug_new# Endif
// Used for the caboutdlg dialog box of the "about" menu item of the application
Class caboutdlg: Public cdialog{Public:Caboutdlg ();
// Di
Data Exchange (DDX) and data validation (DDV) in the dialog box in MFC)DDX: dialog data exchangeDDV: dialog data validationThis document describes the ddx ddv mechanism in MFC. How to Use the DDX _ and DDV _ Functions and customize your own DDX _ and DDV _ functions;
Dialog data exchange summary:The data exchange in the dialog box does not depend on any macro implementation, and all depends on the C ++ code implementation. The only difference is that if you want to process your own data interact
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.