Click here to Skip to main content
15,890,123 members
Home / Discussions / C#
   

C#

 
QuestionExecuteNonQuery problem? [modified] Pin
Emmet_Brown19-Oct-10 8:21
Emmet_Brown19-Oct-10 8:21 
AnswerRe: ExecuteNonQuery problem? Pin
Luc Pattyn19-Oct-10 8:33
sitebuilderLuc Pattyn19-Oct-10 8:33 
AnswerRe: ExecuteNonQuery problem? Pin
Maciej Los19-Oct-10 8:42
mveMaciej Los19-Oct-10 8:42 
GeneralRe: ExecuteNonQuery problem? Pin
Emmet_Brown19-Oct-10 8:47
Emmet_Brown19-Oct-10 8:47 
AnswerRe: ExecuteNonQuery problem? Pin
Maciej Los19-Oct-10 9:12
mveMaciej Los19-Oct-10 9:12 
AnswerSOLVED Pin
Emmet_Brown19-Oct-10 11:04
Emmet_Brown19-Oct-10 11:04 
AnswerRe: ExecuteNonQuery problem? Pin
Pete O'Hanlon19-Oct-10 22:04
mvePete O'Hanlon19-Oct-10 22:04 
QuestionAxWebBrowser object seems to be causing memory leak Pin
HalliHaida19-Oct-10 1:05
HalliHaida19-Oct-10 1:05 
Hi,

I am using IECore as the renderer. I am able to capture the snapshot of the web content and save it as bmp file (shown below).

To get the content

AxWebBrowser web = new AxWebBrowser();
web.SetBounds(0, 0, 1024, 600);
web.Navigate2(ref URL, ref oNull, ref oNull, ref oNull, ref oNull);
Application.Run();

private Graphics grp;
private IntPtr hdc;
private IViewObject vw;
private IHTMLDocument2 doc;

public void Capture()
{


doc = (IHTMLDocument2)web .Document;
web.SetBounds(0, 0, width, height);

image = new Bitmap(width, height);
grp = Graphics.FromImage(image);

_RECTL bounds;
bounds.left = 0;
bounds.top = 0;
bounds.right = width;
bounds.bottom = height;

hdc = grp.GetHdc();
vw = doc2 as IViewObject;

vw.Draw(1, -1, (IntPtr)0, (IntPtr)0, (IntPtr)0,
(IntPtr)hdc, ref bounds, (IntPtr)0, (IntPtr)0, 0);

grp.ReleaseHdc(hdc);
image.Save(fileName);
image.Dispose();
}

}

I am calling Capture at x fps. What I have observed is, if the application is allowed to run for 30 mins - 1 hrs, the memory increases from 30MB to 600 MB and more and finally the application crashes Frown | :(

I tried forcefully disposing the bitmap and graphics object. But still the problem persists. I am not getting the root cause of the issue.

Any help is appreciated.
AnswerRe: AxWebBrowser object seems to be causing memory leak PinPopular
Luc Pattyn19-Oct-10 1:39
sitebuilderLuc Pattyn19-Oct-10 1:39 
AnswerRe: AxWebBrowser object seems to be causing memory leak Pin
Pete O'Hanlon19-Oct-10 1:48
mvePete O'Hanlon19-Oct-10 1:48 
GeneralRe: AxWebBrowser object seems to be causing memory leak Pin
HalliHaida25-Oct-10 3:15
HalliHaida25-Oct-10 3:15 
QuestionMessage Removed Pin
18-Oct-10 22:11
Varun Sareen18-Oct-10 22:11 
AnswerRe: KeyValuePair List problem? Pin
OriginalGriff18-Oct-10 22:37
mveOriginalGriff18-Oct-10 22:37 
AnswerRe: KeyValuePair List problem? Pin
johannesnestler19-Oct-10 3:27
johannesnestler19-Oct-10 3:27 
QuestionForm submit to server [modified] Pin
Ajay Kale New18-Oct-10 20:45
Ajay Kale New18-Oct-10 20:45 
AnswerRe: Form submit to server Pin
OriginalGriff18-Oct-10 22:38
mveOriginalGriff18-Oct-10 22:38 
Questionhow to get value from form 1 to form 2 Pin
ash_ng18-Oct-10 17:29
ash_ng18-Oct-10 17:29 
AnswerRe: how to get value from form 1 to form 2 Pin
JF201518-Oct-10 18:07
JF201518-Oct-10 18:07 
AnswerRe: how to get value from form 1 to form 2 Pin
Abhinav S18-Oct-10 18:27
Abhinav S18-Oct-10 18:27 
AnswerRe: how to get value from form 1 to form 2 Pin
Calla18-Oct-10 19:46
Calla18-Oct-10 19:46 
GeneralRe: how to get value from form 1 to form 2 Pin
ash_ng18-Oct-10 20:07
ash_ng18-Oct-10 20:07 
GeneralRe: how to get value from form 1 to form 2 Pin
Calla18-Oct-10 20:19
Calla18-Oct-10 20:19 
GeneralRe: how to get value from form 1 to form 2 Pin
DaveyM6919-Oct-10 0:04
professionalDaveyM6919-Oct-10 0:04 
AnswerRe: how to get value from form 1 to form 2 Pin
Varun Sareen18-Oct-10 22:26
Varun Sareen18-Oct-10 22:26 
GeneralRe: how to get value from form 1 to form 2 Pin
OriginalGriff18-Oct-10 23:44
mveOriginalGriff18-Oct-10 23:44 

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.