Click here to Skip to main content
15,907,497 members
Home / Discussions / C#
   

C#

 
GeneralRe: form Pin
Dave Kreskowiak17-Sep-09 10:42
mveDave Kreskowiak17-Sep-09 10:42 
GeneralRe: form Pin
Luc Pattyn17-Sep-09 6:54
sitebuilderLuc Pattyn17-Sep-09 6:54 
AnswerRe: form Pin
Keith Barrow17-Sep-09 6:15
professionalKeith Barrow17-Sep-09 6:15 
AnswerRe: form Pin
Manas Bhardwaj17-Sep-09 6:57
professionalManas Bhardwaj17-Sep-09 6:57 
AnswerRe: form Pin
scottgp17-Sep-09 7:25
professionalscottgp17-Sep-09 7:25 
AnswerRe: form Pin
Ian Shlasko17-Sep-09 8:14
Ian Shlasko17-Sep-09 8:14 
AnswerRe: form Pin
Richard MacCutchan17-Sep-09 9:52
mveRichard MacCutchan17-Sep-09 9:52 
AnswerRe: form Pin
Christian Graus17-Sep-09 10:31
protectorChristian Graus17-Sep-09 10:31 
Questiondelete Pin
nhqlbaislwfiikqraqnm17-Sep-09 5:48
nhqlbaislwfiikqraqnm17-Sep-09 5:48 
AnswerRe: Ip scanner? Pin
Keith Barrow17-Sep-09 6:10
professionalKeith Barrow17-Sep-09 6:10 
GeneralRe: Ip scanner? Pin
Luc Pattyn17-Sep-09 6:56
sitebuilderLuc Pattyn17-Sep-09 6:56 
GeneralRe: Ip scanner? Pin
Dave Kreskowiak17-Sep-09 7:22
mveDave Kreskowiak17-Sep-09 7:22 
GeneralRe: Ip scanner? Pin
nhqlbaislwfiikqraqnm17-Sep-09 10:21
nhqlbaislwfiikqraqnm17-Sep-09 10:21 
GeneralRe: Ip scanner? Pin
Dave Kreskowiak17-Sep-09 10:41
mveDave Kreskowiak17-Sep-09 10:41 
QuestionComparing ObservableCollections and making them same Pin
ramk_chirra17-Sep-09 5:16
ramk_chirra17-Sep-09 5:16 
AnswerRe: Comparing ObservableCollections and making them same Pin
Pete O'Hanlon17-Sep-09 5:24
mvePete O'Hanlon17-Sep-09 5:24 
AnswerRe: Comparing ObservableCollections and making them same Pin
N a v a n e e t h17-Sep-09 5:43
N a v a n e e t h17-Sep-09 5:43 
QuestionVB6 to C# conversion SetIndex issue Pin
xtr33me17-Sep-09 4:20
xtr33me17-Sep-09 4:20 
AnswerRe: VB6 to C# conversion SetIndex issue Pin
Luc Pattyn17-Sep-09 4:28
sitebuilderLuc Pattyn17-Sep-09 4:28 
GeneralRe: VB6 to C# conversion SetIndex issue [modified] Pin
N a v a n e e t h17-Sep-09 5:33
N a v a n e e t h17-Sep-09 5:33 
GeneralRe: VB6 to C# conversion SetIndex issue Pin
Luc Pattyn17-Sep-09 5:38
sitebuilderLuc Pattyn17-Sep-09 5:38 
GeneralRe: VB6 to C# conversion SetIndex issue Pin
xtr33me17-Sep-09 5:44
xtr33me17-Sep-09 5:44 
GeneralRe: VB6 to C# conversion SetIndex issue Pin
N a v a n e e t h17-Sep-09 5:45
N a v a n e e t h17-Sep-09 5:45 
Questionpremature garbage collection of static class causing problem Pin
akhanal17-Sep-09 4:05
akhanal17-Sep-09 4:05 
Well I know only objects are garbage collected, but please hear me out..

I have a class "serverClass" in my program.cs file in a project. All the members of this class are static, moreover the members of this class are DLLIMPORTS of an unmanaged Dll. This file also has the IDE generated "Program" class which has the Main() function that invokes the Form1 GUI i.e.; Application.Run(new Form1());

Now, I have the Form1.cs file with Form1 class that has buttons and listboxes. The Form1 class has the button events, etc, i have also created a couple of member functions in the Form1 class (startServer() and stopServer()). These functions call the static members of the "serverClass" from the program.cs file. But as I said earlier the serverClass is static class and hence I cannot create an instance to access its functions, instead I go serverClass.function1() (i.e.; className.memberFunction()), serverClass.function2(), etc.

I want to access the startServer() and stopServer() functions on the click of the buttons "Start" and "Stop" respectively. So in the click events of these buttons I call these functions.

The project compiles fine. When I run the application/form and click 'Start' button the startServer() function is called and the server runs fine as desired. But my problem is when I click the 'Stop' button and the stopServer() function is called, I get a runtime error "CallbackOnCollectedDelegate" on the line in the stopServer() function where I call a member of serverClass as serverClass.function2().

I might be wrong in the class structuring itself....I appreciate all the suggestions and ideas.

BTW all of the mentioned classes are in the same namespace.
AnswerRe: premature garbage collection of static class causing problem Pin
Luc Pattyn17-Sep-09 4:19
sitebuilderLuc Pattyn17-Sep-09 4:19 

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.