| | |
Creating a DLL from an existing VB6 application
Thread Solved |
•
•
Join Date: Apr 2006
Posts: 6
Reputation:
Solved Threads: 0
Hello - I wrote an application to read mag stripe data from a card, parse it and display it's contents. Now I'm attempting to create a DLL out of that logic. I have trimmed down the program to eliminate all those modules, functions, subs etc., that won't be necessary in the DLL. What following is a brief synopsis of the code I currently have.
frmMain.frm
(contains KeyUp and KeyPress functions to process each character read. Also contains AfterCheck which is the response to an event indicating that the last character has been read. It is shown here:
Sub AfterCheck()
cmdDecode 'function in frmMain that parses all the inputted data
'and places it in the Global string IDData
Unload Me
End Sub
I have a .bas module called MainForm.bas which contains the DLL function name to be called by an outside program:
Global IDData As String
Dim ShowForm as New CShowForm
Public Function ID() As String
ShowForm.CShowForm
ID = IDData
End Function
Finally, I have the class module CShowForm.cls:
Public Function CShowForm()
frmMain.Show vbModal
End Function
That's basically to total amount of code. When I initiate the package and deployment wizard, I get the following error message:
In order to proceed, the wizard requires the executable file 'identifier.dll' for this project (THIS IS THE FILE I'M TRYING TO CREATE IN THE FIRST PLACE!). Click browse to find the file or compile to compile the project.
I select COMPILE and I get the following error:
Unexpected error number 800004005 has occurred. Automation error. Unspecified error.
Anyone have any ideas?
Thanks, George
frmMain.frm
(contains KeyUp and KeyPress functions to process each character read. Also contains AfterCheck which is the response to an event indicating that the last character has been read. It is shown here:
Sub AfterCheck()
cmdDecode 'function in frmMain that parses all the inputted data
'and places it in the Global string IDData
Unload Me
End Sub
I have a .bas module called MainForm.bas which contains the DLL function name to be called by an outside program:
Global IDData As String
Dim ShowForm as New CShowForm
Public Function ID() As String
ShowForm.CShowForm
ID = IDData
End Function
Finally, I have the class module CShowForm.cls:
Public Function CShowForm()
frmMain.Show vbModal
End Function
That's basically to total amount of code. When I initiate the package and deployment wizard, I get the following error message:
In order to proceed, the wizard requires the executable file 'identifier.dll' for this project (THIS IS THE FILE I'M TRYING TO CREATE IN THE FIRST PLACE!). Click browse to find the file or compile to compile the project.
I select COMPILE and I get the following error:
Unexpected error number 800004005 has occurred. Automation error. Unspecified error.
Anyone have any ideas?
Thanks, George
Did you start your project as a VB EXE project or Active X DLL??
Gabriel Villa
software development/ IT support consultant
software development/ IT support consultant
•
•
Join Date: Apr 2006
Posts: 6
Reputation:
Solved Threads: 0
Thanks for your help but I've solved the problem. It seems if you select "Make *.dll" under "File" in the VB IDE, it creates the DLL. All that is then necessary is to register the DLL with the calling routine by checking its box under "References" under "Project". I now have the DLL working properly. Plus, I'm not using a Declare statement which none of my six VB6 books makes any mention of and two of those are Microsoft VB6 books!!
Thanks again for your help. If you would like to see how the DLL and the caller work, I'll be happy to post the code.
Let me know.
Thanks, George
Thanks again for your help. If you would like to see how the DLL and the caller work, I'll be happy to post the code.
Let me know.
Thanks, George
Right on. There are two types of .dll's. A "Real" dll, which has an entry point, and usually doesn't have any dependencies... and an ActiveX Dll. The declare statement is used to reference a function that is in a "Real" DLL, while going to "project/references" and adding a references to a DLL works only for ActiveX Dll's. So, to my knowledge, you actually can't use the declare statement on an ActiveX dll.....
Since you found the solution, however, I'm going to go ahead and mark this thread as solved.
Since you found the solution, however, I'm going to go ahead and mark this thread as solved.
Last edited by Comatose; Aug 22nd, 2006 at 7:46 pm.
![]() |
Similar Threads
- Creating a VB dll (Visual Basic 4 / 5 / 6)
- Javascript/VBScript within VB6 application (Visual Basic 4 / 5 / 6)
- Error while running VB6 application with Oracle on Windows XP SP2 (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Javascript/VBScript within VB6 application
- Next Thread: VB and MySQL - a possibility ?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






