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

C#

 
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 
GeneralRe: premature garbage collection of static class causing problem Pin
akhanal17-Sep-09 4:31
akhanal17-Sep-09 4:31 
GeneralRe: premature garbage collection of static class causing problem Pin
Luc Pattyn17-Sep-09 4:57
sitebuilderLuc Pattyn17-Sep-09 4:57 
GeneralRe: premature garbage collection of static class causing problem Pin
akhanal17-Sep-09 5:18
akhanal17-Sep-09 5:18 
GeneralRe: premature garbage collection of static class causing problem Pin
akhanal17-Sep-09 5:25
akhanal17-Sep-09 5:25 
QuestionError in Loading assembly from Assembly.Load Pin
SRKSHOME17-Sep-09 3:31
SRKSHOME17-Sep-09 3:31 
AnswerRe: Error in Loading assembly from Assembly.Load Pin
Not Active17-Sep-09 4:19
mentorNot Active17-Sep-09 4:19 
AnswerRe: Error in Loading assembly from Assembly.Load Pin
Luc Pattyn17-Sep-09 4:20
sitebuilderLuc Pattyn17-Sep-09 4:20 
QuestionCalling GUI & path finding gurus Pin
izakfick17-Sep-09 3:27
izakfick17-Sep-09 3:27 
AnswerRe: Calling GUI & path finding gurus Pin
Pete O'Hanlon17-Sep-09 4:11
mvePete O'Hanlon17-Sep-09 4:11 
QuestionAllow space in text box - add the code for allowing spaces in regular expression validator Pin
coolsharath17-Sep-09 3:21
coolsharath17-Sep-09 3:21 
AnswerRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
Calla17-Sep-09 3:40
Calla17-Sep-09 3:40 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
coolsharath17-Sep-09 3:51
coolsharath17-Sep-09 3:51 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
coolsharath17-Sep-09 4:06
coolsharath17-Sep-09 4:06 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
Calla17-Sep-09 4:20
Calla17-Sep-09 4:20 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
coolsharath17-Sep-09 4:26
coolsharath17-Sep-09 4:26 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
OriginalGriff17-Sep-09 4:36
mveOriginalGriff17-Sep-09 4:36 

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.