944,081 Members | Top Members by Rank

Ad:
Aug 21st, 2006
0

Creating a DLL from an existing VB6 application

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
George Jump is offline Offline
6 posts
since Apr 2006
Aug 21st, 2006
0

Re: Creating a DLL from an existing VB6 application

Did you start your project as a VB EXE project or Active X DLL??
Reputation Points: 8
Solved Threads: 6
Posting Whiz in Training
extofer is offline Offline
239 posts
since Aug 2005
Aug 22nd, 2006
0

Re: Creating a DLL from an existing VB6 application

Yes, the project was started as an ActiveX DLL
Reputation Points: 10
Solved Threads: 0
Newbie Poster
George Jump is offline Offline
6 posts
since Apr 2006
Aug 22nd, 2006
0

Re: Creating a DLL from an existing VB6 application

Does it compile though the IDE (without the use of the package and deployment wizard)?
Last edited by Comatose; Aug 22nd, 2006 at 5:08 pm.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Aug 22nd, 2006
0

Re: Creating a DLL from an existing VB6 application

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
George Jump is offline Offline
6 posts
since Apr 2006
Aug 22nd, 2006
0

Re: Creating a DLL from an existing VB6 application

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.
Last edited by Comatose; Aug 22nd, 2006 at 7:46 pm.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Javascript/VBScript within VB6 application
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB and MySQL - a possibility ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC