Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the global function of MFC

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

MFC global function is what, for this problem, this article details the corresponding analysis and solution, hoping to help more want to solve this problem of small partners to find a simpler and easier way.

1. MFC diagnostic functions

AfxCheckMemory checks the integrity of all currently allocated memory

AfxDump dumps the state of the object if called within the debugger

AfxDumpStack generates an image of the current stack, usually statically linked

AfxEnableMemoryTracking Turns memory tracking on or off

AfxIsMemoryBlock Checks if a memory block is allocated correctly

AfxIsValidString Checks whether a string pointer is valid

AfxSetAllocHook allows a function to be called each time a memory allocation is made

AfxDoForAllClasses performs a specific function on all classes inherited from CObject that support runtime checking

AfxDoForAllObjects All objects inherited from CObject that allocate memory with new perform a specific function

2. exception throwing function

AfxThrowArchiveException Throws an archive exception

AfxThrowFileException Throws a file exception

AfxThrowMemoryException Throws a memory exception

AfxThrowNotSupportedException throws an unsupported exception

AfxThrowResourceException Throws an exception that Windows did not find a resource

AfxThrowUserException throws an exception in a user-initialized program action

AfxThrowOleException Throws an OLE exception

AfxThrowOleDispatchException throws an exception inside an OLE automation function

AfxThrowDaoException Throws a CDaoException from code

AfxThrowDBException Throws a CDBException from code

3. String formatting and message box functions

AfxFromatString1 replaces the format character '%1' in the given string with a string

AfxFromatString2 replaces format characters '%1' and '%2' in a given string with a string

AfxMessageBox Displays a message box

4. Application information and administrative functions (more common)

AfxFreeLibrary reduces the number of references to a DLL module that has called memory; when the reference count decreases to 0, the module is deallocated

AfxGetApp returns a pointer to the application object CWinApp

AfxGetAppName Returns the name of the application

AfxGetInstanceHandle Returns the application instance handle

AfxGetMainWnd Returns a pointer to the current main window of a non-OLE application, or a threaded frame window of a server application

AfxGetResourceHandle Returns the default resource for the application

AfxInitRichEdit initializes RichEdit controls for applications

AfxLoadLibrary calls a DLL module and returns a handle through which to obtain the address of the function in the DLL.

AfxRegisterWndClass Registers a window class that replaces the window class automatically registered by MFC

AfxSocketInit is called in the application's InitInstance method to initialize the socket

AfxSetResourceHandle Sets the default resource handle for the application

AfxRegisterClass Registers window classes in DLLs that use MFC

AfxBeginThread Create a thread

AfxEndThread Ends a thread

AfxGetThread Gets a pointer to the current CWinThread object

AfxWinInit is directly called by the WinMain function provided by MFC and used to initialize MFC in GUI applications.

5. Set class helper function

CompareElements CompareElements

ConstructElements Actions that must be implemented when generating an element

CopyElements Copies elements from one array to another

DestructElements Actions to implement when destroying an array

DumpElements provides flow-oriented diagnostic output

HashKey computes a Hash key

SerlializeElements Save elements to or get elements from a file

6. record field interchange function

RFX_Binary Number of bytes of type CByteArray transferred

RFX_Bool Transfer bool data

RFX_Byte transfers a single byte of data

RFX_Date transmits time and date data of type CTime or TIMESTAMP_STRUCTURE

RFX_Double Transfers Double Precision Floating Point Data

RFX_Int Transfer integer data

RFX_Long Transfers long integer data

RFX_LongBinary Transfers binary data via objects of the CLongBinary class

RFX_Single Transfer floating point data

RFX_Text Transfer string data

RFX_Binary_Bulk Transfers an array of binary data

RFX_Bool_Bulk Transfers an array of bool data

RFX_Date_Bulk Transfers an array of TIMESTAMP_STRUCTURE data

RFX_Double_Bulk Transfers arrays of double-precision floating point data

RFX_Int_Bulk Transfer integer data array

RFX_Long_Bulk Transfers Long Integer Data Array

RFX_Single_Bulk Transfer floating point data array

RFX_Text_Bulk Transfer LPSTR Array

7. OLE correlation function

AfxOleInit initializes OLE library

AfxOleCanExitApp determines whether the application is finished

AfxOleGetMessageFilter Gets the current message filter for the application

AfxOleGetUserCtrl Gets the current user control tag

AfxOleSetUserCtrl Sets or clears user control flags

AfxOleLockApp increases the global count of active objects in the application

AfxOleUnLockApp reduces the global count of active objects in the app

AfxOleRegisterServerClass Registers a server in the OLE system registry

AfxOleSetEditMenu User Interface for TypeName Object Command

AfxOleRegisterControlClass Add a control class to the registration database

AfxOleRegisterPropertyPageClass Add a property page class for a control to the registry database

AfxOleRegisterTypeLib adds a control's type library to the registry database

AfxOleUnregisterClass deletes a control class or property page from the registration database

AfxOleUnregisterTypeLib removes the control's type library from the registration database

8. Internet URL Resolution Global Functions

AfxParseURL parses a URL string and returns the server type and content

AfxParseURLEx parses a URL string, returns the type and content of the server, and protects the system user's name and password.

About MFC global function is what the answer to the problem is shared here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report