943,704 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Jun 2nd, 2009
0

Can't open "DLL" File

Expand Post »
Hi,

Could you please show me where my error is?
I have created one "DLL" file by myself. Then, I want to reuse it in another project, but the system prompt error message whenever I call that "DLL" function.

I created "DLL" with "ActiveXDll". The following is my dll code.

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Function Adding2(ByVal x As Integer, ByVal y As Integer) As Integer
  2. Adding = x + y
  3. End Function

After compiling, I get "project.dll". Finally, I declare this dll's function as below.

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Declare Function Adding2 Lib "project1.dll" (ByVal x As Integer, ByVal y As Integer) As Integer

Error, run time error "53", is "File not found".

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. Label1.Caption = Adding2(5, 4)
  3. End Sub

if I declare as
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Declare Function Adding2 Lib "C:\Documents and Settings\Zawpai\Desktop\test extsiting file 3\project1.dll" (ByVal x As Integer, ByVal y As Integer) As Integer
, it shows "run time error 453". can't find dll entry point.

How should I solve above problem? Please give me some suggestion.

regards,
zawpai
Similar Threads
Reputation Points: 7
Solved Threads: 0
Junior Poster in Training
zawpai is offline Offline
99 posts
since Oct 2007
Jun 2nd, 2009
0

Re: Can't open "DLL" File

Okay, did you move your project.dll into the same folder as your new project that wants to call it or did you move the project dll to the \windows\system32\ directory? Did you register the dll?

Good Luck
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Jun 3rd, 2009
0

Re: Can't open "DLL" File

Hi vb5prgrmr,

Yes, I copy dll file in the same folder.

did you move the project dll to the \windows\system32\ directory?
yes, I put the dll in system32.

Did you register the dll?
Yes, I did.

Would you like to run my sample program?

Anyone can me?

regards,
zawpai
Reputation Points: 7
Solved Threads: 0
Junior Poster in Training
zawpai is offline Offline
99 posts
since Oct 2007
Jun 3rd, 2009
0

Re: Can't open "DLL" File

Hi,

First Open a New Project, Goto References, Browse and add the Dll, from the list (Project1.dll)
And Declare like this :

Dim TempCls As New Project1.MyClass
Text1.Text = TempCls.Adding2(4, 10)

The procedure you have declared is for WIN API's..


Regards
Veena
Last edited by QVeen72; Jun 3rd, 2009 at 2:48 am.
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jun 3rd, 2009
0

Re: Can't open "DLL" File

Hi,

Also, I noticed, there is a problem in your function:

Public Function Adding2(ByVal x As Integer, ByVal y As Integer) As Integer
'Adding = x + y
' Above line has to be name of function
Adding2 = x + y
End Function

Regards
Veena
Last edited by QVeen72; Jun 3rd, 2009 at 2:57 am.
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jun 3rd, 2009
0

Re: Can't open "DLL" File

Hi QVeen72,

Thank you for your help. Now, my coding is running well.

May I ask you another question?
Why some dll files don't need to do "browse" and "add"?

I saw they only need to declare function prototype and the function of dll flie can be used directly. Their coding also doesn't need to create as object type. They only put their dll file in the same folder.

Where is the difference with our method?

For my understanding is that I create dll as class type. So, we have to declare as object type before we use its function. Then, we also don't need to declare function prototype.

regards,
zawpai
Reputation Points: 7
Solved Threads: 0
Junior Poster in Training
zawpai is offline Offline
99 posts
since Oct 2007
Jun 3rd, 2009
0

Re: Can't open "DLL" File

Click to Expand / Collapse  Quote originally posted by zawpai ...
Hi QVeen72,
Why some dll files don't need to do "browse" and "add"?
zawpai
If the DLL File is Already Registered using Regsvr or any other method, , it automatically appers on the List.

But when you have created a new dll, it may not have been registered, so it does not apper on the list. If you browse and Add, VB6 Automatically Registers the dll for you..
Once you do that, you can notice, if you open a new project, this New dll will appear on the list..


Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jun 3rd, 2009
0

Re: Can't open "DLL" File

The reason for the difference between the need for an API call and browse and add is the difference between a standard dll and an activex dll.

Good Luck
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Jun 4th, 2009
0

Re: Can't open "DLL" File

Hi all,

Thank you for all of your information.

Best regards,
zawpai
Reputation Points: 7
Solved Threads: 0
Junior Poster in Training
zawpai is offline Offline
99 posts
since Oct 2007
Jan 6th, 2010
0
Re: Can't open "DLL" File
i created One ActiveX DLL and i want to reuse in other vb program.
I declare the procedure which i want to use in my vb program, "Private Declare Sub CreateFile Lib "FileUtil.dll" _
(ByVal FilePath As String, ByVal FreeFile As Integer, ByVal UniCodeTF As String)".I already registered this DLL. I copied the dll in vb program folder , copied to \windows\system32\ and already registered. But still not working, give me the error as "Can't find DLL entry point....."
Please help me!

Thanks!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yimon is offline Offline
1 posts
since Jan 2010

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: Can I directly print to USB port?
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: How do you save multiple pictures into a movie file?





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


Follow us on Twitter


© 2011 DaniWeb® LLC