|
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++
|
|
|
|
|
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
|
|
|
|
|
|
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
|
|
|
|
|
I have to mention that my problem is that: if the "VB.NET" user press a button it will appear my opengl form and with a properties menu the user can change some of the grafic sizes.
giotis
|
|
|
|
|
do you want dll to be created in vb.net?
if yes then while selecting new project go for class library
write ur function there, and save it then built it.it will create dll file inside bin directory of ur project folder.
try to be the best... whereever you go,
|
|
|
|
|
Hi All,
Hope someone can help me on this I have written an insert command in VB for a connection to a MySQL database here is the code -
cmdSelect = cnn.CreateCommand
cmdSelect.CommandText = "SELECT Transaction_No, User_ID, Expiry_Date, " & _
"Expiry_Date_Hex, Product_ID, Update_Date, Key_Serial_No, Developer_ID, " & _
"Locking_Code, Unlock_Code FROM KeyIssueDetails"
mda.SelectCommand = cmdSelect
cmdInsert = cnn.CreateCommand
cmdInsert.CommandText = "INSERT INTO KeyIssueDetails(Transaction_No, User_ID, Expiry_Date, Expiry_Date_Hex, Product_ID, Update_Date, Key_Serial_No, Developer_ID, Locking_Code, Unlock_Code) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Transaction_No", Microsoft.Data.Odbc.OdbcType.Int, 0, "Transaction_No"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("User_ID", Microsoft.Data.Odbc.OdbcType.VarChar, 50, "User_ID"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Expiry_Date", Microsoft.Data.Odbc.OdbcType.DateTime, 0, "Expiry_Date"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Expiry_Date_Hex", Microsoft.Data.Odbc.OdbcType.VarChar, 50, "Expiry_Date_Hex"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Product_ID", Microsoft.Data.Odbc.OdbcType.VarChar, 50, "Product_ID"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Update_Date", Microsoft.Data.Odbc.OdbcType.DateTime, 0, "Update_Date"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Key_Serial_No", Microsoft.Data.Odbc.OdbcType.VarChar, 50, "Key_Serial_No"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Developer_ID", Microsoft.Data.Odbc.OdbcType.VarChar, 50, "Developer_ID"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Locking_Code", Microsoft.Data.Odbc.OdbcType.VarChar, 50, "Locking_Code"))
prm = cmdInsert.Parameters.Add(New Microsoft.Data.Odbc.OdbcParameter("Unlock_Code", Microsoft.Data.Odbc.OdbcType.VarChar, 50, "Unlock_Code"))
'
mda.InsertCommand = cmdInsert
prm.SourceVersion = DataRowVersion.Original
prm.Direction = ParameterDirection.Output
mda.Fill(mds, "KeyIssueDetails")
DGMain.DataSource = mds
DGMain.DataMember = "KeyIssueDetails"
My Problem is that the command works fine bar the last parameter. "Unlock_Code" comes back as NULL even though the dataset accepts the data I enter. I am fairly new to this so I may just be missing something obvious but any help would be great I can't figure out where I went wrong.
|
|
|
|
|
hi dear
I m facing a problem.I have devlpoped a dll file in vb.net.now I want to register it.while registration with regsrv32 it gave me message as follows.
"dll file was loaded, but dllRegisterServer entry point was not found.
file can't b registered"
I don'tknow how to solve this error.
please help me......
thank you
be the best...
|
|
|
|
|
hi dear
I m facing a problem.I have devlpoped a dll file in vb.net.now I want to register it.while registration with regsrv32 it gave me message as follows.
"dll file was loaded, but dllRegisterServer entry point was not found.
file can't b registered"
I don'tknow how to solve this error.
please help me......
thank you
be the best...
|
|
|
|
|
For as far as I know it is impossible to register .Net dll's with RegSvr32, its not supported. This should not be a problem when you only use this DLL in other .net projects.
However if you want other projects to use the DLL you can try regasm.exe which allows COM clients to create .NET Framework classes transparently. For more information on this I advice you to read this article on the tool.
|
|
|
|
|
Thanks for ur prompt answer.But I have to use it in ASP coding.and I think without having register it I couldn't use it in asp coding.if u know the way by which i can use this dll in asp coding without registering it tell me pls.and regasm.exe is not there in window xp as it shows error:"window can't find regasm.exe"
Help me pls...........
be the best...
|
|
|
|
|
I take it the .Net framework is installed. This should include the regasm.exe program in its root directory.
The location is usuallay 'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322', though the version number could vary pending on the version you are using.
|
|
|
|
|
how can i use this.I've got regasm.exe.if i double click it just flash once on screen and become unvisible.using command prompt i tryed but same result, tell me the way i should Use.
Thanks n regards
Uttam kumar
be the best...
|
|
|
|
|
Its easy, just open your command prompt and type:
Register: %windir%\Microsoft.Net\Framework\v1.1.4322\RegAsm.exe <library>
Unregister: %windir%\Microsoft.Net\Framework\v1.1.4322\RegAsm.exe /unregister <library>
Replace <library> with the name of the DLL (include the full path)
|
|
|
|
|
Thank you Gerben Jongerious!
I got my Answer.
Thanks a lot.
Uttam Kumar;)
try to be the best... whereever you go,
|
|
|
|
|
hi dear
I have register my dll file on server.but after using it in my asp coding it shows incorrect program id.could u tell me y it is so?
try to be the best... whereever you go,
|
|
|
|
|
Each class in your dll should have its own progid. This will include the full namespace, you can check that by using regasm and exporting to a register file instead of directly into the register. (add /regfile:<dllname>.reg
So if I have a class in the VB.Net DLL called Test in a project called Test1 the full progID name should be Test1.Test and not just Test. However you can set a custom ProgID for each class with the ProgIdAttribute, see MSDN Article for more on that attribute.
|
|
|
|
|
I did so now when i call the function of this class in dll it shows me that
Microsoft VBScript compilation error '800a0414'
Cannot use parentheses when calling a Sub
/uttam/dlltest/test.asp, line 14
myObject.callweb(intvalue,i)
----------------------------^
I used myObject=Server.CreateObject("dllkeysearch.Class1")
where dllkeysearch is dll project name and Class1 is the class name.
try to be the best... whereever you go,
|
|
|
|
|
Dear,
In VB we have Debug.Print() which prints on Immediate window. In VB.Net do we have something which print on Immediate window. Now I am using
Debug.WriteLine() which prints on Output Window. I want debug message to be printed on Immediate window.
Thanking you.
Regards,
Chandan Kumar Gupta.
|
|
|
|
|
There's nothing that targets the Immediate window. All the Debug outputs are sent to the Output window. This has nothing to do with VB itself, rather it's how the Debug class works.
I don't know of any classes that will target the Immediate window.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I am presuming that the adding is going correctly. If that is the case then you can simply use the property SelectedItem or SelectedIndex to select the item in the second listbox.
So an example is:
<br />
lbBox2.Items.Add(lbBox1.SelectedItem)<br />
lbBox2.SelectedItem = lbBox1.SelectedItem
Note that this only works if you put the reference of the first listbox in the second and not a copy.
Hope that this helps you a little bit.
|
|
|
|
|
Hi
I am working on a VB.net application, from which I need to export data to MS Word in a tableformat.I can export the data to MS Word. Now i want to Display it in a table format. Can anyone suggest any ideas for exporting Data to MS word. I couldnt find any helpful topics on net. I need it urgently
Please help..
Thanks in advance...
|
|
|
|
|