|
You can mark the good answer.
I Love KongFu~
|
|
|
|
|
Salut,
Je viens de reprendre un projet dans lequel je fais appel à une DLL fournie par un client.
Le référencement a été fait. Je programme en C# et j'ai deux PC's avec visual studio 2005. Le premier est en XP pro. Pas de problème avec le référencement et tout fonctionne à merveille. L'autre, un laptop sous Vista Business. Sur ce dernier : le même projet me met des "warnings" pour l'interop. Comment solutionner cela ?
Merci de votre aide
Benoit
|
|
|
|
|
Parlez Anglais, if you desire an answer
I are troll
|
|
|
|
|
First like Eddy said: english only here.
Second from what I can understand (my French isn't perfect), you are getting errors on a vista pc where you don't get them on XP.
What errors.?
What does the program do (at the time of the errors)?
My first thought would be that this is a UAC problem but without more explanation (in English) I can't be sure.
|
|
|
|
|
Il serait intéressant de voir les "warnings" en question, ça pourrait aider. Aussi, une fois compilé, est-ce que le projet fonctionne quand même?
|
|
|
|
|
Thanks for all to reply so fast.
I'll rewrite it in english...
So, I'm C# Programmer and in my project I received from our client a DLL. When I develop on Visual Studio on XP all is working without any problem. If I check the reference, the Name and the Path are filled in and no exclamation point on this.
I copied all the project on my laptop to work home
a) I have an error message on my 'using myDll' in the begin of my class.
b) secondly, on the dll (when I check my references) I see an yellow exlamation mark.
When I use the program in the bin/debug myProgram.exe, I receive a message :" value type cannot be null" only when I use it on vista. On XP, no problem at all.
Thanks for your help
Benoit
|
|
|
|
|
Hi Benoit,
the yellow exclamation mark means that the assembly you are referencing is missing. What kind of assembly is it (sth. in the GAC or a third-party component, you added by browsing)?
Just a suggestion from my side:
For 3rd party components i normally add a folder called "Library" to my project where I put all needed assemblies (add by choosing "add existing element"). Then I add the reference to the assembly by browsing to this library folder. This works well with source control etc.
Regards
Sebastian
|
|
|
|
|
halleuxb wrote: on the dll (when I check my references) I see an yellow exlamation mark.
That means that the reference points to a file that doesn't exist.
Remove the reference and add it again.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I removed it and place a new one ... on vista, no good effect.
On XP, when I use the
private System.Type oType = System.Type.GetTypeFromProgID("SECUREXVIL.SECVIL");
I see in oType : Name = "__ComObject", FullName = "System.__ComObject"
On Vista, the same code : oType : NULL
Is it in my code or a problem with Vista configuration ?
Best regards,
|
|
|
|
|
This isn't due to using Vista or XP (or 2000, for that matter). Visual Studio tries to locate your third-party dll when you compile. This dll is probably in a different location on your Vista-machine. Ergo, Visual Studio looks for the dll as you specified on your XP-machine - and it's not there on your Vista-machine.
Go to the solution-explorer in Visual Studio, open the "references" branch and remove the reference to the dll. Next, add the reference anew (browse to your dll) and recompile on your Vista-machine.
Things should be fine now
--edit--
This is the same answer you received from Guffa, I just used more words to explain the same thing.
I are troll
|
|
|
|
|
ENGLISH SITE.
"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
|
|
|
|
|
Hello All,
I am about to create a custom windowing system for both native C++ and fully managed .NET applications (plus perhaps non-Windows platforms as well). Although some aspects of the code, such as rendering routines, are environment-dependent and must be rewritten, there are certain immutable elements, such as behavior of common controls (e.g. reaction of a button or an edit control to user's input, or logical events that these controls can fire, such as "Clicked" in a button, or "TextChanged" in an edit control).
Therefore, I would like to code these reusable parts only once.
I know one solution would be to implement them in C++ and then wrap them up in a C++/CLI managed assembly. However, the managed interface must be written in order to reflect all events, methods and properties from the C++ implementation to .NET. That forces me to add each new event or property in two places: one in the C++ part, and another one in the C++/CLI interface, which is something I don't want.
Considering I have my own RTTI implementation in my native C++ library, would it be feasible to automatically generate required .NET wrappers?
Note that I would like to use the library with comparable ease in both C++ and C#. If I got a std::string EditBox::Text in C++, there must be a string EditBox.Text
in C# (and not a System.Runtime.InteropServices.Marshal.GetMyDamnedString(IntPtr(EditBox.Tag).ToPointer()) , nor any similarly beautiful construct).
That's quite an architectural question, but I didn't want to crosspost - that's why it ended up here.
|
|
|
|
|
Hello,
the common codebase of C++ and C# is C language.
So, code the oldie-goldie and forget the fancy-sissies-object-oriented-paradigms.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi, thanks for your voice.
My question was rather on how to automatically generate .NET wrappers for an existing native C++ code (or code the C++ core logic in a way that it can be easily reused with .NET, without manual reflection of each change).
Perhaps I might use C++/CLI-based tool to convert my own existing RTTI to the .NET Reflection, and compile the generated .NET classes into a new managed assembly?
What do you people think?
|
|
|
|
|
My question is: Why should you do that?
Cannot you live happy with a fully managed solution?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Not in this case. Although most of my projects are fully managed, I would also like to use this particular library for certain time-critical applications written in native C++, whose performance might suffer from .NET boxing.
|
|
|
|
|
Performance and interoperability are often on opposite sides, hence I suppose your task will be hard: Good luck.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i just want i full code to how i export any datagridview into a csv filein windows applications.i need it immidiatlly
rana sallam
|
|
|
|
|
rana_cisco wrote: need it immidiatlly
+5 kudo's for asking nicely.
I are troll
|
|
|
|
|
rana_cisco wrote: i need it immidiatlly
really?
Tan Li
I Love KongFu~
|
|
|
|
|
rana_cisco wrote: i need it immidiatlly
..along with a dictionary and lessons in manners. The idea is YOU try and write the code and get help on specific problems.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello everyone,
1.
Here is one of the field of my class. During deserialization, if the counter attribute is null, the deserialization could still be successful. Any ideas to make deserialization be smarter to treat counter as a non-null (must to have value) attribute?
2.
Any other ways to make deserialization be even smarter to treat counter as an integer other than string? (i.e. if in the XML file, counter attribute is assigned to non-numeric value, deserialization will fail.)
[XmlAttribute("counter")]
public string counter;
thanks in advance,
George
|
|
|
|
|
George_George wrote: Any other ways to make deserialization be even smarter to treat counter as an integer other than string?
Why not just make the counter field an integer in the first place?
|
|
|
|
|
Thanks Colin,
I have tried but still InvalidOperationException, the exception message is "There is an error in XML document (1, 14)."
Here is my code, any ideas?
using System;
using System.ComponentModel;
using System.IO;
using System.Xml.Serialization;
public class Bar
{
[XmlAttribute(DataType = "int", AttributeName = "counter")]
[System.ComponentModel.DefaultValueAttribute(0)]
public int counter;
}
static class Program
{
static void Main()
{
Bar a = Read(@"<Bar counter=10/>");
return;
}
static Bar Read(string xml)
{
Bar bar = (Bar)new XmlSerializer(typeof(Bar)).Deserialize(new StringReader(xml));
return bar;
}
}
regards,
George
|
|
|
|
|
iam not able to cut,copy,paste a usercontrol(picturebox) on a form.As such there is no buitin cut,copy,paste property for a picturebox.
i want code to add cut,copy,paste property for a picturebox control on the form design at runtime in vc#.net.
Please let me know how to add a property for the usercontrol . or let me know if u need any more details regarding this.
shabana
|
|
|
|