Click here to Skip to main content
15,913,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to convert??? Pin
Maxwell Chen6-Apr-04 18:44
Maxwell Chen6-Apr-04 18:44 
GeneralRe: how to convert??? Pin
Ravi Bhavnani7-Apr-04 1:25
professionalRavi Bhavnani7-Apr-04 1:25 
GeneralRe: how to convert??? Pin
don7cry7-Apr-04 18:17
don7cry7-Apr-04 18:17 
GeneralStrange Visual C++ behavior - Computationally heavy app. Pin
Indrawati6-Apr-04 17:27
Indrawati6-Apr-04 17:27 
GeneralRe: Strange Visual C++ behavior - Computationally heavy app. Pin
Maxwell Chen6-Apr-04 17:29
Maxwell Chen6-Apr-04 17:29 
GeneralRe: Strange Visual C++ behavior - Computationally heavy app. Pin
cmk6-Apr-04 21:13
cmk6-Apr-04 21:13 
QuestionHow to use CDataGrid Pin
yingkou6-Apr-04 17:08
yingkou6-Apr-04 17:08 
QuestionLPPICTUREDISP -- CPictureHolder --- How to release memory? Pin
SNathani6-Apr-04 13:12
SNathani6-Apr-04 13:12 
Hi,

I've been working on an image based application. I'm using VB and VC++ to work with the images. Both are activex controls. I created a property like Get/SetActivePicture(LPPICTUREDISP pPicture). The code is given below.

I'm facing memory problems. Can someone help me how can I release the memory from VC++ after I use the picture object? Thanks in advance .. I can't release the component until I solve this issue. Pls. somebody help me.

The implemenation in VB is like this ... After using this, the virtual memory has been increasing each time ... the performance became too slow !!! Frown | :(

....
PicEd.Open("C:\Temp.bmp")
set PicEd.ActivePicture = Picture1.Picture
PicEd.RotateBy(90)
set Picture1.Picture = PicEd.ActivePicture()
....


//----------------------------------------------------------------------
void CPicEdCtrl::SetActivePicture(LPPICTUREDISP newValue)
{
// TODO: Add your property handler here
if (newValue == NULL) return;

try
{
HBITMAP hBMP;
HRESULT lResult;

newValue->AddRef ();
m_Pic.SetPictureDispatch(newValue);
newValue->Release();

lResult = m_Pic.m_pPict->get_Handle((OLE_HANDLE FAR *) &hBMP);

//CxImage* image;
image->CreateFromHBITMAP((HBITMAP)hBMP);

}catch (CException e)
{
e.ReportError();
e.Delete();
}
SetModifiedFlag();
}

// ------------ ---------------------- --------------- ------

LPPICTUREDISP CPicEdCtrl::GetActivePicture()
{
// TODO: Add your property handler here
if (image == NULL)
{
m_Pic.CreateEmpty();
goto EndProp;
}

try
{
m_Pic.CreateFromBitmap (image->MakeBitmap(0));

}catch (CException e)
{
//Suppress any exceptions
e.Delete();
m_Pic.CreateEmpty();
}
EndProp:
//return the IPicture dispatch interface
return m_Pic.GetPictureDispatch();
}

Generaluse of template class and operator-> Pin
tparry6-Apr-04 11:43
tparry6-Apr-04 11:43 
GeneralRe: use of template class and operator-> Pin
Guido Loupias7-Apr-04 3:29
Guido Loupias7-Apr-04 3:29 
QuestionX10 C/C++ API? Pin
Ravi Bhavnani6-Apr-04 11:11
professionalRavi Bhavnani6-Apr-04 11:11 
AnswerFound it! Pin
Ravi Bhavnani6-Apr-04 12:44
professionalRavi Bhavnani6-Apr-04 12:44 
QuestionCString to DWORD ? INT ? Pin
LudaLuda6-Apr-04 11:11
LudaLuda6-Apr-04 11:11 
AnswerRe: CString to DWORD ? INT ? Pin
Ravi Bhavnani6-Apr-04 11:16
professionalRavi Bhavnani6-Apr-04 11:16 
GeneralRe: CString to DWORD ? INT ? Pin
LudaLuda6-Apr-04 11:26
LudaLuda6-Apr-04 11:26 
GeneralRe: CString to DWORD ? INT ? Pin
Ravi Bhavnani6-Apr-04 11:31
professionalRavi Bhavnani6-Apr-04 11:31 
AnswerRe: CString to DWORD ? INT ? Pin
avenger_sb256-Apr-04 11:49
avenger_sb256-Apr-04 11:49 
GeneralRe: CString to DWORD ? INT ? Pin
Prakash Nadar6-Apr-04 15:31
Prakash Nadar6-Apr-04 15:31 
GeneralCListCtrl - Highlighting all of the selected row Pin
mmica6-Apr-04 10:59
mmica6-Apr-04 10:59 
GeneralRe: CListCtrl - Highlighting all of the selected row Pin
Ravi Bhavnani6-Apr-04 11:06
professionalRavi Bhavnani6-Apr-04 11:06 
Generalclipped controls Pin
pgiustinoni6-Apr-04 6:37
pgiustinoni6-Apr-04 6:37 
GeneralRe: clipped controls Pin
avenger_sb256-Apr-04 7:27
avenger_sb256-Apr-04 7:27 
GeneralShowWindow problem Pin
reznod6-Apr-04 6:09
reznod6-Apr-04 6:09 
GeneralRe: ShowWindow problem Pin
Prakash Nadar6-Apr-04 7:02
Prakash Nadar6-Apr-04 7:02 
GeneralRe: ShowWindow problem Pin
reznod6-Apr-04 7:35
reznod6-Apr-04 7:35 

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.