|
|
Set a breakpoint on the timer, and see what the variable looks like there. Perhaps set breakpoints where-ever you change the variable, to establish order of operation.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I assume your COM component does not stand being called from different threads; I am
guessing you start recording from the UI thread, and stop recording by the timer
elapsed event, which runs on a thread pool thread.
If this is correct, there are basically two ways to fix it:
1) use Invoke to get the stop done on the UI thread
2) recommended: use a Forms.Timer instead of a Timers.Timer (so the tick event
automatically runs on the UI thread)
Luc Pattyn
|
|
|
|
|
I have a frame control that is running an external XAML file that contains a page.
I want to pass some options from the window that is hosting the frame control to the page running in the frame, how I do this?
what I have tried:
I assigned a reference to the tag property of the window. and then in the page onload(), I've tried to access it by using this.parent.tag, but the parent seems to be null.
maybe there is a better way... can anyone help me?
btw, why not create a different message board for .net 3.0 stuff like WPF, WCF, ... ?
thanks in advance,
Niko
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|
|
hi all
i have a form that in shows som html using web browser activex.i want to write some code that search in html and hilight finded text. how i can do this
please help me
|
|
|
|
|
On a multiple monitor workspace,used as a disco ball I have a scrolling display.
The scrolling data is complex so I need to show a 'legend' on each physical monitor.
The scrolling display (WebBrowser with Marquee) is stretched across the VirtualScreen that is composed of 3 or more physical monitors.
Problem
How do I dynamically create a picturebox at runtime? Each picture box will contain an image (.png).
How do I place a common image on each physical monitor. I can calculate the position to put the image but am having trouble figuring out how to get the Picturebox to instantiate at run time
TIA
-- modified at 16:23 Tuesday 23rd January, 2007
-- modified at 16:41 Tuesday 23rd January, 2007
Tom Hamilton
|
|
|
|
|
You can add or remove a Control to a Form programmatically whenever you want;
it basically requires the same kind of code that the Visual Designer creates
when you interactively add a Control. So you could do:
void myButton_Click(object sender, EventArgs e) {
Label label=new Label();
label.Text="my button got clicked";
label.Location=new Point(x, y);
y+=30;
this.Controls.Add(label);
}
The main problem with this kind of code is in positioning the new Controls;
in the example, you need some initial x,y values, and each new Control will be
positioned below the previous one. In the end they are bound to fall of the form...
Luc Pattyn
|
|
|
|
|
Thank you Luc. By setting the Drawing point I can control the location of the control.
Tom Hamilton
|
|
|
|
|
Can i use multiple configuration files within a Windows or ASP.NET application? If yes then how? I tried it but application only reads configuration from a single file.
Thanks.
|
|
|
|
|
Yes you can.You can use the file attribute [^] of the appSettings to specify a relative path to an external file.
|
|
|
|
|
I am working on a C# .NET Winforms project, and I'm stuck on an obscure issue relating to COM and .NET. No one in the company I work at is particularly experienced in COM / .NET interop, and I've already spent too many hours searching books and internet sources for good information on the topic. I was hoping that some person with experience could shed some light on how I should proceed.
Here's the issue:
I am rewriting legacy code that was written in C and C++. The purpose of one piece of legacy code is to display all COM libraries in the registry and allow the user to select the name of the COM library they want and the name of the COM object (in that library) that they want. It then saves information about the COM object (library GUID, interface GUID, and class GUID) of this COM object into a database for further use.
It accomplishes this task by creating an ITypeLib object, which is used to open the library and extract the introspection data from the library. *(note: the COM "introspection" concept is known as "reflection" in .NET)
The System.Runtime.InteropServices.ComTypes namespace (in C#) has an ITypeLib interface (and other interfaces that I need), but I can find no example of anyone implementing this interface in a usable way, and if I knew how to implement that interface to extract the data I need, I wouldn't have a problem in the first place.
Using C#, I can already extract the COM library information I need from the registry (all the library GUID's, descriptions, and full paths), but after that I'm stuck, as I cannot read these libraries for their introspection data.
Does anyone have a clue as to what I need to do next? If so, thanks a lot in advance.
|
|
|
|
|
After a lot of pain and searching, it seems that no one has a class that implements these interfaces in System.Runtime.InteropServices.ComTypes, so for the sake of the project timeline, I'm just going to write my own COM library with a function that does what I want that I will P/Invoke in my C# code (and ignore the ComTypes namespace alltogether).
|
|
|
|
|
Hi,
Im just searching a good class to get info from a Jpeg file without loading it usign c# LoadFromFile,
Anybody knows a good class for it ?
Im asking before trying to write one on my own.
thx in advance
|
|
|
|
|
What's wrong with LoadFromFile?? If you're referring to the fact that it locks the file for the life of the Image object, here's[^] another way to load the file without locking it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thx i knew and im currently using it,
But the problem is than im reading info from about 450.000 images and I dont need to show them just i need to read image headers to get info about size, bitdepth, etc...
|
|
|
|
|
Marcos Hernandez wrote: I dont need to show them just i need to read image headers to get info about size, bitdepth, etc...
Well, the problem with that is some of the information isn't in the headers, but generated from the image data itself. Also, some file formats put metadata in the header of the image data, some at the tail of the image, and still others at both ends.
I don't know of any library that will get you just the metadata without reading the entire image file.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have a class that reads a JPEG file into memory, scans the byte array sequentially,
recognizes the major blocks ("markers") in it and extracts the width, height and pixel depth
from a SOF0/.../SOF15 block. It is 300 lines long, and would need some adaptations
to suit your needs.
When I look at the images from my Olympus camera, the file size typically is 800 KB,
and the metadata you want is located around 16 KB from the start.
If interested send me an e-mail.
Luc Pattyn
|
|
|
|
|
Thanx mate,
Im gonna work today on it,
thanx for your help
|
|
|
|
|
waiting for e-mail, so I can reply with attachment...
Luc Pattyn
|
|
|
|
|
I have created a custom web control and I've added a property that will display a list of given values. I created a enum type and set my enumerators list values, but I can't have any white spaces in my list. How can I show list values that have white spaces using the enum type?
Any suggestions would be appreciated! Thanks in advance.
MVPenn
|
|
|
|
|
You can't. Enums are for your code to understand. Essentially like giving a code-usable name to a value, kind of like a variable. They're not meant for use as a UI element.
What are trying to do with this?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I wanted to show a more "user friendly" description in the listbox on my web control property.
For example:
public enum Diseases { Hepatitis A, Hepatitis B, ...}
public enum fonts {Arial Black, Arial Narrow, Arial, ...}
I'm not sure if I should be using the enum type to populate a list property on a custom web control. Is there a better solution to accomplish this? I'm relatively new to development and would appreciate any suggestions that you might have on this.
Thanks for your response.
MVPenn
|
|
|
|
|
MVPenn wrote: I'm not sure if I should be using the enum type to populate a list property on a custom web control.
Obviously you can't, at least not the way you want to.
MVPenn wrote: Is there a better solution to accomplish this?
The easiest thing that comes to my mind is declaring a simple string array:
public string[] Diseases = new string[] { "Hepatitis A", "Hepatitis B" };
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Try this:
public static string EnumHelper(Enum value)
{
description = value.ToString();
MemberInfo[] mi = value.GetType().GetMember(value.ToString());
if (mi != null && mi.Length > 0)
{
object[] att = mi[0].GetCustomAttributes(typeof(Description), false);
if (att != null && att.Length > 0)
description = ((Description)att[0]).Text;
}
return description;
}
Then, in your enumeration all you need to do is:
public enum Diseases
{
[Description("Hepatitis A")]
HepatitisA,
Eczema,
}
Then, in your code you will do the following:
string hepA = EnumHelper(Diseases.HepatitisA);
This returns Hepatitis A.
string ex = EnumHelper(Diseases.Eczema);
returns Eczema.
I hope this helps.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
MVPenn wrote: public enum Diseases { Hepatitis A, Hepatitis B, ...}
public enum fonts {Arial Black, Arial Narrow, Arial, ...}
In the past I've done something like this:
public enum Diseases { Hepatitis_A, Hepatitis_B, ...}
And when you need to display the "friendly" values just use the String.Replace function to get rid of the underscores.
|
|
|
|