Reg. CSharedFile
Chandra Venkatraman -- chandru@fcpl.co.in Wednesday, August 28, 1996 Environment:Windows 95, Visual C++ 4.2 I had the oppurtunity to work with MFC's OLE Implementation. I had to implement a OLE Drop Source and a OLE Drop Target while implementing Drag and Drop using OLE. Reading one of the samples I came across "CSharedFile" which was being used by "CacheGlobalData". There was no documentation for CSharedFile but I assumed it had to be like CMemFile. Is there any specific reason why CSharedFile is being used while performing "CacheGlobalData". Is there any place where I can get documentation on CSharedFile Chandru Chandrasekar Venkataraman --------------------------------------------------------------------------- Office : Frontier Computers (P) Ltd. Vastu Chambers, IInd Floor, 1202/39, Shirole Road, Shivaji Nagar, Pune - 411004 Voice : +91 - 0212 - 321536 E-Mail: chandru@fcpl.co.in, vraman@cyberspace.org, csekar@hotmail.com ---------------------------------------------------------------------------
Bharat Gogia -- gogiabd@batelco.com.bh Friday, August 30, 1996 [Mini-digest: 3 responses] Hi, This following site will give you documentation you are looking for http://www.periphere.com/set/sundoc0.htm Bharat Gogia---------- > From: Chandrasekar Venkataraman > To: MFC-L > Subject: Reg. CSharedFile > Date: Wednesday, August 28, 1996 8:09 AM > > Environment:Windows 95, Visual C++ 4.2 > > I had the oppurtunity to work with MFC's OLE Implementation. I had to > implement a OLE Drop Source and a OLE Drop Target while implementing Drag > and Drop using OLE. Reading one of the samples I came across "CSharedFile" > which was being used by "CacheGlobalData". There was no documentation for > CSharedFile but I assumed it had to be like CMemFile. Is there any specific > reason why CSharedFile is being used while performing "CacheGlobalData". > > Is there any place where I can get documentation on CSharedFile > > Chandru > > Chandrasekar Venkataraman > --------------------------------------------------------------------------- > Office : > Frontier Computers (P) Ltd. > Vastu Chambers, IInd Floor, > 1202/39, Shirole Road, > Shivaji Nagar, > Pune - 411004 > > Voice : +91 - 0212 - 321536 > E-Mail: chandru@fcpl.co.in, vraman@cyberspace.org, csekar@hotmail.com > --------------------------------------------------------------------------- -----From: "Richard A. Nichols" Hi Chandru Environment:Windows 95, Visual C++ 4.2 CShared file is in the 4.2 class reference. Below is the description that is given. CSharedFile is the CMemFile-derived class that supports shared memory files. Memory files behave like disk files except that the file is stored in RAM rather than on disk. A memory file is useful for fast temporary storage or for transferring raw bytes or serialized objects between independent processes. Shared memory files differ from other memory files in that memory for them is allocated with the GlobalAlloc Windows function. GlobalAlloc returns an HGLOBAL handle rather than a pointer to memory, such as the pointer returned by malloc. The HGLOBAL handle is needed in certain applications. For example, to put data on the Clipboard you need an HGLOBAL handle. CSharedFile objects can automatically allocate their own memory or you can attach your own memory block to the CSharedFile object by calling CSharedFile::SetHandle. In either case, memory for growing the memory file automatically is allocated in nGrowBytes-sized increments if nGrowBytes is not zero. For more information, see the article Files in Programming with MFC and File Handling in the Run-Time Library Reference. #include Richard A. Nichols RANWare -----From: "Ian Carbaugh (Best)" CSharedFile uses global memory. Specifically, "GlobalAlloc(), GlobalReAlloc(), GlobalLock(), and GlobalFree() are used instead of the alloc/realloc/free memory handlers." MFC Internals by George Sheppard and Scot Wingo discusses this undocumented class. Ian Carbaugh Ian_Carbaugh@msn.com
| Вернуться в корень Архива |