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

C#

 
AnswerRe: Changing crystal report connection at runtime Pin
mjmcinto20-Aug-07 3:49
mjmcinto20-Aug-07 3:49 
GeneralRe: Changing crystal report connection at runtime Pin
-spy-20-Aug-07 4:45
-spy-20-Aug-07 4:45 
Questionproblem in xmlserialization for arraylist Pin
cyn820-Aug-07 0:41
cyn820-Aug-07 0:41 
AnswerRe: problem in xmlserialization for arraylist Pin
Hessam Jalali20-Aug-07 2:12
Hessam Jalali20-Aug-07 2:12 
GeneralRe: problem in xmlserialization for arraylist Pin
cyn820-Aug-07 15:09
cyn820-Aug-07 15:09 
GeneralRe: problem in xmlserialization for arraylist Pin
cyn820-Aug-07 16:51
cyn820-Aug-07 16:51 
QuestionLosing COM event handlers in C# [modified] Pin
Vitaly Tomilov20-Aug-07 0:14
Vitaly Tomilov20-Aug-07 0:14 
AnswerRe: Losing COM event handlers in C# Pin
Vitaly Tomilov20-Aug-07 1:28
Vitaly Tomilov20-Aug-07 1:28 
I seem to have found the problem, which also is a horrible revelation, another .NET bug, I think… So, this is what it was…

In a simple scenario, you bind COM event to your C# handler via += operator, for YourInterfaceVariable.EventName += New MyHandler, which seems to do the job fine.

Now consider a little more complicated scenario, where your main interface doesn’t expose events. Instead, it exposes a property of another interface, which in turn exposes events. Now, you want to attach a C# event handler to that internal interface via the property, obviously, so you give the command: VariableName.PropertyName.EventName += new MyHandler.

By all logic, this must work, and it even does, for a while, a few calls, 10-30, as all-of-a-sudden, your events stop coming in!!! You start asking yourself why, and the answer is astounding: C#/.NET doesn’t support such internal references properly, and at some point they seem to get into the automated garbage collection, or so it would seem. How do I know? That’s simple: I declared another variable of type of the internal event interface, then set it at run time, and did C# binding onto that variable instead its reference through the containing interface. And that solved the problem, the event handler no longer looses the connection.

Now how do you like THEM apples! Am I far indulging into Microsoft hatred or that’s really another screw up on their part?

Any comments are welcome.


Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...

Questionunable to display MySQL DateTime DataType Values in Crystal Reports using C#.NET 2.0 XML Schema Pin
raju572520-Aug-07 0:08
raju572520-Aug-07 0:08 
QuestionCompatibility question Pin
Muammar©19-Aug-07 23:27
Muammar©19-Aug-07 23:27 
AnswerRe: Compatibility question [modified] Pin
Hessam Jalali19-Aug-07 23:55
Hessam Jalali19-Aug-07 23:55 
AnswerRe: Compatibility question Pin
Christian Graus19-Aug-07 23:57
protectorChristian Graus19-Aug-07 23:57 
AnswerRe: Compatibility question Pin
Mustafa Ismail Mustafa20-Aug-07 3:13
Mustafa Ismail Mustafa20-Aug-07 3:13 
QuestionWhat is the logic for WebService methods ? Pin
MehmetFurkan19-Aug-07 23:07
MehmetFurkan19-Aug-07 23:07 
AnswerRe: What is the logic for WebService methods ? Pin
Talal Sultan19-Aug-07 23:27
Talal Sultan19-Aug-07 23:27 
GeneralRe: What is the logic for WebService methods ? Pin
MehmetFurkan20-Aug-07 0:09
MehmetFurkan20-Aug-07 0:09 
GeneralRe: What is the logic for WebService methods ? Pin
Talal Sultan20-Aug-07 1:38
Talal Sultan20-Aug-07 1:38 
QuestionIs it possible to create an Access database with Pure C# Code Pin
Infernojericho19-Aug-07 23:04
Infernojericho19-Aug-07 23:04 
AnswerRe: Is it possible to create an Access database with Pure C# Code Pin
Christian Graus20-Aug-07 0:01
protectorChristian Graus20-Aug-07 0:01 
GeneralRe: Is it possible to create an Access database with Pure C# Code Pin
Syed Mujtaba Hassan20-Aug-07 2:51
Syed Mujtaba Hassan20-Aug-07 2:51 
AnswerRe: Is it possible to create an Access database with Pure C# Code Pin
Talal Sultan20-Aug-07 0:03
Talal Sultan20-Aug-07 0:03 
GeneralRe: Is it possible to create an Access database with Pure C# Code Pin
Infernojericho20-Aug-07 0:35
Infernojericho20-Aug-07 0:35 
GeneralRe: Is it possible to create an Access database with Pure C# Code Pin
Christian Graus20-Aug-07 0:45
protectorChristian Graus20-Aug-07 0:45 
GeneralRe: Is it possible to create an Access database with Pure C# Code Pin
Talal Sultan20-Aug-07 1:48
Talal Sultan20-Aug-07 1:48 
GeneralRe: Is it possible to create an Access database with Pure C# Code Pin
J4amieC20-Aug-07 1:02
J4amieC20-Aug-07 1:02 

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.