Click here to Skip to main content
15,888,106 members
Home / Discussions / C#
   

C#

 
AnswerRe: scroll bar Pin
algates002719-Oct-08 20:12
algates002719-Oct-08 20:12 
QuestionCustom action not running during installation Pin
tahir_makhdoom29-Aug-08 17:55
tahir_makhdoom29-Aug-08 17:55 
Answer[Cross-Post] Re: Custom action not running during installation Pin
Scott Dorman29-Aug-08 18:08
professionalScott Dorman29-Aug-08 18:08 
QuestionQuestion about Interfaces Pin
MarkB77729-Aug-08 17:07
MarkB77729-Aug-08 17:07 
AnswerRe: Question about Interfaces Pin
Scott Dorman29-Aug-08 17:57
professionalScott Dorman29-Aug-08 17:57 
GeneralRe: Question about Interfaces Pin
MarkB77729-Aug-08 18:09
MarkB77729-Aug-08 18:09 
GeneralRe: Question about Interfaces Pin
Scott Dorman29-Aug-08 18:19
professionalScott Dorman29-Aug-08 18:19 
GeneralRe: Question about Interfaces Pin
MarkB77729-Aug-08 18:36
MarkB77729-Aug-08 18:36 
Hi,

Yes by Excel object is custom class that wraps the COM object, and contains all the methods for getting information from Excel.

I'm not implementing IDisposable, The IExcel interface declares the dispose method.

If I call dispose from the 'excel' object it cleans up fine, however if I call it from an IExcel instance then it is not.

My dispose procedure is implemented as below:

<br />
<br />
        public void Dispose()<br />
        {<br />
            try<br />
            {<br />
                    this.Cleanup(this.sheet);<br />
                    this.workBook.Close(false, null, null);<br />
                    this.Cleanup(this.workBook);<br />
                    this.application.Quit();<br />
                    this.Cleanup(this.application);<br />
            }<br />
            catch (Exception) { }<br />
        }<br />
<br />
        private void Cleanup(object o)<br />
        {<br />
            try<br />
            {<br />
                System.Runtime.InteropServices.Marshal.ReleaseComObject(o);<br />
            }<br />
            catch { }<br />
            finally<br />
            {<br />
                o = null;<br />
            }<br />
        }<br />



Cheers,

Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog

GeneralRe: Question about Interfaces Pin
Scott Dorman29-Aug-08 19:15
professionalScott Dorman29-Aug-08 19:15 
QuestionMoving from VSWD Express 2008 to VS2008, Namespace problem Pin
Vodstok29-Aug-08 13:01
Vodstok29-Aug-08 13:01 
QuestionPointer help Pin
jacobjordan29-Aug-08 12:54
jacobjordan29-Aug-08 12:54 
AnswerRe: Pointer help Pin
Mark Salsbery29-Aug-08 14:03
Mark Salsbery29-Aug-08 14:03 
AnswerRe: Pointer help Pin
Guffa30-Aug-08 0:08
Guffa30-Aug-08 0:08 
QuestionCuror Pin
netJP12L29-Aug-08 9:12
netJP12L29-Aug-08 9:12 
AnswerRe: Curor Pin
Wendelius29-Aug-08 9:38
mentorWendelius29-Aug-08 9:38 
QuestionGet list of all fields referenced from RDLC XML file Pin
AndrusM29-Aug-08 9:05
AndrusM29-Aug-08 9:05 
AnswerRe: Get list of all fields referenced from RDLC XML file Pin
Wendelius29-Aug-08 9:17
mentorWendelius29-Aug-08 9:17 
GeneralRe: Get list of all fields referenced from RDLC XML file Pin
AndrusM29-Aug-08 9:31
AndrusM29-Aug-08 9:31 
GeneralRe: Get list of all fields referenced from RDLC XML file Pin
Wendelius29-Aug-08 9:59
mentorWendelius29-Aug-08 9:59 
GeneralRe: Get list of all fields referenced from RDLC XML file Pin
AndrusM30-Aug-08 6:59
AndrusM30-Aug-08 6:59 
GeneralRe: Get list of all fields referenced from RDLC XML file Pin
Wendelius30-Aug-08 7:10
mentorWendelius30-Aug-08 7:10 
QuestionVenue booking code in vb.net Pin
masosha29-Aug-08 8:35
masosha29-Aug-08 8:35 
AnswerRe: Venue booking code in vb.net Pin
Pete O'Hanlon29-Aug-08 8:38
mvePete O'Hanlon29-Aug-08 8:38 
GeneralRe: Venue booking code in vb.net Pin
Ashfield29-Aug-08 9:02
Ashfield29-Aug-08 9:02 
AnswerRe: Venue booking code in vb.net Pin
Expert Coming29-Aug-08 9:09
Expert Coming29-Aug-08 9: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.