您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GlobalFreePtr函数代码示例

51自学网 2021-06-01 21:18:51
  C++
这篇教程C++ GlobalFreePtr函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GlobalFreePtr函数的典型用法代码示例。如果您正苦于以下问题:C++ GlobalFreePtr函数的具体用法?C++ GlobalFreePtr怎么用?C++ GlobalFreePtr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GlobalFreePtr函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GlobalFreePtr

void CSoundFile::FreeSample(LPVOID p)//-----------------------------------{	if (p)	{		GlobalFreePtr(((LPSTR)p)-16);	}}
开发者ID:AliceLR,项目名称:megazeux,代码行数:8,


示例2: PlayNavigatingSound

/**************************************************************************** *                                                                          * * Function: PlayNavigatingSound                                            * *                                                                          * * Purpose : Play system navigating sound.                                  * *                                                                          * * History : Date      Reason                                               * *           00/00/00  Created                                              * *                                                                          * ****************************************************************************/static void PlayNavigatingSound(void){	HKEY hKey = NULL;	ULONG ulBufferSize = MAX_PATH + sizeof(TCHAR);	LPTSTR lpszBuffer = GlobalAllocPtr(GPTR, ulBufferSize);	LPTSTR lpszSoundPath = GlobalAllocPtr(GPTR, ulBufferSize);	if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("AppEvents//Schemes//Apps//Explorer//Navigating//.Current"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {		if (RegQueryValueEx(hKey, NULL, 0, NULL, (LPBYTE) lpszBuffer, &ulBufferSize) == ERROR_SUCCESS) {			ExpandEnvironmentStrings(lpszBuffer, lpszSoundPath, ulBufferSize);			PlaySound(lpszSoundPath, NULL, SND_ASYNC | SND_NODEFAULT | SND_NOWAIT);		}   		if(hKey) RegCloseKey(hKey);	}	if(lpszBuffer) GlobalFreePtr(lpszBuffer);	if(lpszSoundPath) GlobalFreePtr(lpszSoundPath);}
开发者ID:469306621,项目名称:Languages,代码行数:28,


示例3: PR_MD_free

/*** PR_MD_free() -- exported as free()***/void PR_MD_free( void *ptr ){    if( _pr_callback_funcs ) {        (*_pr_callback_funcs->free)( ptr );        return;    } else {        GlobalFreePtr( ptr );        return;    }} /* end free() */
开发者ID:AbrahamJewowich,项目名称:FreeSWITCH,代码行数:14,


示例4: tap_close_adapter

static void tap_close_adapter(LPADAPTER fd){	if (fd) {		if (fd->hFile) {			tap_set_status(fd, false);			CloseHandle(fd->hFile);		}		GlobalFreePtr(fd);	}}
开发者ID:tycho,项目名称:sheepshaver,代码行数:10,


示例5: GlobalFreePtr

DISKS::~DISKS(){    for (int i = 0; i < nDiskCount; ++i)    {        GlobalFreePtr(fName[i]);        fName[i] = NULL;        nMount[i] = 0;        Dismount(i);    }}
开发者ID:norayr,项目名称:kronos,代码行数:10,


示例6: GlobalAllocPtr

bool CBitmapShow::InitialBitmap(int width,int height){     if((Width==width)&&(Height==height)) return true;	 Width=width;	 Height=height;	 if(m_lpBitmapInfo!=NULL) GlobalFreePtr(m_lpBitmapInfo);	 int colors=GetNumberColors();	 if(colors==0) colors=256;	 m_lpBitmapInfo = (LPBITMAPINFO) GlobalAllocPtr(GHND,sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * colors);	 m_lpBitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);	 m_lpBitmapInfo->bmiHeader.biWidth = Width;	 m_lpBitmapInfo->bmiHeader.biHeight = Height;	 m_lpBitmapInfo->bmiHeader.biCompression=GetCompressionKind();	 m_lpBitmapInfo->bmiHeader.biSizeImage = 0;	 m_lpBitmapInfo->bmiHeader.biXPelsPerMeter = 0;	 m_lpBitmapInfo->bmiHeader.biYPelsPerMeter = 0;	 m_lpBitmapInfo->bmiHeader.biPlanes = 1;	 m_lpBitmapInfo->bmiHeader.biBitCount =GetBitCount();	 m_lpBitmapInfo->bmiHeader.biClrUsed = 0;	 m_lpBitmapInfo->bmiHeader.biClrImportant = 0;	 ILineBytes=WIDTHBYTES(Width*GetBitCount());	 m_lpBitmapInfo->bmiHeader.biSizeImage=ILineBytes*Height;     for(int k=0;k<colors;k++) m_lpBitmapInfo->bmiColors[k].rgbRed=m_lpBitmapInfo->bmiColors[k].rgbGreen=m_lpBitmapInfo->bmiColors[k].rgbBlue=k;	 if(!CreateDIBPalette())	 {         if(m_lpBitmapInfo!=NULL) GlobalFreePtr(m_lpBitmapInfo);         m_lpBitmapInfo=NULL;		 return false;	 }	 if(lpDIBBits!=NULL) GlobalFreePtr(lpDIBBits);     lpDIBBits=NULL;     lpDIBBits=(unsigned char*)GlobalAllocPtr(GHND,ILineBytes*Height);	 if(lpDIBBits==NULL)	 {         if(m_lpBitmapInfo!=NULL) GlobalFreePtr(m_lpBitmapInfo);         m_lpBitmapInfo=NULL;         if(Palette!=NULL) delete Palette;		 Palette=NULL;		 return false;	 }	 return true;}
开发者ID:libGG,项目名称:dview_bj,代码行数:42,


示例7: PacketCloseAdapter

VOID PacketCloseAdapter( LPADAPTER lpAdapter ){  D(bug("Packet32: PacketCloseAdapter/n"));	if(lpAdapter) {		if(lpAdapter->hFile) {			CloseHandle(lpAdapter->hFile);		}		GlobalFreePtr(lpAdapter);	}}
开发者ID:DavidLudwig,项目名称:macemu,代码行数:11,


示例8: ConverterCleanup

//// ConverterCleanup//// Free anything we ever allocated//void ConverterCleanup( void )    {    DWORD   idx;/*    if( hInFile != INVALID_HANDLE_VALUE )        {        CloseHandle( hInFile );    hInFile = INVALID_HANDLE_VALUE;    }*/    if( ifs.pitsTracks )        {    // De-allocate all our track buffers    for( idx = 0; idx < ifs.dwTrackCount; idx++ )        if( ifs.pitsTracks[idx].pTrackStart )        GlobalFreePtr( ifs.pitsTracks[idx].pTrackStart );        GlobalFreePtr( ifs.pitsTracks );    ifs.pitsTracks = NULL;    }    }
开发者ID:bsmr-games,项目名称:Hexen2,代码行数:26,


示例9: GlobalFreePtr

void AudioFormat::OnCancel(){	// TODO: Add extra cleanup here	if (pwfxLocal) {		GlobalFreePtr(pwfxLocal);		pwfxLocal = NULL;	}	CDialog::OnCancel();}
开发者ID:aisnote,项目名称:camstudio-clone,代码行数:12,


示例10: DisposeHandle

void DisposeHandle (Handle handle){	memError = noErr;	if (handle)		{		Ptr p;		p = *handle;		if (p)			GlobalFreePtr (p);		GlobalFreePtr ((Ptr)handle);		}	else		memError = nilHandleErr;}
开发者ID:jxfengzi,项目名称:AirPhoto,代码行数:21,


示例11: aviaudioCloseDevice

void aviaudioCloseDevice(void){	if (shWaveOut) {		while (0 < swBuffers) {			--swBuffers;			waveOutUnprepareHeader(shWaveOut, salpAudioBuf[swBuffers], sizeof(WAVEHDR));			GlobalFreePtr((LPSTR) salpAudioBuf[swBuffers]);		}		waveOutClose(shWaveOut);		shWaveOut = NULL;	}}
开发者ID:aisnote,项目名称:camstudio-clone,代码行数:13,


示例12: DimesPacketCloseAdapter

VOID DimesPacketCloseAdapter(LPADAPTER lpAdapter){	if(!lpAdapter)	{        printf("PacketCloseAdapter: attempt to close a NULL adapter/n");		return;	}		CloseHandle(lpAdapter->hFile);	SetEvent(lpAdapter->ReadEvent);    CloseHandle(lpAdapter->ReadEvent);    GlobalFreePtr(lpAdapter);}
开发者ID:NetDimes,项目名称:dimes-agent,代码行数:13,


示例13: DimesPacketSetReadEvt

BOOLEAN DimesPacketSetReadEvt(LPADAPTER AdapterObject){	DWORD BytesReturned;	char EventName[100];	DWORD lastError;	if (LOWORD(GetVersion()) == 4)	{		// retrieve the name of the shared event from the driver without the "Global//" prefix		if(DeviceIoControl(AdapterObject->hFile,pBIOCEVNAME,NULL,0,EventName,3*13*sizeof(TCHAR),&BytesReturned,NULL)==FALSE) 			return FALSE;		EventName[BytesReturned/sizeof(TCHAR)]=0; // terminate the string	}	else	{				PCHAR name;		// this tells the terminal service to retrieve the event from the global namespace		// retrieve the name of the shared event from the driver with the "Global//" prefix		if(DeviceIoControl(AdapterObject->hFile,pBIOCEVNAME,NULL,0,EventName + 7,93,&BytesReturned,NULL)==FALSE) 			return FALSE;		void* str2 = (void*)(EventName+7);		PWCHAR string = (PWCHAR)str2;		name = WChar2SChar(/*EventName+7*/string);		name[BytesReturned/2]='/0';		sprintf(EventName,"Global//%s",name);		GlobalFreePtr(name);	}		JavaLog::javalogf(LEVEL_INFO,"event name :%s" , EventName);	// open the shared event	AdapterObject->ReadEvent=CreateEvent(NULL,		TRUE,		FALSE,		EventName);	lastError = GetLastError();	if(AdapterObject->ReadEvent==NULL || lastError!=ERROR_ALREADY_EXISTS){		printf("PacketSetReadEvt: error retrieving the event from the kernel/n");		printError(lastError);		return FALSE;	}	else		JavaLog::javalogf(LEVEL_INFO,"Read event success/n");	AdapterObject->ReadTimeOut=0;	return TRUE;}
开发者ID:NetDimes,项目名称:dimes-agent,代码行数:51,


示例14: riffCopyChunk

BOOL riffCopyChunk(HMMIO hmmioSrc, HMMIO hmmioDst, const LPMMCKINFO lpck){    MMCKINFO    ck;    HPSTR       hpBuf;    //    //    //    hpBuf = (HPSTR)GlobalAllocPtr(GHND, lpck->cksize);    if (!hpBuf)    return (FALSE);    ck.ckid   = lpck->ckid;    ck.cksize = lpck->cksize;    if (mmioCreateChunk(hmmioDst, &ck, 0))    goto rscc_Error;        if (mmioRead(hmmioSrc, hpBuf, lpck->cksize) != (LONG)lpck->cksize)    goto rscc_Error;    if (mmioWrite(hmmioDst, hpBuf, lpck->cksize) != (LONG)lpck->cksize)    goto rscc_Error;    if (mmioAscend(hmmioDst, &ck, 0))    goto rscc_Error;    if (hpBuf)    GlobalFreePtr(hpBuf);    return (TRUE);rscc_Error:    if (hpBuf)    GlobalFreePtr(hpBuf);    return (FALSE);} /* RIFFSupCopyChunk() */
开发者ID:henriyl,项目名称:ZShadeSandbox,代码行数:38,


示例15: LoadFile

LPVOID LoadFile(LPCTSTR szFile, DWORD * pFileLength){    LPVOID pFile;    HANDLE hFile;    HANDLE h;    DWORD  FileLength;#ifdef WIN32    hFile = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ, NULL,        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);    if (hFile == INVALID_HANDLE_VALUE)        return 0;    FileLength = (LONG)GetFileSize(hFile, NULL);    if (pFileLength)       *pFileLength = FileLength ;    h = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);    CloseHandle(hFile);    if (h == INVALID_HANDLE_VALUE)        return 0;    pFile = MapViewOfFile(h, FILE_MAP_READ, 0, 0, 0);    CloseHandle(h);    if (pFile == NULL)        return 0;#else    hFile = (HANDLE)_lopen(szFile, OF_READ);    if (hFile == (HANDLE)-1)        return 0;    FileLength = _llseek((int)hFile, 0, SEEK_END);    _llseek((int)hFile, 0, SEEK_SET);    pFile = GlobalAllocPtr(GHND, FileLength);    if (pFile && _hread((int)hFile, pFile, FileLength) != FileLength)    {        GlobalFreePtr(pFile);        pFile = NULL;    }    _lclose((int)hFile);#endif    return pFile;}
开发者ID:mingpen,项目名称:OpenNT,代码行数:50,


示例16: GlobalFreePtr

PSDDriver::~PSDDriver(){	// Free the row sizes if we allocated them.	if (m_pSizes != NULL)	{		GlobalFreePtr(m_pSizes);	}	// Delete all the files we used.	for (int nFile = 0; nFile < m_ChannelFiles.GetSize(); nFile++)	{		delete (ReadOnlyFile*)m_ChannelFiles.GetAt(nFile);	}}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:14,


示例17: Cleanup

static VOID Cleanup(VOID){	PSTREAMBUF   pCurr;	PSTREAMBUF   pNext;	if (hInFile != INVALID_HANDLE_VALUE)		CloseHandle(hInFile);	if (hOutFile != INVALID_HANDLE_VALUE)		CloseHandle(hOutFile);	if (ifs.pFile)		GlobalFreePtr(ifs.pFile);	// faB: made pTracks static	//if (ifs.pTracks)		//GlobalFreePtr(ifs.pTracks);	pCurr = ots.pFirst;	while (pCurr)	{		pNext = pCurr->pNext;		GlobalFreePtr(pCurr);		pCurr = pNext;	}}
开发者ID:Pupswoof117,项目名称:SRB2-Public,代码行数:23,


示例18: SetDataSource

/*void VPictureData_GDIPlus_Vector::FromVFile(VFile& inFile){	Gdiplus::Rect rect;	SetDataSource(NULL,true);	_DisposeMetaFile();	_SetDecoderByExtension("emf");		VString path;	inFile.GetPath(path);	fMetafile=new Gdiplus::Metafile(path.GetCPointer());	_InitSize();}*/void VPictureData_GDIPlus_Vector::_FromMetaFilePict(METAFILEPICT* inMetaPict){	HENHMETAFILE henh;	void*        lpWinMFBits;	UINT         uiSizeBuf;	uiSizeBuf = GetMetaFileBitsEx(inMetaPict->hMF, 0, NULL);	lpWinMFBits = GlobalAllocPtr(GHND, uiSizeBuf);	GetMetaFileBitsEx(inMetaPict->hMF, uiSizeBuf, (LPVOID)lpWinMFBits);	henh = SetWinMetaFileBits(uiSizeBuf, (LPBYTE)lpWinMFBits, NULL, inMetaPict);	GlobalFreePtr(lpWinMFBits);	_FromEnhMetaFile(henh);}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:28,


示例19: GlobalFreePtr

CRarArchive::~CRarArchive()//-------------------------{	if (UnpMemory)	{		delete UnpMemory;		UnpMemory=NULL;	}	if (m_lpOutputFile)	{		GlobalFreePtr(m_lpOutputFile);		m_lpOutputFile = NULL;	}}
开发者ID:aidush,项目名称:openmpt,代码行数:14,


示例20: FSOUND_Stream_Close

	~win_movie_Rec()	{		if(bAudio)		{			#ifdef SND_USE_FMOD			if(fmod_stream)				FSOUND_Stream_Close(fmod_stream);			#endif			acmStreamUnprepareHeader(acmStream,&audioStreamHeader,0);			acmStreamClose(acmStream,0);			delete[] audioDecoded;			delete[] audioEncoded;			AVIStreamRelease(audioStream);		}		if(bDecompStarted)			ICDecompressEnd(hIC);		if(hIC)			ICClose(hIC);		if(outdata) GlobalFreePtr(outdata);		if(indata) GlobalFreePtr(indata);		if(stream)			AVIStreamRelease(stream);		if(avi)			AVIFileRelease(avi);		if(img)		{			FreeImageHandle(imgHandle);			delete img;		}		if(handle != 0)			Handle::free(HANDLE_TYPE_MOVIE,handle);	}
开发者ID:Bananattack,项目名称:verge3,代码行数:37,


示例21: waveOutClose

void COXSound::CloseWaveOutDevice()	//	--- In:	//	--- Out:	//	--- Returns:		//	---	Effect:		Closes the wave output device and frees associated memory.{	if (m_hWaveOut != NULL)	{		waveOutClose(m_hWaveOut);		m_hWaveOut = NULL;	}	if (m_lpWaveHdr != NULL)	{		GlobalFreePtr(m_lpWaveHdr);		m_lpWaveHdr = NULL;	}	if (m_lpWaveData != NULL)	{		GlobalFreePtr(m_lpWaveData);		m_lpWaveData = NULL;	}}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:24,


示例22: PacketCloseAdapter

//---------------------------------------------------------------------------VOID PacketCloseAdapter (LPADAPTER lpAdapter){	ODS ("Packet32: PacketCloseAdapter/n");	// close the capture handle	CloseHandle (lpAdapter->hFile);	// close the read event	CloseHandle (lpAdapter->ReadEvent);	GlobalFreePtr (lpAdapter);	lpAdapter = NULL;}
开发者ID:OPEXGroup,项目名称:winpcap,代码行数:16,


示例23: wpcap_packet_request

/* do a packet request call */intwpcap_packet_request(void *adapter, ULONG Oid, int set, char *value, unsigned int *length){    BOOLEAN    Status;    ULONG      IoCtlBufferLength=(sizeof(PACKET_OID_DATA) + (*length) - 1);    PPACKET_OID_DATA  OidData;    g_assert(has_wpacket);    if(p_PacketRequest == NULL) {        g_warning("packet_request not available/n");        return 0;    }    /* get a buffer suitable for PacketRequest() */    OidData=GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT,IoCtlBufferLength);    if (OidData == NULL) {        g_warning("GlobalAllocPtr failed for %u/n", IoCtlBufferLength);        return 0;    }    OidData->Oid = Oid;    OidData->Length = *length;    memcpy(OidData->Data, value, *length);    Status = p_PacketRequest(adapter, set, OidData);    if(Status) {        if(OidData->Length <= *length) {            /* copy value from driver */            memcpy(value, OidData->Data, OidData->Length);            *length = OidData->Length;        } else {            /* the driver returned a value that is longer than expected (and longer than the given buffer) */            g_warning("returned oid too long, Oid: 0x%x OidLen:%u MaxLen:%u", Oid, OidData->Length, *length);            Status = FALSE;        }    }    GlobalFreePtr (OidData);    if(Status) {        return 1;    } else {        return 0;    }}
开发者ID:RayHightower,项目名称:wireshark,代码行数:49,


示例24: memset

//---------------------------------------------------------------------------String CUtilites::GetFolder(String Caption){   BROWSEINFO bi;   char GDir[MAX_PATH];   char FolderName[MAX_PATH];   LPITEMIDLIST ItemID;   memset(&bi, 0, sizeof(BROWSEINFO));   memset(GDir, 0, MAX_PATH);   bi.hwndOwner      = Application->Handle;   bi.pszDisplayName = FolderName;   bi.lpszTitle      = Caption.c_str();   ItemID = SHBrowseForFolder(&bi);   SHGetPathFromIDList(ItemID, GDir);   GlobalFreePtr(ItemID);   return String(GDir);}
开发者ID:BHjr132,项目名称:fonline,代码行数:17,


示例25: CreateMruMenu

LPMRUMENU CreateMruMenu( WORD wNbLruShowInit,						 WORD wNbLruMenuInit, WORD wMaxSizeLruItemInit, WORD wIdMruInit ) {	LPMRUMENU lpMruMenu;	lpMruMenu = ( LPMRUMENU )GlobalAllocPtr( GHND, sizeof( MRUMENU ) );	lpMruMenu->wNbItemFill = 0;	lpMruMenu->wNbLruMenu = wNbLruMenuInit;	lpMruMenu->wNbLruShow = wNbLruShowInit;	lpMruMenu->wIdMru = wIdMruInit;	lpMruMenu->wMaxSizeLruItem = wMaxSizeLruItemInit;	lpMruMenu->lpMRU = ( LPSTR )GlobalAllocPtr( GHND,					   lpMruMenu->wNbLruMenu * ( UINT )lpMruMenu->wMaxSizeLruItem );	if( lpMruMenu->lpMRU == NULL ) {		GlobalFreePtr( lpMruMenu );		lpMruMenu =  NULL;	}	return lpMruMenu;}
开发者ID:revelator,项目名称:Revelation,代码行数:17,


示例26: smfCloseFile

/******************************************************************************* smfCloseFile** This function closes an open MIDI file.** hSmf                      - The handle of the open file to close.** Returns*   SMF_SUCCESS The specified file was closed.*   SMF_INVALID_PARM The given handle was not valid.** Any track handles opened from this file handle are invalid after this* call.*        *****************************************************************************/SMFRESULT FNLOCAL smfCloseFile(    HSMF                    hSmf){    PSMF                    pSmf        = (PSMF)hSmf;        assert(pSmf != NULL);        /*    ** Free up handle memory     */        if (NULL != pSmf->hpbImage)        GlobalFreePtr(pSmf->hpbImage);        LocalFree((HLOCAL)pSmf);        return SMF_SUCCESS;}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:34,


示例27: myfree

void 	myfree( void** Hdl )						// free Memory, use Handles{	if (Hdl)	{		LPSTR p;				GlobalUnlock((LPSTR *) Hdl);		p = *((LPSTR*) Hdl);        //Use VirtualFree because of Win 95/98/ME memory allocation problems        //See Microsfot KB article Q198959		if (p)            VirtualFree(p, 0, MEM_RELEASE);		GlobalFreePtr ((LPSTR) Hdl);	}}
开发者ID:xelmirage,项目名称:libpano,代码行数:18,


示例28: _ReleaseDataProvider

void VPictureData_EMF::FromMetaFilePict(METAFILEPICT* inMetaPict){	HENHMETAFILE henh;	_ReleaseDataProvider();	_DisposeMetaFile();		void*        lpWinMFBits;	UINT         uiSizeBuf;	uiSizeBuf = GetMetaFileBitsEx(inMetaPict->hMF, 0, NULL);	lpWinMFBits = GlobalAllocPtr(GHND, uiSizeBuf);	GetMetaFileBitsEx(inMetaPict->hMF, uiSizeBuf, (LPVOID)lpWinMFBits);	henh = SetWinMetaFileBits(uiSizeBuf, (LPBYTE)lpWinMFBits, NULL, inMetaPict);	GlobalFreePtr(lpWinMFBits);	FromEnhMetaFile(henh);}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:18,


示例29: SaveMruInIni

//*************************************************************////  SaveMruInIni()////  Purpose://              Save MRU in a private .INI////  Parameters://      LPMRUMENU lpMruMenu -      pointer on MRUMENU//      LPSTR lpszSection  -       Points to a null-terminated string containing//                                      the name of the section//      LPSTR lpszFile -           Points to a null-terminated string that names//                                      the initialization file.////  Return: (BOOL)//      TRUE  - Function run successfully//      FALSE - Function don't run successfully//////  Comments://      See WritePrivateProfileString API for more info on lpszSection and lpszFile////  History:    Date       Author       Comment//              09/24/94   G. Vollant   Created////*************************************************************BOOL SaveMruInIni( LPMRUMENU lpMruMenu, LPSTR lpszSection, LPSTR lpszFile ) {	LPSTR lpTxt;	WORD i;	lpTxt = ( LPSTR )GlobalAllocPtr( GHND, lpMruMenu->wMaxSizeLruItem + 20 );	if( lpTxt == NULL ) {		return FALSE;	}	for( i = 0; i < lpMruMenu->wNbLruMenu; i++ ) {		char szEntry[16];		wsprintf( szEntry, "File%lu", ( DWORD )i + 1 );		if( !GetMenuItem( lpMruMenu, i, FALSE, lpTxt, lpMruMenu->wMaxSizeLruItem + 10 ) ) {			*lpTxt = '/0';		}		WritePrivateProfileString( lpszSection, szEntry, lpTxt, lpszFile );	}	GlobalFreePtr( lpTxt );	WritePrivateProfileString( NULL, NULL, NULL, lpszFile ); // flush cache	return TRUE;}
开发者ID:revelator,项目名称:Revelation,代码行数:45,



注:本文中的GlobalFreePtr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GlobalInterruptEnable函数代码示例
C++ GlobalDeleteAtom函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。