It's simple; you do it in source code with the #using directive.
Then, the dll must be in the same directory as your application.
Alternatively, (assuming it has a Type Library) you could run the COM dll through TLBIMP.EXE, creating a .NET assembly, which is even more fun.
And, I think you have to use P/Invoke to use the unmanaged types and methods in your code. This is done with the [DllImport] atribute.
Read this: http://msdn.microsoft.com/msdnmag/issues/03/07/NET/[^]
Veena Katti wrote: But I could not host that control in IE.
Can you provide more details?
What are your security settings in IE for localhost domain ?
Did you check your security settings for the .NET runtime on the computer trying to access the IE hosted control ? (use caspol.exe or .NET Configuration Tool )
hello all..currently i m working on a a program about ping a network n traceroute...im stuck with programming it...im not that sure how to write a program about "ping or traceroute"...i wonder if anione could help me with the source code..
I'm trying to connect from my Managed C++ code to existing Java Code.
My problem is, that i need to link with an unknown java VM.
I tried to use the example from Sun's tutorial of the JNI, but i could not make it work.
I need explicit insturctions on how to make it work.
I would like to wrap an mfc control class (Chris Maunder's MFC Grid control) to be used in C#. Does anyone know of a link to teach me how to do this? I kind of understand the part about wrapping classes, but what about so that it actually displays on the form at runtime and design time.
Forgive me if I sound stupid, but I've only been learning C# for a few days now (since Friday). I think I've got the basics, but I'd like to be able to do this so that I can use the control in C#. Any help is appreciated. Thanks!!
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
You know, until I saw this question, I hadn't read the source for the C Maunder Grid Control. The MFC Grid Control is an impressive body of work (and, I didn't read it all the way through on first reading).
I've never been in a project where you would have to wrap so many disparate types, but, it's probably best not to EVEN TRY to display that monster on a .NET Form.
I'm fairly new to .NET, and, in particular the Interop marshaler, but, I don't think you could wrap the "mfc control class" (because there isn't one). It's not a COM component, and consequently, has no type library. If you wanted to pursue this strategy, you'd have to wrap each individual type that C Maunder uses in his implementation, and marshaling all that data into .NET accurately would surely drive you to (well, what's the worst thing you can imagine?).
Run Time Callable Wrappers are generally for small cohesive units, like classes and interfaces and objects that are type compatible from managed to unmanaged. User defined types often require special custom marshaling routines, and much of this is trial and error.
However, I'll bet Microsoft likes the C Maunder MFC Grid Control (they have spies everywhere), and, I wouldn't be surprised if they have a highly elite team of .NET code fiends working on the advanced version as we forum.
The overriding concern here is: Just how different are MFC and .NET?
I would recommend the book: ".NET and COM: The Complete Interoperability Guide", by Adam Nathan (everything I know, I learned from this book).
To use this control in .NET, you'd have to re-write the entire thing to be compatible with the Common Language Runtime types. I think this would be a very cool commercial project. I wonder if Chris has franchised the concept yet.
Im not reall savvy with the workings of the .NET framework, I know that in the VC++ 5.0 version you can right click on the error and select the error, it'll take you to an error line, and if it drops you at the start, then their was some option somewhere that tells you what each error means.
Its not much, but I hope that helps...
hello. i had this error too. then i had error rc2135 because it could not find my icon. but when i checked my res folder,that icon exists. i do not know what went wrong. i would really appreciate the help. thanks.