 |
|
 |
Hi, nice article , still I have a problem , I need to load the dll so that the executable does not lock the file so that after I finish the task i can delete de file . Is there any solution to this. Please note that the assembly is mixed type containing both clr classes and native functions. I wonder why the file needs to be loked .
Thanks.
Signed: Anonymous 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello,
I am trying to load a class from a dll. your article is great and helped a lot but I have a problem.
I have created an abstract class(in an .h file). and Created a class in a dll that inhereted from this abstract class.
In my client (dll loader), I did the CreateInstance stuff and created an object.
My problem is that I cant convert (cast) this object to the abstract class.
Thanks Y.R.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi all,
I have downloaded the glut.h, gult32.dll, glut32.lib and opengl32.dll from the OpenGL.org and the GNU GPL from the GNU.org. I know the above-mentioned materials are working well in the VC++ version 6.0 programs for graphics and mathmatical formulas. I do not know how to bring these .dll and .lib stuff into the mixed programming of Managed C++ and Unmanaged C++ of Microsoft C++.NET (2002) environment to plot 3-Dimensional Mathmatical Objects. Please help and tell me how to use/introduce the OpenGL and GNU programs into the environment of Microsoft Visual C++.NET (2002)/Windows XP Home Edition PC.
Thanks in advance, Scott Chang
Scott Chang
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Just link opengl32.lib and glu32.lib in the propertys dialog of your project and put these includes into your main .h: #include'<'windows.h'>' #include'<'gl/gl.h'>' #include'<'gl/glu.h'>'
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for the nice article. I would like to know, how I can call a new managed C++ DLL from within an unmanaged app. I mean, the existing app is a VC++ 6.0 ap and is going to remain so. However, it si desired to include a functionality that is available in a managed C++ DLL in that app. Is this possible. If so, how would I do that? When I tried to do it, the VC++ 6 compiler started complaining loudly about words like "using" and "__gc" in the header file from the .NET DLL. Any ideas/suggestions will be welcome....
Thanks in advance, (vinod)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Thanks a lot for the very prompt reply!!!! Since COM is probably out of question in my current setup, I guess I will have to stick to either VC++ 6.0 or unmanaged code in .NET. But, THANKS once again....
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello,
I'm just testing the water with managed c++. I tried to get this example to run and had a little trouble.
I made the dll and the .exe, put the .dll in the .exe's debug folder. Ran from the debugger and the MethodInfo *mi object remained null after the t->GetMethod("Hello") method. This made the call mi->Name not work very well...
Thanks so much for any help or suggestions,
Andy
ABrown@TransomaMedical.com
"Do, or do not. There is no try." Yoda
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I found the problem, I'm writing it here so the next person will have the solution here if the same thing happens.
In the dll I put the method definition and implementation in the header file Abc.h (that's where .Net puts it by default). When I removed the file Abc.h (it isn't needed) and put the class definition and implementation in the .cpp file Abc.cpp everything worked fine.
Happy coding!
Andy
ABrown@TransomaMedical.com
"Do, or do not. There is no try." Yoda
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for the info. I did have the same problem and the fix worked. However I'm a bit confused why the fix works. Could someone please explain it?
Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp03122002.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp05162002.asp
this is the answer.
lost my way
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Nish,
Good article. I am currently working on system where classes are generated, compiled and loaded at runtime. Once the assembly is loaded I create an instance of a class from the loaded assembly and invoke the common set of exposed methods in the object instance. So all of this is done without an actual whatever object type ever truly existing in my application...all types are loaded from the satellite assemblies that are loaded at runtime, and whenever an event occurs where a new satellite assembly is generated, compiled, and loaded. The System.Reflection namespace has an abundance of kick arse classes. I would like to see more articles like this one on CP. Practical uses of reflection are always welcome IMHO. cool beans.
-Jacob
Note:
Assembly.LoadFrom allows you to pass a string indicating the actual path to the assembly for runtime loading. So you can avoid by-name assembly loading forcing the assembly to exist in your path.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for the extra info Jacob 
Nish
Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Good article Nish..I am expecting similar good stuff from you(in Managed C++). I actually tried this with VB.NET and C#. It works...
Madhu
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Nish, the one you have shown here is for a managed dll .. how do I load a regular dll and execute functions from a MC++ app. Does this require P/Invoke or some special namespaces. May be you can explain this in another article or update this one.
regards Kannan
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Kannan Kalyanaraman wrote: how do I load a regular dll and execute functions from a MC++ app.
Hmmmm. I haven't tried it out.
Thanks for the idea Kannan
Nish
Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I know of a rather simple way to do it with vanilla C++, you just put an exported function in the DLL that returns a pointer to an instance of the class inside the DLL. This is best implemented by inheriting from an ABC. You also need a function to free an instance of the class (you can't just delete it from outside the function, because the CRT will start screaming about heap curruption) It works like a charm. I implemented it in a plugin system a few months back
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
this almost sounds exactly like what i'm looking for. i have a VC6 app with a plugin system using c++ pure virtual interfaces. however i want to be able to support managed dlls to ease the plugin writing. do you have any suggestions for further reading?
rgds
.dan.g.
AbstractSpoon Software
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
Amita Butch wrote: Nish - remmember Quality not Quantity
Okay! I'll remember that. How many of my articles do you think lack in quality by average internet standards or say average CP standards?
I don't expect every article I write to be of high quality. There are bound to be good ones, and okay ones. I like to think I don't have any outright bad articles. MY belief is that my worst article is still an aveage one on a relative scale. Maybe it's just my ego.
But I hope to improve my articles, not only the ones I am going to write in future, but also the ones I have already written. As my knowledge levels increase I have more to say in my articles. And I am also trying to write things in a simpler way.
Regards and thanks Nish
Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hello Rama
I was in a bad mood by the time I finished the sample program. I didn't use the namespace for the GetType(...) and it kept failing. Then I tried namespace::class and that failed too. It only occured to me to try namespace.class as a last resort. Maybe I am becoming dumber and dumber each day. I finished the article, uploaded it and then went out and smoked 3 cigarattes in quick succession!!!
Nish
Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Nish - Native CPian wrote: Maybe I am becoming dumber and dumber each day. I finished the article, uploaded it and then went out and smoked 3 cigarattes in quick succession!!!
Hmm... they say nicotine helps your memory, but you may want to try a reference card first...
--------
A closed mouth gathers no foot. --Shog9 --
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |