本文整理汇总了C++中Blob::GetBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ Blob::GetBuffer方法的具体用法?C++ Blob::GetBuffer怎么用?C++ Blob::GetBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blob
的用法示例。
在下文中一共展示了Blob::GetBuffer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCurrentDirectoryX
bool GetCurrentDirectoryX(std::basic_string<Char, Traits, Alloc>& out)
{
Blob<Char> buf;
//TCHAR* tsz = 0;
DWORD dwRet = 0;
bool r = false;
dwRet = GetCurrentDirectoryW(static_cast<DWORD>(buf.Size()), buf.GetBuffer());
if(dwRet)
{
if(dwRet > static_cast<DWORD>(buf.Size()))
{
// It needs more space.
if(buf.Alloc(dwRet+2))
{
if(::GetCurrentDirectory(static_cast<DWORD>(buf.Size()), buf.GetBuffer()))
{
out = buf.GetBuffer();
r = true;
}
}
}
else
{
out = buf.GetBuffer();
r = true;
}
}
return r;
}
示例2: SHGetFolderPathX
inline HRESULT SHGetFolderPathX(std::basic_string<Char, Traits, Alloc>& sOut, int nFolder)
{
bool r = false;
Blob<wchar_t, BlobTraits<true, MAX_PATH> > buf;
HRESULT hr;
if(SUCCEEDED(hr = SHGetFolderPathW(NULL, nFolder, NULL, SHGFP_TYPE_CURRENT, buf.GetBuffer())))
{
StringConvert(buf.GetBuffer(), sOut);
}
return hr;
}
示例3: LoadLibraryX
inline HMODULE LoadLibraryX(const Char* buffer)
{
Blob<wchar_t, false, BlobTraits<true, MAX_PATH> > t;
t.Alloc(StringLength(buffer) + 1);
t.GetWritableBuffer()[0] = 0;
XLastDitchStringCopy(buffer, t.GetWritableBuffer());
return LoadLibraryW(t.GetBuffer());
}
示例4: LoadStringX
inline int LoadStringX(HINSTANCE hInstance, UINT id, Char* buffer, int buffermax)
{
Blob<wchar_t, false, BlobTraits<true, 1024> > t;
t.Alloc(buffermax + 1);
t.GetWritableBuffer()[0] = 0;
int r = LoadStringW(hInstance, id, t.GetWritableBuffer(), buffermax);
XLastDitchStringCopy(t.GetBuffer(), buffer);
return r;
}