|
Hi,
up till now users don't have IP addresses, computers do.
Have a look at Dns class and Dns.GetHostName() method.
|
|
|
|
|
Hi friends i created a System Configurator(C# Win application) which is used to update the File of Our product in Client machine. but now i have a issue that how i can Update System Configurator on Client machine becoz i think that it will also need to be updated.
can any body tell me what the best practice to Overcome this Issue.
wasim khan
|
|
|
|
|
hey guys...
i wana screw around with video an a tv tuner card...
the first obvious step is to get the video in a C# application, can anyone point me in a direction?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
DirectX. TONS of articles here on CP.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
thanx CG
can you recommend an article for a total DX n00b?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
i wanna add sound recorder in Visual Studio
bt not able to do so
any ideas??
|
|
|
|
|
You may want to look in Microsoft.DirectX.DirectSound namespace
Regards
|
|
|
|
|
using System;<br />
<br />
namespace WindowsApplication1<br />
{<br />
public interface a<br />
{<br />
void b();<br />
}<br />
public interface c<br />
{<br />
void b();<br />
}<br />
public class Class1:a,c<br />
{<br />
public Class1()<br />
{<br />
}<br />
#region a Members<br />
<br />
public void d()<br />
{<br />
}<br />
<br />
#endregion<br />
<br />
#region c Members<br />
<br />
public void b()<br />
{<br />
}<br />
<br />
#endregion<br />
}<br />
} compiler is saying ok.
but if i have to definf different data in bath cases.
Then what?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
An interface is like a contract. It only says that for your to be a member of that conract you must have a minimum set of members -Methods & properties-. So a.b() & c.b() are only declarations of a method called b() & they have nothing to do with the implementation. The class is concerned with defining how the method will work. Let's take a clearer example
Interface Author
{
public void WriteAnArticle()
}
Interface Editor
{
public void WriteAnArticle()
}
Class Me : Author, Editor
{
public void WriteAnArticle()
{
}
}
So whether you are an author or an editor you must write an article, but how you write the article is up to you.
Regards
|
|
|
|
|
It would be easier to follow your example if you used some meaningful names, instead of names like a, b, c, d and Class1.
If you want separate implementations for the interfaces, you have to implement the explicitly:
public void a.b() {
// method used when the object is used with an a reference
}
public void c.b() {
// method used when the object is used with a c reference
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,...
My Code is like this
void hooks_MouseDown(object sender, MouseHookEventArgs e)
{
if (e.Button == MouseButtons.Left && this.thisKeyboard.CtrlKeyDown)
{
IHTMLDocument2 htmlDoc = (IHTMLDocument2)((BasketToolBar)this.Tag).WebBrowser.IWebBrowser_Document;
IHTMLElement el = htmlDoc.elementFromPoint(e.X, e.Y);
}
}
Now when i am clicking on any image inside frame i am gatting IHTMLFrameElement not IHTMLImgElement.
How can i get that IHTMLImgElement inside frame.
Kiran Banker
|
|
|
|
|
I am giving answer of my problem.
Solution is as given below.
void hooks_MouseDown(object sender, MouseHookEventArgs e)
{
if (e.Button == MouseButtons.Left && this.thisKeyboard.CtrlKeyDown)
{
IHTMLDocument2 htmlDoc = (IHTMLDocument2)((BasketToolBar)this.Tag).WebBrowser.IWebBrowser_Document;
IHTMLElement el = htmlDoc.elementFromPoint(e.X, e.Y);
if(el.tagName.ToLower().Contains("frame"))
{
HTMLFrameElement frm =(HTMLFrameElement)el;
mshtml.HTMLDocument doc =(HTMLDocumen) ((SHDocVw.IWebBrowser2)frm).Document;
el = doc.elementFromPoint(e.X, e.Y);
}
}
}
Kiran Banker
Kiran Banker
|
|
|
|
|
Hi,
My Application attache on control with Internet Explorer and control has WebBrowser window control.
Now actually we are reading data from any web page and we capturing object and embed tag from that pages.
Now when we put that captured tag in our control it makes it autoplay.
And we want to stop that autoplay.
Code....................
IHTMLDocument2 htmlDoc = (IHTMLDocument2)((BasketToolBar)this.Tag).WebBrowser.IWebBrowser_Document;
IHTMLElement el = htmlDoc.elementFromPoint(e.X, e.Y);
if (el.tagName.Equals("OBJECT"))
{
HTMLObjectElement objEl = (HTMLObjectElement)el;
}
Kiran Banker
|
|
|
|
|
Good Day,
It has always bothered me on how to print on a Pre-Printed Form.
What I mean is, you have a form (For example, a Bio-Data form), then you print directly on the "blanks".
I know that you can programatically fill the blanks by specifying the x-y coordinates of those blanks. But, is there an easier way? Like, you scan the image, then put textboxes on the black and then proceed by txtName.Text = "My Name" then print it without the image?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
I understand you want to print a report based on a form. I'm I right?
The method you want to use -printing the form itself as an image- isn't the best way. There are several articles on this site that explains this -one of them I wrote myself-, but I believe the best practice is using Microsoft Report, or crystal reports. You'll find a Control on the toolbox called MicrosoftReportViewer.
Regards
|
|
|
|
|
Thank you. I'll take additional readings regarding Microsoft Report.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
How much memory do uninitialized arrays take up? EX: int[] numbers;
Do uninitialized value types take space too?
|
|
|
|
|
An uninitialized array is an object with all data set to zero/null, which can be served by
one or more "demand zero" pages, i.e. it gets allocated in the page tables, but does not
require physical memory pages yet.
As soon as some of its data is needed (read or write) a page error will occur, and the MMU
(Memory Management Unit, a hardware part of modern CPUs) will, with the help of some OS code,
allocate physical memory for that page, and then fill it with zeroes.
BTW the page size typically is 4KB
Conclusion: an unitialized array is as expensive as a small object, no more, no less.
Value types are:
[ADDED]
- either local types
- or value members of some other type (such as an int inside a class object).
Local value types are [/ADDED] allocated on the stack, so they consume memory corresponding to their size
(although the stack too is virtual, i.e. if you allocate a huge struct, spanning many pages,
most of these pages again would not be allocated immediately).
There is no such thing as an uninitialized value type, every value type starts of with some
value; typically the language definition and compiler enforce this; example: in a struct
your constructor must assign a value to every member.
modified on Friday, July 4, 2008 10:41 PM
|
|
|
|
|
Hello Luc,
I agree with all what you said except "Value types are allocated on the stack". I believe it depends on the context where they are declared. Local variables goes to the stack, but instance variables will be on heap, AFAIK.
|
|
|
|
|
Hi N a v a n e e t h,
N a v a n e e t h wrote: it depends on the context
yes
N a v a n e e t h wrote: Local variables goes to the stack, but instance variables will be on heap
Not quite. There is no way to get a struct (or any other value type) directly
allocated in the heap.
Local variables are on the stack, value members of a type are located inside that type
(the int inside a class).
Remember:
Rectangle rect; is allocating storage for a Rectangle struct;
rect=new Rectangle(x,y,w,h); is not allocating anything, it is just
assigning values to the members of rect. It is equivalent to rect.X=x; rect.Y=y; ...
|
|
|
|
|
Yeah - Thanks
|
|
|
|
|
Array types are reference types even the element type is a value type. So int[] numbers would take 4KB of memory and will be kept on managed heap.
gigahertz205 wrote: Do uninitialized value types take space too?
Yes. There is nothing like uninitialized value type. Value types always will have a default value. So it takes space needed for keeping that value.
|
|
|
|
|
N a v a n e e t h wrote: So it takes space needed for keeping that value.
Address space sure, memory space only when the MMU page is actually needed.
|
|
|
|
|
Luc Pattyn wrote: memory space only when the MMU page is actually needed.
Yeah, you are correct. I forgot to mention. Thanks for mentioning.
|
|
|
|
|
N a v a n e e t h wrote: So int[] numbers would take 4KB of memory and will be kept on managed heap.
No, it wouldn't. It's just a reference, so it will only take up four bytes (on a 32-bit system) wherever it's declared. If it's a local variable, it will take up four bytes of stack space.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|