Board index » cppbuilder » Why SetEnhMetaFileBits always fail?
bucher
![]() CBuilder Developer |
Why SetEnhMetaFileBits always fail?2004-10-27 06:52:08 PM cppbuilder114 Hi, In a project, I want to insert a picture into the F1book. Here is my code: 1 TMemoryStream* wmfStream = new TMemoryStream(); 2 wmfStream->LoadFromFile("c:\\tmpwmf.wmf"); 3 int size = wmfStream->Size; 4 wmfStream->Position = 0; 5 char* buffer = new char[size]; 6 wmfStream->Read((void*)buffer, size); 7 HENHMETAFILE hMf = ::SetEnhMetaFileBits(size, buffer); 8 F1Book1->ObjCreatePicture(col, row, col, row, (unsigned int)hMf, 7, width, height); The result of SetEnhMetaFileBits is always NULL. But the wmf file is not corrupt. And what is the type of HENHMETAFILE? BCB tells me that it's "void*"! I think it's not reasonable. Thanks in advance. bucher |