Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

693 lines
17 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name:MF.C (Extensible Compound Documents - Metafile)
  3. *
  4. * PURPOSE:Handles all API routines for the metafile sub-dll of the ole dll.
  5. *
  6. * Created: 1990
  7. *
  8. * Copyright (c) 1990, 1991 Microsoft Corporation
  9. *
  10. * History:
  11. *
  12. * Raor, Srinik (../../1990,91) Designed, coded
  13. * Curts create NT version
  14. *
  15. \***************************************************************************/
  16. #include <windows.h>
  17. #include "dll.h"
  18. #include "pict.h"
  19. WORD wGDIds = 0;
  20. OLESTATUS FARINTERNAL wCreateDummyMetaFile (LPOBJECT_MF, int, int);
  21. #ifdef WIN16
  22. #pragma alloc_text(_TEXT, MfSaveToStream, MfLoadFromStream, GetBytes, PutBytes, PutStrWithLen, MfQueryBounds, OleIsDcMeta, GetGDIds, IsMetaDC)
  23. #endif
  24. OLEOBJECTVTBL vtblMF = {
  25. ErrQueryProtocol, // check whether the speced protocol is supported
  26. MfRelease, // Release
  27. ErrShow, // show
  28. ErrPlay, // play
  29. MfGetData, // Get the object data
  30. ErrSetData, // Set the object data
  31. ErrSetTargetDevice,//
  32. ErrSetBounds, // set viewport bounds
  33. MfEnumFormat, // enumerate supported formats
  34. ErrSetColorScheme, //
  35. MfRelease, // delete
  36. ErrSetHostNames, //
  37. MfSaveToStream, // write to file
  38. MfClone, // clone object
  39. ErrCopyFromLink, // Create embedded from Lnk
  40. MfEqual, // compares the given objects for data equality
  41. MfCopy, // copy to clip
  42. MfDraw, // draw the object
  43. ErrActivate, // open
  44. ErrExecute, // excute
  45. ErrClose, // stop
  46. ErrUpdate, // Update
  47. ErrReconnect, // Reconnect
  48. ErrObjectConvert, // convert object to specified type
  49. ErrGetUpdateOptions, // update options
  50. ErrSetUpdateOptions, // update options
  51. ObjRename, // Change Object name
  52. ObjQueryName, // Get current object name
  53. ObjQueryType, // Object type
  54. MfQueryBounds, // QueryBounds
  55. ObjQuerySize, // Find the size of the object
  56. ErrQueryOpen, // Query open
  57. ErrQueryOutOfDate, // query whether object is current
  58. ErrQueryRelease, // release related stuff
  59. ErrQueryRelease,
  60. ErrQueryReleaseMethod,
  61. ErrRequestData, // requestdata
  62. ErrObjectLong, // objectLong
  63. MfChangeData // change data of the existing object
  64. };
  65. OLESTATUS FARINTERNAL MfRelease (LPOLEOBJECT lpoleobj)
  66. {
  67. LPOBJECT_MF lpobj = (LPOBJECT_MF)lpoleobj;
  68. HOBJECT hobj;
  69. if (lpobj->mfp.hMF) {
  70. DeleteMetaFile (lpobj->mfp.hMF);
  71. lpobj->mfp.hMF = NULL;
  72. }
  73. if (lpobj->hmfp)
  74. GlobalFree (lpobj->hmfp);
  75. if (lpobj->head.lhclientdoc)
  76. DocDeleteObject ((LPOLEOBJECT)lpobj);
  77. if (hobj = lpobj->head.hobj) {
  78. lpobj->head.hobj = NULL;
  79. GlobalUnlock (hobj);
  80. GlobalFree (hobj);
  81. }
  82. return OLE_OK;
  83. }
  84. OLESTATUS FARINTERNAL MfSaveToStream (
  85. LPOLEOBJECT lpoleobj,
  86. LPOLESTREAM lpstream
  87. ){
  88. DWORD dwFileVer = GetFileVersion(lpoleobj);
  89. LPOBJECT_MF lpobj = (LPOBJECT_MF)lpoleobj;
  90. OLESTATUS retVal = OLE_ERROR_STREAM;
  91. HANDLE hBits;
  92. LPSTR lpBits;
  93. LONG lSizeBytes;
  94. lSizeBytes = lpobj->sizeBytes - sizeof(METAFILEPICT)
  95. + sizeof(WIN16METAFILEPICT);
  96. if (!lpobj->mfp.hMF)
  97. return OLE_ERROR_BLANK;
  98. if (PutBytes (lpstream, (LPSTR) &dwFileVer, sizeof(LONG)))
  99. return OLE_ERROR_STREAM;
  100. if (PutBytes (lpstream, (LPSTR) &lpobj->head.ctype, sizeof(LONG)))
  101. return OLE_ERROR_STREAM;
  102. if (PutStrWithLen(lpstream, (LPSTR)"METAFILEPICT"))
  103. return OLE_ERROR_STREAM;
  104. if (PutBytes (lpstream, (LPSTR) &lpobj->head.cx, sizeof(LONG)))
  105. return OLE_ERROR_STREAM;
  106. if (PutBytes (lpstream, (LPSTR) &lpobj->head.cy, sizeof(LONG)))
  107. return OLE_ERROR_STREAM;
  108. if (PutBytes (lpstream, (LPSTR) &lSizeBytes, sizeof(LONG)))
  109. return OLE_ERROR_STREAM;
  110. if (!(hBits = MGetMetaFileBits (lpobj->mfp.hMF)))
  111. return OLE_ERROR_MEMORY;
  112. if (lpBits = (LPSTR) GlobalLock (hBits)) {
  113. WIN16METAFILEPICT w16mfp;
  114. ConvertMF32to16(&lpobj->mfp, &w16mfp);
  115. if (!PutBytes (lpstream, (LPSTR)&w16mfp, sizeof(WIN16METAFILEPICT)))
  116. if (!PutBytes (lpstream, (LPSTR)lpBits,
  117. lSizeBytes - sizeof(WIN16METAFILEPICT)))
  118. retVal = OLE_OK;
  119. GlobalUnlock(hBits);
  120. }
  121. else
  122. retVal = OLE_ERROR_MEMORY;
  123. lpobj->mfp.hMF = MSetMetaFileBits (hBits);
  124. return retVal;
  125. }
  126. OLESTATUS FARINTERNAL MfClone (
  127. LPOLEOBJECT lpoleobjsrc,
  128. LPOLECLIENT lpclient,
  129. LHCLIENTDOC lhclientdoc,
  130. OLE_LPCSTR lpobjname,
  131. LPOLEOBJECT FAR * lplpoleobj
  132. ){
  133. LPOBJECT_MF lpobjsrc = (LPOBJECT_MF)lpoleobjsrc;
  134. LPOBJECT_MF lpobjMf;
  135. HANDLE hmf;
  136. *lplpoleobj = (LPOLEOBJECT)NULL;
  137. if (!CheckClientDoc ((LPCLIENTDOC) lhclientdoc))
  138. return OLE_ERROR_HANDLE;
  139. if (!(hmf = CopyMetaFile (lpobjsrc->mfp.hMF, NULL)))
  140. return OLE_ERROR_MEMORY;
  141. if (lpobjMf = MfCreateBlank (lhclientdoc, (LPSTR)lpobjname,
  142. lpobjsrc->head.ctype)) {
  143. lpobjMf->mfp = lpobjsrc->mfp;
  144. lpobjMf->sizeBytes = lpobjsrc->sizeBytes;
  145. lpobjMf->mfp.hMF = hmf;
  146. lpobjMf->head.lpclient = lpclient;
  147. lpobjMf->head.mm = lpobjMf->mfp.mm;
  148. MfSetExtents (lpobjMf);
  149. *lplpoleobj = (LPOLEOBJECT)lpobjMf;
  150. return OLE_OK;
  151. }
  152. return OLE_ERROR_MEMORY;
  153. }
  154. OLESTATUS FARINTERNAL MfEqual (
  155. LPOLEOBJECT lpoleobj1,
  156. LPOLEOBJECT lpoleobj2
  157. ){
  158. LPOBJECT_MF lpobj1 = (LPOBJECT_MF)lpoleobj1;
  159. LPOBJECT_MF lpobj2 = (LPOBJECT_MF)lpoleobj2;
  160. HANDLE hBits1 = NULL, hBits2 = NULL;
  161. OLESTATUS retval = OLE_ERROR_NOT_EQUAL;
  162. if (!(hBits1 = MGetMetaFileBits (lpobj1->mfp.hMF)))
  163. goto errEqual;
  164. if (!(hBits2 = MGetMetaFileBits (lpobj2->mfp.hMF)))
  165. goto errEqual;
  166. if (CmpGlobals (hBits1, hBits2))
  167. retval = OLE_OK;
  168. errEqual:
  169. if (hBits1)
  170. lpobj1->mfp.hMF = MSetMetaFileBits (hBits1);
  171. if (hBits2)
  172. lpobj2->mfp.hMF = MSetMetaFileBits (hBits2);
  173. return retval;
  174. }
  175. OLESTATUS FARINTERNAL MfCopy (LPOLEOBJECT lpoleobj)
  176. {
  177. LPOBJECT_MF lpobj = (LPOBJECT_MF)lpoleobj;
  178. HANDLE hMF;
  179. if (!(hMF = CopyMetaFile (lpobj->mfp.hMF, NULL)))
  180. return OLE_ERROR_MEMORY;
  181. return (MfCopyToClip (lpobj, hMF));
  182. }
  183. OLESTATUS FARINTERNAL MfQueryBounds (
  184. LPOLEOBJECT lpoleobj,
  185. LPRECT lpRc
  186. ){
  187. LPOBJECT_MF lpobj = (LPOBJECT_MF)lpoleobj;
  188. Puts("MfQueryBounds");
  189. if (!lpobj->mfp.hMF)
  190. return OLE_ERROR_BLANK;
  191. // Bounds are given in MM_HIMETRIC mode.
  192. lpRc->left = 0;
  193. lpRc->top = 0;
  194. lpRc->right = (int) lpobj->head.cx;
  195. lpRc->bottom = (int) lpobj->head.cy;
  196. return OLE_OK;
  197. }
  198. OLECLIPFORMAT FARINTERNAL MfEnumFormat (
  199. LPOLEOBJECT lpoleobj,
  200. OLECLIPFORMAT cfFormat
  201. ){
  202. LPOBJECT_MF lpobj = (LPOBJECT_MF)lpoleobj;
  203. if (!cfFormat)
  204. return CF_METAFILEPICT;
  205. return 0;
  206. }
  207. OLESTATUS FARINTERNAL MfGetData (
  208. LPOLEOBJECT lpoleobj,
  209. OLECLIPFORMAT cfFormat,
  210. LPHANDLE lphandle
  211. ){
  212. LPOBJECT_MF lpobj = (LPOBJECT_MF)lpoleobj;
  213. if (cfFormat != CF_METAFILEPICT)
  214. return OLE_ERROR_FORMAT;
  215. if (!(*lphandle = GetHmfp (lpobj)))
  216. return OLE_ERROR_BLANK;
  217. return OLE_OK;
  218. }
  219. LPOBJECT_MF FARINTERNAL MfCreateObject (
  220. HANDLE hMeta,
  221. LPOLECLIENT lpclient,
  222. BOOL fDelete,
  223. LHCLIENTDOC lhclientdoc,
  224. LPCSTR lpobjname,
  225. LONG objType
  226. ){
  227. LPOBJECT_MF lpobj;
  228. if (lpobj = MfCreateBlank (lhclientdoc, (LPSTR)lpobjname, objType)) {
  229. if (MfChangeData ((LPOLEOBJECT)lpobj, hMeta, lpclient, fDelete) != OLE_OK) {
  230. MfRelease ((LPOLEOBJECT)lpobj);
  231. lpobj = NULL;
  232. }
  233. }
  234. return lpobj;
  235. }
  236. // If the routine fails then the object will be left with it's old data.
  237. // If fDelete is TRUE, then hMeta, and the hMF it contains will be deleted
  238. // whether the routine is successful or not.
  239. OLESTATUS FARINTERNAL MfChangeData (
  240. LPOLEOBJECT lpoleobj,
  241. HANDLE hMeta,
  242. LPOLECLIENT lpclient,
  243. BOOL fDelete
  244. ){
  245. LPOBJECT_MF lpobj = (LPOBJECT_MF)lpoleobj;
  246. HANDLE hNewMF;
  247. LPMETAFILEPICT lpMetaPict;
  248. if ((lpMetaPict = (LPMETAFILEPICT) GlobalLock (hMeta)) == NULL) {
  249. if (fDelete)
  250. GlobalFree (hMeta);
  251. return OLE_ERROR_MEMORY;
  252. }
  253. GlobalUnlock (hMeta);
  254. if (!fDelete) {
  255. if (!(hNewMF = CopyMetaFile (lpMetaPict->hMF, NULL)))
  256. return OLE_ERROR_MEMORY;
  257. }
  258. else {
  259. hNewMF = lpMetaPict->hMF;
  260. }
  261. return MfUpdateStruct (lpobj, lpclient, hMeta, lpMetaPict, hNewMF, fDelete);
  262. }
  263. OLESTATUS INTERNAL MfUpdateStruct (
  264. LPOBJECT_MF lpobj,
  265. LPOLECLIENT lpclient,
  266. HANDLE hMeta,
  267. LPMETAFILEPICT lpMetaPict,
  268. HANDLE hMF,
  269. BOOL fDelete
  270. ){
  271. OLESTATUS retVal;
  272. DWORD size;
  273. HANDLE hOldMF;
  274. hOldMF = lpobj->mfp.hMF;
  275. ASSERT(lpMetaPict->mm == MM_ANISOTROPIC, "Wrong mapping mode")
  276. if (lpMetaPict->mm != MM_ANISOTROPIC)
  277. retVal = OLE_ERROR_METAFILE;
  278. else if (!(size = MfGetSize (&hMF)))
  279. retVal = OLE_ERROR_BLANK;
  280. else {
  281. lpobj->mfp = *lpMetaPict;
  282. lpobj->mfp.hMF = hMF;
  283. lpobj->sizeBytes = size + sizeof(METAFILEPICT);
  284. lpobj->head.lpclient = lpclient;
  285. lpobj->head.mm = lpobj->mfp.mm;
  286. if (lpobj->hmfp) {
  287. GlobalFree (lpobj->hmfp);
  288. lpobj->hmfp = NULL;
  289. }
  290. MfSetExtents (lpobj);
  291. if (hOldMF)
  292. DeleteMetaFile (hOldMF);
  293. retVal = OLE_OK;
  294. }
  295. if (retVal != OLE_OK)
  296. DeleteMetaFile (hMF);
  297. if (fDelete)
  298. GlobalFree (hMeta);
  299. return retVal;
  300. }
  301. LPOBJECT_MF FARINTERNAL MfCreateBlank(
  302. LHCLIENTDOC lhclientdoc,
  303. LPSTR lpobjname,
  304. LONG objType
  305. ){
  306. HOBJECT hobj;
  307. LPOBJECT_MF lpobj;
  308. if(!(hobj = GlobalAlloc (GMEM_MOVEABLE|GMEM_ZEROINIT,sizeof (OBJECT_MF))))
  309. return NULL;
  310. if (!(lpobj = (LPOBJECT_MF) GlobalLock (hobj))){
  311. GlobalFree (hobj);
  312. return NULL;
  313. }
  314. lpobj->head.objId[0] = 'L';
  315. lpobj->head.objId[1] = 'E';
  316. lpobj->head.ctype = objType;
  317. lpobj->head.lpvtbl = (LPOLEOBJECTVTBL)&vtblMF;
  318. lpobj->head.iTable = INVALID_INDEX;
  319. lpobj->head.mm = MM_TEXT;
  320. lpobj->head.hobj = hobj;
  321. if (objType == CT_STATIC)
  322. DocAddObject ((LPCLIENTDOC) lhclientdoc,
  323. (LPOLEOBJECT) lpobj, lpobjname);
  324. // Unlock will be done at object deletion time.
  325. return lpobj;
  326. }
  327. OLESTATUS FARINTERNAL MfLoadFromStream (
  328. LPOLESTREAM lpstream,
  329. LPOLECLIENT lpclient,
  330. LHCLIENTDOC lhclientdoc,
  331. LPSTR lpobjname,
  332. LPOLEOBJECT FAR * lplpobj,
  333. LONG objType
  334. ){
  335. LPOLEOBJECT lpoleobj = NULL;
  336. OLESTATUS retval = OLE_ERROR_STREAM;
  337. HANDLE hBytes = NULL;
  338. LPSTR lpBytes = NULL;
  339. DWORD dwSizeBytes;
  340. METAFILEPICT mfp;
  341. // Class name would've been read by this time.
  342. *lplpobj = NULL;
  343. switch (HIWORD(dwVerFromFile)) {
  344. case OS_WIN32:
  345. if (!(lpoleobj = (LPOLEOBJECT)EmfCreateBlank (lhclientdoc, lpobjname, objType)))
  346. return OLE_ERROR_MEMORY;
  347. break;
  348. case OS_WIN16:
  349. case OS_MAC:
  350. if (!(lpoleobj = (LPOLEOBJECT)MfCreateBlank (lhclientdoc, lpobjname, objType)))
  351. return OLE_ERROR_MEMORY;
  352. break;
  353. default:
  354. return OLE_ERROR_FILE_VER;
  355. }
  356. lpoleobj->lpclient = lpclient;
  357. if (GetBytes (lpstream, (LPSTR) &lpoleobj->cx, sizeof(LONG)))
  358. goto error;
  359. if (GetBytes (lpstream, (LPSTR) &lpoleobj->cy, sizeof(LONG)))
  360. goto error;
  361. if (GetBytes (lpstream, (LPSTR) &dwSizeBytes, sizeof(LONG)))
  362. goto error;
  363. if (!dwSizeBytes) {
  364. retval = OLE_ERROR_BLANK;
  365. goto error;
  366. }
  367. // if we are reading a MAC object we want to skip this
  368. if (HIWORD(dwVerFromFile) != OS_MAC) {
  369. WIN16METAFILEPICT w16mfp;
  370. if (GetBytes (lpstream, (LPSTR) &w16mfp, sizeof(WIN16METAFILEPICT)))
  371. goto error;
  372. ConvertMF16to32(&w16mfp, &mfp);
  373. }
  374. retval = OLE_ERROR_MEMORY;
  375. dwSizeBytes -= sizeof(WIN16METAFILEPICT);
  376. if (!(hBytes = GlobalAlloc (GMEM_MOVEABLE, dwSizeBytes)))
  377. goto error;
  378. if (!(lpBytes = (LPSTR)GlobalLock (hBytes)))
  379. goto error;
  380. if (GetBytes (lpstream, (LPSTR)lpBytes, dwSizeBytes))
  381. goto error;
  382. switch (HIWORD(dwVerFromFile)){
  383. case OS_WIN32: {
  384. LPOBJECT_EMF lpemfobj = (LPOBJECT_EMF)lpoleobj;
  385. lpemfobj->sizeBytes = dwSizeBytes;
  386. if (!((HENHMETAFILE)lpemfobj->hemf = SetWinMetaFileBits(dwSizeBytes, lpBytes, 0 , &mfp)))
  387. goto error;
  388. EmfSetExtents (lpemfobj);
  389. break;
  390. }
  391. case OS_WIN16: {
  392. LPOBJECT_MF lpmfobj = (LPOBJECT_MF)lpoleobj;
  393. lpmfobj->mfp = mfp;
  394. lpmfobj->sizeBytes = dwSizeBytes + sizeof(METAFILEPICT);
  395. lpmfobj->head.mm = lpmfobj->mfp.mm;
  396. GlobalUnlock (hBytes);
  397. lpBytes = NULL;
  398. if (!(lpmfobj->mfp.hMF = MSetMetaFileBits(hBytes)))
  399. goto error;
  400. hBytes = NULL;
  401. MfSetExtents (lpmfobj);
  402. break;
  403. }
  404. case OS_MAC: {
  405. LPOBJECT_MF lpmfobj = (LPOBJECT_MF)lpoleobj;
  406. lpmfobj->mfp.xExt = (int) lpmfobj->head.cx;
  407. lpmfobj->mfp.yExt = (int) lpmfobj->head.cy;
  408. if ((retval = wCreateDummyMetaFile (lpmfobj, lpmfobj->mfp.xExt,
  409. lpmfobj->mfp.yExt)) != OLE_OK)
  410. goto error;
  411. break;
  412. }
  413. }
  414. *lplpobj = lpoleobj;
  415. retval = OLE_OK;
  416. error:
  417. if (hBytes)
  418. {
  419. if (lpBytes)
  420. GlobalUnlock (hBytes);
  421. GlobalFree (hBytes);
  422. }
  423. if (retval != OLE_OK)
  424. OleDelete (lpoleobj);
  425. return retval;
  426. }
  427. OLESTATUS FARINTERNAL MfPaste (
  428. LPOLECLIENT lpclient,
  429. LHCLIENTDOC lhclientdoc,
  430. LPSTR lpobjname,
  431. LPOLEOBJECT FAR * lplpoleobject,
  432. LONG objType
  433. ){
  434. HANDLE hMeta;
  435. *lplpoleobject = NULL;
  436. if((hMeta = GetClipboardData (CF_METAFILEPICT)) == NULL)
  437. return OLE_ERROR_MEMORY;
  438. if (!(*lplpoleobject = (LPOLEOBJECT) MfCreateObject (hMeta, lpclient,
  439. FALSE, lhclientdoc,
  440. lpobjname, objType)))
  441. return OLE_ERROR_MEMORY;
  442. return OLE_OK;
  443. }
  444. OLESTATUS INTERNAL MfCopyToClip (
  445. LPOBJECT_MF lpobj,
  446. HANDLE hMF
  447. ){
  448. LPMETAFILEPICT lpMeta;
  449. HANDLE hMeta;
  450. if (!(hMeta = GlobalAlloc (GMEM_MOVEABLE, sizeof(METAFILEPICT))))
  451. return OLE_ERROR_MEMORY;
  452. if (lpMeta = (LPMETAFILEPICT) GlobalLock(hMeta)){
  453. *lpMeta = lpobj->mfp;
  454. if (hMF)
  455. lpMeta->hMF = hMF;
  456. else
  457. lpobj->mfp.hMF = NULL;
  458. GlobalUnlock (hMeta);
  459. SetClipboardData(CF_METAFILEPICT, hMeta);
  460. return OLE_OK;
  461. }
  462. GlobalFree(hMeta);
  463. return OLE_ERROR_MEMORY;
  464. }
  465. void FARINTERNAL MfSetExtents (LPOBJECT_MF lpobj)
  466. {
  467. if (lpobj->mfp.xExt > 0) {
  468. // The extents are assumed to be in MM_HIMETIRC units
  469. lpobj->head.cx = (LONG) lpobj->mfp.xExt;
  470. lpobj->head.cy = (LONG) - lpobj->mfp.yExt;
  471. }
  472. }
  473. DWORD INTERNAL MfGetSize (LPHANDLE lphmf)
  474. {
  475. HANDLE hBits;
  476. DWORD size;
  477. if ((hBits = MGetMetaFileBits (*lphmf)) == NULL)
  478. return 0;
  479. size = (DWORD)GlobalSize(hBits);
  480. *lphmf = MSetMetaFileBits (hBits);
  481. return size;
  482. }
  483. HANDLE INTERNAL GetHmfp (LPOBJECT_MF lpobj)
  484. {
  485. HANDLE hmfp;
  486. LPMETAFILEPICT lpmfp = NULL;
  487. if (lpobj->hmfp)
  488. return lpobj->hmfp;
  489. if (!(hmfp = GlobalAlloc (GMEM_MOVEABLE, sizeof(METAFILEPICT))))
  490. return NULL;
  491. if (!(lpmfp = (LPMETAFILEPICT) GlobalLock (hmfp))) {
  492. GlobalFree (hmfp);
  493. return NULL;
  494. }
  495. *lpmfp = lpobj->mfp;
  496. GlobalUnlock (hmfp);
  497. return (lpobj->hmfp = hmfp);
  498. }
  499. OLESTATUS FARINTERNAL wCreateDummyMetaFile (
  500. LPOBJECT_MF lpobj,
  501. int xExt,
  502. int yExt
  503. ){
  504. HDC hMetaDC;
  505. if (!(hMetaDC = CreateMetaFile (NULL)))
  506. return OLE_ERROR_MEMORY;
  507. MSetWindowOrg (hMetaDC, 0, 0);
  508. MSetWindowExt (hMetaDC, xExt, yExt);
  509. Rectangle (hMetaDC, 0, 0, xExt, yExt);
  510. if (!(lpobj->mfp.hMF = CloseMetaFile (hMetaDC)))
  511. return OLE_ERROR_MEMORY;
  512. lpobj->mfp.mm = MM_ANISOTROPIC;
  513. lpobj->sizeBytes = MfGetSize ( (LPHANDLE) &lpobj->mfp.hMF) + sizeof(METAFILEPICT);
  514. return OLE_OK;
  515. }