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

Recommended Answers

All 5 Replies

Did you start your project as a VB EXE project or Active X DLL??

Yes, the project was started as an ActiveX DLL

Does it compile though the IDE (without the use of the package and deployment wizard)?

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.