网站首页  词典首页

请输入您要查询的函数:

 

术语 ddecreatestringhandle
释义 DdeCreateStringHandle
语法:
HSZ DdeCreateStringHandle( DWORD idInst,
LPTSTR psz,
int iCodePage
);
DdeCreateStringHandle功能
该DdeCreateStringHandle函数创建一个句柄,标识指定字符串。一种动态数据交换(DDE)客户端或服务器应用程序可以通过字符串处理作为对其他动态数据交换管理库(DDEML的)函数的参数。
参数
idInst
[in]指定的应用程序实例标识符先前调用DdeInitialize函数获得。

[in]指向一个缓冲区,其中包含NULL结尾的字符串,有关的处理是,被创建。此字符串最多可以有255个字符。此限制的原因是,DDEML的字符串管理功能是使用原子。
iCodePage
[in]指定的代码页用于渲染的字符串。这个值应该是CP_WINANSI(默认代码页)或CP_WINUNICODE,取决于是否ANSI或Unicode版本的DdeInitialize由客户端应用程序调用。
返回值
如果函数成功,返回值是一个字符串处理。
如果函数失败,返回值是0L。
该DdeGetLastError函数可用于获得错误代码,它可以是下列值之一:
DMLERR_INVALIDPARAMETER
DMLERR_NO_ERROR
DMLERR_SYS_ERROR
备注
字符串的句柄值是不相关的字符串标识的情况。
当一个应用程序可以创建一个字符串处理或接收回调函数中的一个,然后使用DdeKeepStringHandle保持功能,应用程序必须释放该字符串处理时,不再需要。
实例特定的字符串处理无法映射从字符串处理字符串并返回字符串处理。这表现在下面的例子,其中DdeQueryString函数创建一个从字符串处理和DdeCreateStringHandle创建了一个字符串处理该字符串的字符串,但两个句柄不相同:
双字节值idInst;
双字节值文件;
HSZ hszInst,hszNew;
锆pszInst;

DdeQueryString(idInst,hszInst,pszInst,文件,CP_WINANSI);
hszNew = DdeCreateStringHandle(idInst,pszInst,CP_WINANSI);
/ / hszNew = hszInst!
在Windows 95/98/Me:DdeCreateStringHandleW是支持的Unicode(MSLU)微软层。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
功能信息
最低DLL版本 user32.dll
在Ddeml.h HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
动态数据交换管理库概况,DdeAccessData,DdeCmpStringHandles,DdeFreeStringHandle,DdeInitialize,DdeKeepStringHandle,DdeQueryString
==英文原文==DdeCreateStringHandle Function
The DdeCreateStringHandle function creates a handle that identifies the specified string. A Dynamic Data Exchange (DDE) client or server application can pass the string handle as a parameter to other Dynamic Data Exchange Management Library (DDEML) functions.
Syntax
HSZ DdeCreateStringHandle( DWORD idInst,
LPTSTR psz,
int iCodePage
);
Parameters
idInst
[in] Specifies the application instance identifier obtained by a previous call to the DdeInitialize function.
psz
[in] Pointer to a buffer that contains the null-terminated string for which a handle is to be created. This string can be up to 255 characters. The reason for this limit is that DDEML string management functions are implemented using atoms.
iCodePage
[in] Specifies the code page used to render the string. This value should be either CP_WINANSI (the default code page) or CP_WINUNICODE, depending on whether the ANSI or Unicode version of DdeInitialize was called by the client application.
Return Value
If the function succeeds, the return value is a string handle.
If the function fails, the return value is 0L.
The DdeGetLastError function can be used to get the error code, which can be one of the following values:
DMLERR_INVALIDPARAMETER
DMLERR_NO_ERROR
DMLERR_SYS_ERROR
Remarks
The value of a string handle is not related to the case of the string it identifies.
When an application either creates a string handle or receives one in the callback function and then uses the DdeKeepStringHandle function to keep it, the application must free that string handle when it is no longer needed.
An instance-specific string handle cannot be mapped from string handle to string and back to string handle. This is shown in the following example, in which the DdeQueryString function creates a string from a string handle and DdeCreateStringHandle creates a string handle from that string, but the two handles are not the same:
DWORD idInst;
DWORD cb;
HSZ hszInst, hszNew;
PSZ pszInst;

DdeQueryString(idInst, hszInst, pszInst, cb, CP_WINANSI);
hszNew = DdeCreateStringHandle(idInst, pszInst, CP_WINANSI);
// hszNew != hszInst !
Windows 95/98/Me: DdeCreateStringHandleW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Ddeml.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Dynamic Data Exchange Management Library Overview , DdeAccessData , DdeCmpStringHandles , DdeFreeStringHandle , DdeInitialize , DdeKeepStringHandle , DdeQueryString
==原始网址==http://msdn.microsoft.com/en-us/library/ms648748(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:40