|
I want to get the list of direct interfaces of a class the method Type.GetInterfaces
retrieve all interfaces in the hierarchy and it doesn't accept an BindingFlag parameter like GetMethods.
How can I do it?
|
|
|
|
|
I think you can't do that, because with interfaces there are no real hierarchies as with classes.
If a class implements an interface that extends another interface then the class implements both directly.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Just a note ... you don't inherit Interfaces, you impliment them
An interface is a definition. You impliment definitions, but inherit implimentations.
|
|
|
|
|
Hi all,
I'm now study the vista sidebar programming, and I wanna do sth when my gadget closed or sidebar closed. I found nothing in the .net framework to catch th gadget closed or sidebar closed event, anyone knows how to make this?? Or any idea???
Thanks!!
|
|
|
|
|
You will probably need to look at the Windows Vista (Win32) API and use P/Invoke calls and/or handle the WndProc messages your self.
|
|
|
|
|
I wrote COM object in VC++ 6.0, and I tried to send a meanful exception to client.
So I tried to use IErrorInfo interface.
I implement the interface in such a way:
class ATL_NO_VTABLE CPAMServer :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CPAMServer, &CLSID_PAMServer>,
public IDispatchImpl<IPAMServer, &IID_IPAMServer, &LIBID_PrivilegeAttributesManager>,
public IDispatchImpl<IErrorInfo, &IID_IErrorInfo, &LIBID_PrivilegeAttributesManager>
and in a function of a com object wrote such a code:
CComObject<CPAMServer> *pTemp;
CComObject<CPAMServer>::CreateInstance(&pTemp);
pTemp->AddRef();
SetErrorInfo(0, pTemp);
return -5;
And when I call the method in My .NET code I got a COMException with code -5. The point is that the thrown exception not only doesn't contain the ierrorinfo object, but also it does not in a manner with http://msdn2.microsoft.com/en-us/library/9ztbc5s1.aspx
I also have searched some to change the way of unmarshaling of exceptions using MarshalAs or something like that but nothing has found. Can anyone help me with the method of getting ierrorinfo object in the managed code?
|
|
|
|
|
Hi all,
As with ascii character we can increment alphabet by increment ascii value of it (Like ch='H' and ch = ch + 1 gives me ch='I'). IS it pobbiel to do the same for Unicode character? I wan to increment Unicode character in VB.NET.
Thanks in advance
Priyank
|
|
|
|
|
As both the letters found in the alphabet and the individual order of the characters is not a universal constant you can't universily say you can do this in Unicode nor ASCII.
If the task is more specific to convert the characters a-z as typically defined in a US/UK alphabet, then yes - you can do it in both Unicode and ASCII. The first 127 character points in Unicode match the 127 characters of ASCII.
|
|
|
|
|
Can anybody tell me how to convert a .msg file to .eml file.using a .net component or some .net / COM libary.
Thanks in advance.
|
|
|
|
|
Do not use the word 'Urgent' in your subject title. It is considered rude around here. As far as your problem goes, look at the structure of the .msg file and compare to a .eml file and see what you can do, if anything at all about it.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
My .NET application uses a PrintPreviewControl to show the user the report before printing. But I need to extend it, to allow drill-down, etc. But PrintPreviewControl is a black-box control with no ability to be modified. So I will need to write my own.
But I can't be the first person to need this, there must be source code available for a PrintPreviewControl somewhere that I could use. I would be happy to pay for it, I bought one supposed version, but it was just a useless wrapper for the .NET version. If anyone knows where I can get an open PrintPreviewControl to use, I would appreciate it.
|
|
|
|
|
|
Thanks. I had found them in my earlier search, but had difficulty communicating with them. Have you actually used their product? Thanks.
|
|
|
|
|
I've used it as part of their reporting suite - it's very good. Plus, you can get the source code so you can do with it what you want.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks, I appreciate it. I already have an email into them for clarification.
|
|
|
|
|
I have an abstract class, like so:
abstract class BaseClass
{
protected int m_n1;
protected string m_s1;
protected string m_s2;
public BaseClass(int n1, string s1, string s2)
{
m_n1 = n1;
m_s1 = s1;
m_s2 = s2;
}
protected abstract void MyFunction();
}
I'm trying to derive from it like this:
public class MyClass: BaseClass
{
public MyClass(int n1, string s1, string s2) : base(n1, s1, s2)
{
}
protected override void MyFunction()
{
}
}
The compiler is telling me this
<code>No overload for method 'BaseClass' takes '3' arguments</code>
What am I doing wrong?
-- modified at 15:20 Wednesday 29th August, 2007
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Well - apart from anything else, the code doesn't build. If you can't compile up BaseClass the compiler can't match up the base call. You need to change your reference to s1 to m_s1 in the member declaration.
protected string m_s1;
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Well, the examples I gave are simple that - examples. The code I'm working on does compile except for the error I've mentioned which has nothing to do with data members. I did "fix" that, but as I said, that's not the problem in the actual code.
Another thing I've noticed... Intellisense doesn't present me with a list of parameters when I type :base( .
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Then post the definition of the classes (down to constructor level only).
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Look at my modified response that you just replied to (about intellisense).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi John,
please don't modify the original messages without a trace, it makes it
impossible to understand the chronology of the thread.
if Intellisense does not show you either did something wrong (like missing a
file in a project) or VS just got confused; so I would suggest you try deleting
the bin and obj folder(s) (except for your own additions to them), close and
reopen VS, and rebuild all.
What's your VS version?
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: please don't modify the original messages without a trace, it makes it
impossible to understand the chronology of the thread.
If you read the thread, you'll understand the chronology. I simpky forgot to put a m_ in front of a variable name.
Luc Pattyn wrote: f Intellisense does not show you either did something wrong (like missing a
file in a project)
Not that I can see - the line class MyClass: BaseClass is correctly syntax highlighted, so I know it sees BaseClass .
Luc Pattyn wrote: so I would suggest you try deleting
the bin and obj folder(s) (except for your own additions to them), close and
reopen VS, and rebuild all
Already did all that - intellisense still doesn't show the parameter list, and the compiler still chokes and claims there's no overloaded member with the correct number of arguments.
As you can see by the code posted in the original message, there doesn't appear to be anything wrong.
I've tried changing the base constructor to be protected
I've tried adding a default constructor.
I've even tried adding :this() to the constructor in the base class.
I'm out of ideas.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Could it be that the derived class is in a namespace and the base class isn't?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Nope - that shouldn't affect it. Without actually seeing the code we're really shooting in the dark with this. Some things to look at though:
The accessibility level of the constructor shouldn't be an issue if the base class has a protected constructor.
If the base class is in a separate project, try building that project on its own - problems compiling that project will have an effect on the derived class (which means that you will see the issue with Intellisense not picking the definition up).
A silly one, and one I suspect you've already ruled out - the parameters must be the correct types between the call to base and the constructor in the base class.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Check out the last message in this thread. :/
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|