I think this method returns an int of the form (x << 16) + y, but you should look it up to be sure. I have not written this in the compiler and am only going from memory, so you need to check to make sure that this works, but the idea is the same. Anyway, I thought that rtb's have a method called "GetCharPos" or something like that... Hope this helps.
Can anyone point me in the direction of some examples of the implementation of the Intel UPnP SDK. According to a post I found Intel haven't released any documentation about it because they consider it to be a support DLL and nothing more.
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
I need to create and Ms-Word addin that will add a footer to all the pages of an open document. I have browsed and got some code.
I have referred MS knowledgebase article and have created an addin, but that code is not adding any button to the commandbar of Word. It did one for outlook. When I made some changes to the code to make it word specific, it still didn't do anything. I have written the following code in OnStartupComplete method:
I have been reading a lot lately about how Interfaces and abstract classes are hallmarks of good C# programming. I admit, they are interesting, but my understanding is very limited as to why one would use either instead of simply creating a reusable class.
I have been programming for a long time, but have never needed either, but I will be the first to admit that much of my code in the past could have been done better.
SoI guess my question is, what circumstances would I use either an interface or an abstract class, and why would this benefit me?
______________________ Mr Griffin, eleventy billion is not a number...
1) A class in c# can derive from one class and can implement as many interfaces as it wants.
2) an abstract class contains abstract methods and normally at least one non-abstract method. They are used if there exists a common behaviour (non-abstract methods) and methods that can only be implemented by derived classes (abstract methods).
3) interfaces are used to define an Interface that means it describes what some object can do.
4) you can look at an interface as a class containing only abstract methods
5) because you can not have multiple inheritance in c#, interfaces are used instead.
A good object oriented base idea is that you always program against an interface and never against a class. This simplifies loose coupling of components a lot as well as it allows the replacement of an instance implementing a certain interface with another (good in testing with mocks for example) or if your code has several strategies to handle something that can be exchanged (strategy pattern).
I'm stopping now, it's going loooong.
no risk no funk ................... please vote ------>
There's also the benefits of using Interfaces as contracts for communication through .NET Remoting.
If the server exposes an Interface, the clients don't have to know the inner workings that's going on on the serverside.
I have some code in C which I need to convert in C#. The very first line of C code is an Include file. So how can I convert this line in C# code or what is the equivalent of this in C#? I have already tried system.math class but I want to convert this particular in C#.
[StructLayout(LayoutKind.Sequential, Size = 16)]
public struct MESSAGE_INFO
public UInt16 _MessageCode;
public UInt16 _ChannelNo;
public UInt16 _Parameter;
Now when i declare pointer to this structure, It throws the error "Cannot take the address or size of a variable of a managed type"
But if i declare "public UInt16 _Parameter" as only "public UInt16 _Parameter" then it compiles perfectly.
Any light on this would be highly appreciated...
Thanx in advance
MSDN[^] says (at the top of the page) that the pointer can point to "Any user-defined struct type that contains fields of unmanaged types only". When you define the field as an array, then it's considered a managed type. When you define it as just a UInt16, then it's considered an unmanaged type (sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, or bool).
Check out my blog at http://tjoe.wordpress.com