![]() |
| ||
| Creating a VB dll I am researching how to create a dll in VB..can it even be done? Does anyone know of any sites or books that can help me through this process? |
| ||
| Re: Creating a VB dll I'm sure if you google it, there is 1 or 2. The problem is this, though. The dll's that you create with VB are not "true dll's", they are "activeX dll's", and it's sort of complicated, but it has to due with "Entry Points". So, if you need to "up your search" on google, do a search for say: +"visual basic" +"activex dll" on google.... maybe it will come up with something. |
| ||
| Re: Creating a VB dll hi, 1. in vb dlls are created with application type ActiveX dll. (select as new project -->open it) 2. u will get one class window opened. 3. u can write code in this window. 4. in project menu-->refferences add refference to COM+ Serviece Type library. 5. for using with ADO. u need to add microsoft activex data object library 2.5 6. set propertys of class module. instance property - 5- multy use mts transactionmode --> 2 RequiresTransaction 7. write following code (sample) Public Function GetServerDate() As Date On Error GoTo errlbl Dim objCont As COMSVCSLib.ObjectContext Set objCont = GetObjectContext GetServerDate = Date objCont.SetComplete Set objCont = Nothing Exit Function errlbl: ' if we need can add log method here objCont.SetAbort Set objCont = Nothing End Function Public Function GetServerServerTime() As String On Error GoTo errlbl ' { common for every dll Dim objCont As COMSVCSLib.ObjectContext Set objCont = GetObjectContext ''} ''---------------------------- ' general program here. like in class module GetServerServerTime = Time ''----------------------------- ''{ common to dll objCont.SetComplete Set objCont = Nothing ''} Exit Function '{optional} errlbl: ' if we need can add log method here objCont.SetAbort Set objCont = Nothing End Function 8. in project menu --> component tab. select project compatability option(default) (study abt compatability by clicking the help button in this dailog box(u can get info in less time else go for google imp: first time u creating a dll default is correct( new GUID is created, study more abt guid in help. imp2: when u modifing code in dll. select binary compatability) ) click OK. If u r developing dll for 3 tire architecture. u need to select server files check box. 9. then file --> make .dll. 10. open control panel->compnent services console root->comp services-> my computers>com+ applictions right click -> new application ->next-> select create emply application>enter new app name, select library app opt. if not server 3tire app.-> next ->finish 11. u will get a new app name in tree view. click on + right click on components > new > component > next > select install new components > select dll file name > open > next > finish (by drag drop also we can do it, check help for more info) 12. now u will get new dll added in component services explore. -------------- 13. now open standard vb appliction place 2 text boxs, 2 buttons peast following code. Private Sub Command1_Click() Dim obj As Dll_co_common.ClsCommon Set obj = CreateObject("Dll_co_common.ClsCommon") Text1.Text = obj.GetServerServerdate Set obj = Nothing End Sub Private Sub Command2_Click() Dim obj As Dll_co_common.ClsCommon Set obj = CreateObject("Dll_co_common.ClsCommon") Text2Text = obj.GetServerServerTime Set obj = Nothing End Sub 14. add refference to dll. project menu>refferences check new dll file name, if not found browes to add new dll to add to refference list. 15. now run ur client program. u can also develop for database programs also. my suggestion is go throug help in vb(msdn) dailog box, dont spend for more time to search for concept itself. i think it will help u, for atleast starting of dll coding. if it is not enough for ur requirement use keywork from the program to search in online sources enjoy vb programming .... all the best my friend |
| ||
| Re: Creating a VB dll Does anyone know if you can create a non activeX dll, or if an ActiveX dll can be called like a regular dll from a c++ program? |
| ||
| Re: Creating a VB dll Yes, U definitely can. And it is very easy. Just open your project as an active X dll project and you are on your way! Of course you have to be certain what you want to do. |
| ||
| Re: Creating a VB dll Hello I am new to this DLL stuff and I am not able to find the "compnent services" that you have mentioned in the control panel ..could you just tell me if the name has been changed or some thing like that? |
| ||
| Re: Creating a VB dll This depends on the operating system you are using and I believe there is not much difference across systems. I am using windows 2000 adv. server. The component services can be seen after clicking "administrative tools" icon. Component services is one of the icons that is displayed if you look closely.;) Quote:
|
| ||
| Re: Creating a VB dll Yes, Yes my dear:!: That is the power of the ActiveX technology. You can call the activeX dll from c++ like any other dll with the following proviso.
Quote:
|
| ||
| Re: Creating a VB dll Quote:
|
| ||
| Re: Creating a VB dll for using the ---Dim obj As Dll_co_common.ClsCommon ---Set obj = CreateObject("Dll_co_common.ClsCommon") in the code that srikanthvja; had given do we need to add some more reference to the project to make it working I was getting a run time error in the above two lines of code Quote:
|
| All times are GMT -4. The time now is 10:11 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC