how to make dll
-
I made an application with opengl and an application in VB.net and i want to make a dll to call from the VB app the opengl app and change his parameters from there..I know nothing about dlls does anyone can help me giving some steps?I try to make it in VB class library but i can't find how to call my opengl project,and how to change his parameters I am new in programming! Thank you... giotis
-
I made an application with opengl and an application in VB.net and i want to make a dll to call from the VB app the opengl app and change his parameters from there..I know nothing about dlls does anyone can help me giving some steps?I try to make it in VB class library but i can't find how to call my opengl project,and how to change his parameters I am new in programming! Thank you... giotis
giotis82 wrote:
I am new in programming!
Sounds like you're biting off too much at once. I presume the opengl app is in C++ ? If so, your basic problem is, your OpenGL program wants to be an app, not a dll, so that it has a message pump, a window, etc. Then, your VB app is not going to be able to consume this application. The way to talk between VB.NET and C++ is probably C++/CLI. The way to do it from VB6 -> C++ is COM. COM works for VB.NET as well. But if you want a VB app and an OpenGL app, then you don't want a dll, because you're looking for two applications, and not an application that consumes a class library. In this case, WM_COPYDATA is the easiest way to send data between two applications ( google it ). Christian Graus - Microsoft MVP - C++
-
giotis82 wrote:
I am new in programming!
Sounds like you're biting off too much at once. I presume the opengl app is in C++ ? If so, your basic problem is, your OpenGL program wants to be an app, not a dll, so that it has a message pump, a window, etc. Then, your VB app is not going to be able to consume this application. The way to talk between VB.NET and C++ is probably C++/CLI. The way to do it from VB6 -> C++ is COM. COM works for VB.NET as well. But if you want a VB app and an OpenGL app, then you don't want a dll, because you're looking for two applications, and not an application that consumes a class library. In this case, WM_COPYDATA is the easiest way to send data between two applications ( google it ). Christian Graus - Microsoft MVP - C++
Thanks for ur reply,yes the opengl app is in C++ and i use glui libraries!I have 2 more questions, with WM_COPYDATA can i pass parameters in my opengl app, and change my variables values? And the other question is that i try to copy my opengl code with his libraries to a "class library" app but there no response it stuck in all opengl libraries (glut,glu,glui, etc.). Is there any way to remake my opengl program as dll? Thanks for ur response! giotis
-
giotis82 wrote:
I am new in programming!
Sounds like you're biting off too much at once. I presume the opengl app is in C++ ? If so, your basic problem is, your OpenGL program wants to be an app, not a dll, so that it has a message pump, a window, etc. Then, your VB app is not going to be able to consume this application. The way to talk between VB.NET and C++ is probably C++/CLI. The way to do it from VB6 -> C++ is COM. COM works for VB.NET as well. But if you want a VB app and an OpenGL app, then you don't want a dll, because you're looking for two applications, and not an application that consumes a class library. In this case, WM_COPYDATA is the easiest way to send data between two applications ( google it ). Christian Graus - Microsoft MVP - C++
-
Thanks for ur reply,yes the opengl app is in C++ and i use glui libraries!I have 2 more questions, with WM_COPYDATA can i pass parameters in my opengl app, and change my variables values? And the other question is that i try to copy my opengl code with his libraries to a "class library" app but there no response it stuck in all opengl libraries (glut,glu,glui, etc.). Is there any way to remake my opengl program as dll? Thanks for ur response! giotis
giotis82 wrote:
WM_COPYDATA can i pass parameters in my opengl app, and change my variables values?
Yes, and no. WM_COPYDATA is a message you send and recieve. You need to write code on both ends, to send the data, and to parse and use it on the other end. So yes, you can send values to the other application, and use them to set variables. But no, you can't send a message and have it change values without you writing the code to recieve the message on the other end.
giotis82 wrote:
Is there any way to remake my opengl program as dll?
Like I said, if it's a dll, then it's NOT a program, it does not have a window, nor can it be run by itself. I think you should instead use DirectX in VB.NET, if that's an option. Christian Graus - Microsoft MVP - C++
-
I made an application with opengl and an application in VB.net and i want to make a dll to call from the VB app the opengl app and change his parameters from there..I know nothing about dlls does anyone can help me giving some steps?I try to make it in VB class library but i can't find how to call my opengl project,and how to change his parameters I am new in programming! Thank you... giotis
-
giotis82 wrote:
WM_COPYDATA can i pass parameters in my opengl app, and change my variables values?
Yes, and no. WM_COPYDATA is a message you send and recieve. You need to write code on both ends, to send the data, and to parse and use it on the other end. So yes, you can send values to the other application, and use them to set variables. But no, you can't send a message and have it change values without you writing the code to recieve the message on the other end.
giotis82 wrote:
Is there any way to remake my opengl program as dll?
Like I said, if it's a dll, then it's NOT a program, it does not have a window, nor can it be run by itself. I think you should instead use DirectX in VB.NET, if that's an option. Christian Graus - Microsoft MVP - C++
Thanks one more time for ur reply!That's mean that i must stop trying create a dll!Well i try to find an example using WM_COPYDATA but i didn't find something that could help me...Can u send me a simply code to understand it?That will be very helpful for me, as u already know the opengl window created in the "main" function so how it will be my WM_COPYDATA? As i think of what u said i must have a "send" and "receive" to each program. If u have a moment please send me a simply code in my mail "giotis82@mycosmos.gr" or just type it over here!! Thanks u very much for ur time!! giotis
-
Thanks one more time for ur reply!That's mean that i must stop trying create a dll!Well i try to find an example using WM_COPYDATA but i didn't find something that could help me...Can u send me a simply code to understand it?That will be very helpful for me, as u already know the opengl window created in the "main" function so how it will be my WM_COPYDATA? As i think of what u said i must have a "send" and "receive" to each program. If u have a moment please send me a simply code in my mail "giotis82@mycosmos.gr" or just type it over here!! Thanks u very much for ur time!! giotis
http://www.google.com.au/search?hl=en&q=WM_COPYDATA+VB.NET&meta=[^] Christian Graus - Microsoft MVP - C++
-
http://www.google.com.au/search?hl=en&q=WM_COPYDATA+VB.NET&meta=[^] Christian Graus - Microsoft MVP - C++
Well i call my opengl exe with "CWinApp: Shell("ExePath")" it work properly! As i thought the steps will be: 1. the opengl with the Sendmessage will send his variables 2. the VB will receive them 3. the VB will send the new values 4. the opengl will receive them and change each one Am i right? One more question:I have to do my variables global and place the WM_COPYDATA at the end of the main function? Thanks for ur time, u r very helpfull.......... giotis