I tried a Console.WriteLine(tbx.InvokeRequired) and it was false. Also, I know the textbox is getting focus because I can see it. The curosor is blinking in the textbox, and when I type text goes into it.
I don't think sending a KEYUP is required, because it's not required in normal keyboard activity either. For example, when you press a key here in a web form, the letter appears on keydown, not on keyup. Also, I've seen examples of this in C++ (non dotnet) and non of the examples have a subsequent KEYUP.
Thanks for your responses anyway tho.
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
I have managed to get the keywords out, but I think that regular expressions could do it much quicker for me. I am looking into those right now If you have any experience with regular expressions, please look at my new post
Professional C++ Developer
Amature C# Software Architect
My C# app calls a COM server but does not release it. What's Wrong? Urgent!
Here is how I call it:
for (int i; i<10; i++)
SomeFunc2(); // in this func I cann that COM server see below// here nether mf nor mf2 are released even though they// are now way out of scoop// so on each loop reference is incremented
// MyCOMLib is added to project as reference
MyCOMLib.MyIFace mf = null;
mf = new MyCOMLib.MyIFace();
string myParam = "Here is some param";
// next retruns MyCOMLib.MyIFace2
MyCOMLib.MyIFace2 mf2 = mf.MyMethod(myParam);
mf2.MyProperty = 1;
// here mf2 is out of scoop but COM object it// pointed to IS NOT released
The problem is that for some reason, even when COM interface
IUnknown derived C# compiler throuws at me: MyCOMLib.MyIFace2 does not contain a definition for 'Release'
and assigning to null does not release it right away for sure.
How do I work this appartment thing?
O! So GC does not release objects right away, does it?!
It looks like if I call GC.Collect(); objects do get released (not right there but in a couple of milsecs).
I'm assuming that means that my COM objects are fine and can be released just fine, right? Or is this GC.Collect(); a kind of cheating?
If not, why GC doesn't clear local vars right there on the spot like VB does (I think ) ? When does it do it?
GC.Collect() is kinda hardcore. This method is not normally called by a client app, except in critical scenarios (huge memory needs, and so on). It's true that, from what I know from the Java GC, the GC has no good reason to release objects as soon as they are out of scope.
The fact that GC.Collect() has actually released your COM object is that it was a weak-reference in scope.
Interesting! Thanks a lot.
Curious : what's "weak-reference"?
And what do you mean by "COM are normaly finely released"?
May be my english is not that good yet
Do you think I still have to hunt for problem or it looks like it's fine. What do I do?
I'm trying to call functions exposed by a .Net application (exe, not dll) from a COM client. The problem is that the tlb generated by regasm (or tlbexp) doesn't have enough info. I assume I need to use some funky attributes, but I just can't find them.
Does anyone have an idea?
ComVisible determines if a class/method is visible to COM, but has no effect in exes. ComSource is linked to events; I don't need those. Am I missing something?
Also, can you please explain the last part? The one with "how low..".
Essentially iterating through your array, make sure you have a graphics object when doing this (e.g. - grfx):
Color c = Color.Black;
Brush brush = new SolidBrush(c);
float y = 0;
FontFamily aff = FontFamily.Families;
foreach (FontFamily ff in aff)
Font font = new Font(ff, 12);
grfx.DrawString(ff.Name, font, brush, 0, y);
y += font.GetHeight(grfx);
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
From my C# application, I want to create a MS access database create tables and update it with the data that I receive from the network! Kinda the same way cd player (that comes with win2k) stores its records on an Access DB and retreives them back.
Why not just use ADO.NET's System.Data.OleDB namespace? If it's already built-in to the .NET framework...why download the Jet.NET driver?
Norm Almond: I seen some GUI's in my life but WTF is this mess Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children Leppie:My sister is 25
-Norm on the MailMagic GUI
I builded my application at home with C# and I tried it on others computers but it doesn't work. Do you know if I need to install on each computer the pack of 20Mo (I would need autorisations)? Or is there any other way as just copying a few files ?
I have another question, is it possible to compile C# appz in binary as C++ does ? This would speed up and solve the problem of my first question...
Thanks by advance.
Last Visit: 31-Dec-99 18:00 Last Update: 27-Sep-23 3:26