Click here to Skip to main content
15,916,412 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: To get user input from a window. Pin
David Crow30-Oct-07 3:22
David Crow30-Oct-07 3:22 
QuestionPlaying AVI directly that is inside in a bigger data file Pin
sdancer7529-Oct-07 22:06
sdancer7529-Oct-07 22:06 
AnswerRe: Playing AVI directly that is inside in a bigger data file Pin
Neo Andreson30-Oct-07 20:22
Neo Andreson30-Oct-07 20:22 
QuestionImages serialization Pin
aolihu29-Oct-07 21:42
aolihu29-Oct-07 21:42 
AnswerRe: Images serialization Pin
Paresh Chitte29-Oct-07 21:47
Paresh Chitte29-Oct-07 21:47 
GeneralRe: Images serialization Pin
aolihu29-Oct-07 22:51
aolihu29-Oct-07 22:51 
GeneralRe: Images serialization [modified] Pin
Nelek29-Oct-07 23:43
protectorNelek29-Oct-07 23:43 
GeneralRe: Images serialization Pin
aolihu9-Nov-07 3:48
aolihu9-Nov-07 3:48 
Nelek, Thanks for u advice.The key of the problem is how to deal with picture and binary stream. I used GDI+ Library and got the answer smoothly.
Part of code below:
///////////////begin/////////////////
if(ar.IsStoring()){
HGLOBAL m_hMem = GlobalAlloc(GMEM_MOVEABLE, 0);
IStream *pstm=NULL;
CreateStreamOnHGlobal(m_hMem, TRUE, &pstm);
CLSID clsid;
USES_CONVERSION;
GetCodecClsid(A2W("image/jpeg"), &clsid);
m_pImage->Save(pstm,&clsid,NULL);
if (pstm==NULL)
return;
LARGE_INTEGER liBeggining = { 0 };
pstm->Seek(liBeggining, STREAM_SEEK_SET, NULL);
DWORD wTemp=GlobalSize(m_hMem);
LPBYTE lpData = (LPBYTE)GlobalLock(m_hMem);
ar << wTemp;
ar.Write(lpData,wTemp);
pstm->Release();
GlobalUnlock(m_hMem);
}
else{
DWORD wTemp;
ar >> wTemp;
HGLOBAL m_hMem = GlobalAlloc(GMEM_FIXED, wTemp);
if (m_hMem == NULL)
return;
IStream *pstm=NULL;
CreateStreamOnHGlobal(m_hMem,FALSE,&pstm);
if (pstm==NULL)
return;
BYTE* pmem = (BYTE*)GlobalLock(m_hMem);
ar.Read(pmem,wTemp);
if (m_pImage) {
delete m_pImage;
m_pImage = NULL;
}
using namespace Gdiplus;
if (m_pImage!=NULL)
{
delete m_pImage;
m_pImage=NULL;
}
m_pImage = Image::FromStream(pstm, FALSE);
pstm->Release();
GlobalUnlock(m_hMem);
}
//////////////end//////////////////Smile | :)

In my application, i use a CWebBrowser control to display the content from a serialize file. There is a new question to me, how to load 'm_pImage'? Confused | :confused: Could you give me more suggestion, Thanks for anything...
GeneralRe: Images serialization Pin
Nelek14-Nov-07 3:41
protectorNelek14-Nov-07 3:41 
QuestionCreate Xml document from xml schema (xsd) file Pin
SumoRaj29-Oct-07 21:32
SumoRaj29-Oct-07 21:32 
Questionrun exe Pin
john563229-Oct-07 21:06
john563229-Oct-07 21:06 
AnswerRe: run exe Pin
Hamid_RT29-Oct-07 21:13
Hamid_RT29-Oct-07 21:13 
GeneralRe: run exe Pin
john563229-Oct-07 21:48
john563229-Oct-07 21:48 
GeneralRe: run exe Pin
Hamid_RT29-Oct-07 22:04
Hamid_RT29-Oct-07 22:04 
GeneralRe: run exe Pin
john563229-Oct-07 23:03
john563229-Oct-07 23:03 
GeneralRe: run exe Pin
Hamid_RT30-Oct-07 0:26
Hamid_RT30-Oct-07 0:26 
GeneralRe: run exe Pin
john563229-Oct-07 23:09
john563229-Oct-07 23:09 
GeneralRe: run exe Pin
Hamid_RT30-Oct-07 0:25
Hamid_RT30-Oct-07 0:25 
AnswerRe: run exe Pin
David Crow30-Oct-07 3:24
David Crow30-Oct-07 3:24 
QuestionMessage Handling of an Edit control Pin
YKK Reddy29-Oct-07 21:00
YKK Reddy29-Oct-07 21:00 
AnswerRe: Message Handling of an Edit control Pin
chandu00429-Oct-07 21:32
chandu00429-Oct-07 21:32 
GeneralRe: Message Handling of an Edit control Pin
YKK Reddy29-Oct-07 22:58
YKK Reddy29-Oct-07 22:58 
QuestionRe: Message Handling of an Edit control Pin
Nishad S29-Oct-07 22:05
Nishad S29-Oct-07 22:05 
QuestionDICOM FILES Pin
Caravel29-Oct-07 20:56
Caravel29-Oct-07 20:56 
AnswerRe: DICOM FILES Pin
Paresh Chitte29-Oct-07 21:09
Paresh Chitte29-Oct-07 21:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.