|
When my post build event runs I get this message
Error 1 The command "copy bin\Debug\plugin.dll C:\Program Files\SomeApp\Plugins" exited with code 1.
If i open an elevated commandline at the project folder I can execute the command perfectly well.
I'm running VS2005 as admin and i need to copy my plugin to the apps plugins folder inorder to run it. This isn't my app, it's an app I'm integrating with so I can't change the location of the plug-ins folder.
Any Ideas?
Thanks
Russell
|
|
|
|
|
Doesn't really have to do anything with C#, does it?
Anyway, you should start reading about UAC under Vista. You'll learn (among other things) that even running an application while logged in as admin won't give you the same access rights XP gave you.
You could try running VS with elevated rights or turn off UAC completely.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
i guess it's got very little to do with c#, it would probably be better in the Vista forum but i thought it was a problem that other c# developers might be running up against so i posted it here.
I am running the VS IDE as Administrator rather than running it when logged in as administrator. I've been fighting battles with UAC for a while now and I thought I had a handle on it but this seems really confusing, i'm not even 100% sure if it is an issue with UAC.
Russell
|
|
|
|
|
Experts,
I want to implement some COM interfaces in C#, and these interface will be called by a DLL written by ATL. The COM interface definations are :
__interface IDataRelation : IUnknown
{
...
HRESULT GetData(
[in] long Item,
[in] REFIID riid,
[out, iid_is(riid), retval] void **Data);
}
__interface IArray : IUnknown
{
...
}
__interface INumber : IArray
{
....
HRESULT GetUnits([out, retval] BSTR *Units);
}
__interface IDoubleNumber : INumber
{
...
}
The native code will call IDataRelation.GetData() to get the pointer of INumber to get the data unit.
I rewrite the interfaces in C#
[ComImport, Guid(XXX), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IArray {...}
[ComImport, Guid(XXX), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface INumber : IArray
{
...
[Return : MarshalAs(UnmanagedType.BSTR)]
string GetUnit();
}
[ComImport, Guid(XXX), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDoubleNumber : INumber {...}
[ComImport, Guid(XXX), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDataRelation
{
[Return : MarshalAs(UnmanagedType.Interface)]
object GetData(
[In, MarshalAs(UnmanagedType.I4)]
int Item,
[In, MarshalAs(UnmanagedType.Struct)]
ref Guid riid);
}
Then I construct two classes to implement these interfaces.
public class ArrayBase : IArray, INumber, IDoubleNumber
{
string INumber.GetUnit()
{
return m_Unit;
}
}
public class Data : ArrayBase, IDataRelatin
{
...
public object GetData(int Item, ref Guid riid);
{
return this;
}
}
Every thing seems fine, IDataRelation can be retrived in the C++ code.
CComQIPtr<idatarelation> pRelation = GetDataRelation(...); //Get data relation
if(pRelation != NULL)
{
CComQIPtr<inumber> testNumber;
pRelation->GetData(0, UUIDOF(INumber), reinterpret_cast<void**>( &testNumber ));
if(testNumber != NULL)
{
CComBSTR m_DataUnit;
testNumber->GetUnit(&m_DataUnit); //Error !!!
}
}
When I call GetUnit, a strange error occured, see the following detail :
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
The ATL DLL is used to display a chart. I use it in my C# project. The above interfaces are its
data source interface. I just want to implement these interfaces to supply my own data source for
it. My project is not a COM server and not COM visible.
The ATL DLL is written years ago, but only used by other C++ projects and have no problem, I can't change anything.
I haved searched for the above error solution, but got nothing.
Now, Any idea?
-- modified at 5:01 Thursday 6th September, 2007
c++ : my dream
|
|
|
|
|
Hy
Can anybody tell me how can I set the position of the keyboard (not mouse) cursor in a RichTextBox.
thanks
|
|
|
|
|
Hi!
A quick glance at the basic documentation of the RichTextBox will tell you that the SelectionStart and SelectionLength property or the Select() method will achieve this.
That's what documentation is there for...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi All,
Will anyone help in opening a View which is having its own Interface and Presenter. I want to open this view from base presenter in ModalWindow style. the code which i am having throws error "Object reference not set to an instance" in this line of code "WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(ObjMailLeft);". I need a sample application so that i can understand better..
Thanks in advance
Umashanker.K
|
|
|
|
|
Hi coder,
I am facing an problem with my application, which is using As access database as an back end.
when i am running the application after istalling to system it throws an exception of OLEDB 4.0 not registered on your local system
Please suggest me what to do.
If i need to istall the driver than plz if possible give me link for the same
Thanks in advance.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
Googling this problem brought lots[^] of results. Why didn't you try it first?
With a couple of clicks I found this[^]. Seriously, if you want to become a professional problem you will have to learn how to solve problems like this yourself.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi thanks fo rthe reply.
I have alresdy googled lot but failed to resolve.
i also installed latest service pack for the OS but again facing prob.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
Hi,
Why din't Microsoft include Multile inheritance in C#? This was asked to me by an interviewer, I couldn't answer this properly.
The guy said there was some reason why they din't include multiple inheritance, which he din't tell me.
Regards,
Blumen
|
|
|
|
|
Because designers of C# decided that advantages don't outweight disadvantages (e.g complexity).
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Multiple inheritance is one of those really contentious issues with advocates on both sides arguing that they have the only right answer. Anyway - Anders Hejlberg decided against it (partly because .NET doesn't natively support MI - although Eifell.NET has included the ability to use MI), but his position does seem to be changing on this issue.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: partly because .NET doesn't natively support MI
Im sure I read recently that the framework does support MI, but the implementation of it raises its own quirks... so they left it out until they decide exactly how it should be implemented. The same article talked about mixins as a possible alternative. Personally I hate both MI and mixins.
Sorry I don't have a link to the article, I'll trawl through my history and see if I can find it.
|
|
|
|
|
thanks to all you guys, but what should i tell the interviewer?
Possible answers I got by posting this question:
1. Its complex if its implemented
2. More disadvantages than advantages
3. .NET doesnt natively support MI
4. implementing MI creates problems
If you were asking me this question in an interview, what answer would you expect Jamie?
Regards,
Blumen
|
|
|
|
|
If I was asking you this question in an interview i'd be an idiot. Not only is it totally irrelevant to day-to-day programming but it sounds as if this guy is either
a) A C++ evangelist who is trying to have a bash at c#'s "lack of MI"
b) An idiot who has heard a buzzword and is trying to look intelligent.
Try asking him why he thinks that MI is relevant to the job and watch him either give a tirade about how wonderful MI is (a) or splutters and changes the subject (b).
|
|
|
|
|
Amen to that.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
This is a meta-question. At best the people responsible for the C# definition can answer
this; everyone else can only guess. Whoever asks this does not intend to be called an idiot,
he intends to observe the interviewee's reaction. Not every question is about knowledge...
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
|
|
|
|
|
May be he was not a idiot afterall, he just din't want me in his team coz they were looking for a person with more experience.
hmm, anyway I always feel like asking the interviewer answers to his questions but I back off thinking that most of them don't like to be questioned!
|
|
|
|
|
I think none of the answers is really convincing. Maybe you should answer that we cannot know the motivation of the guys not to include it. Simplicity and avoiding errors might be an argument. On the other hand C# is not a simple language. It includes many complex and new features.
If you have the feeling the interviewer is not a fan of multiple inheritance you might say MI is an interesting idea, but you do not really need it in practical situations.
Rudolf Heijink
|
|
|
|
|
Hi Rudolf,
I told him it would make the language complex, but then he started asking "how complex"? I am new to C# and programming as a whole, and I dint know how complex it would make the language.
This is my experience in an interview where people don't want to ask you obvious questions. I used to google for interview questions and appear for the interview, but I failed miserably two times. I feel bad when I think about these interviews.
I want to dig deep in to topics, but when I start asking why (mostly to Google) something is done this way in .NET framework, rarely do I get good answers (articles/posts). How do you find answers to your questions, how do you get knowledgable?
Regards,
Blumen
|
|
|
|
|
blumenhause wrote: How do you find answers to your questions, how do you get knowledgable?
There are a lot of different ways:
- Reading books
- On your own investigating - write some code, see what it does and how it behaves
- Using tools like Reflector to see what/how the base class libraries do things
- Ask questions of people that have more experience and/or are more knowlegeable than you on a particular topic.
Since you are new to programming and C# (and also, it appears, to technical interviews), the thing to remember is this:
There are two types of interviewers: The kind that wants to show off how much he/she knows and the kind that wants to know how much you know and how you react to difficult/challenging questions.
The first type of interviewer is difficult to deal with at best as they tend to ask the "impossible" questions and drill into topics that are intentionally hard. The goal is to show you how smart they are and doesn't really help anybody.
The second type of interviewer will also ask difficult questions, but the entire interview won't consist of them. This is the person that will ask a mixture of easy to hard questions to try and understand how much you know on a particular topic and what your problem solving skills are.
Even after 15 years of experience I have been on interviews where I was asked a question that stumped me. It's always OK to say you don't know rather than trying to guess and get it wrong.
|
|
|
|
|
Thank you Scott, that was really informative.
Regards,
Blumen
|
|
|
|
|
blumenhause wrote: Why din't Microsoft include Multile inheritance in C#?
Very likely to ensure that developers don't encounter the diamond problem[^].
/ravi
|
|
|
|
|
Hedging their bets; it's easier to add it in later than to remove it.
|
|
|
|