|
-
Aug 18th, 2006, 12:30 PM
#1
Thread Starter
Addicted Member
API declare not allow
I have created a dll using C++, now i want to use it in VB6 However
the declaration is fine using the fullpath as follow:
VB Code:
Private Declare Sub Principal Lib "F:\myfunction.dll" (ByVal value As String)
However, i want to declare as:
VB Code:
Private Declare Sub Principal Lib app.path & "\myfunction.dll" (ByVal value As String)
VB wouln'd allow me to do that. any solution ?
-
Aug 18th, 2006, 12:37 PM
#2
Re: API declare not allow
Is dll located in app.path? Did you save your project? If you didn't, App.Path equals VB's path.
-
Aug 18th, 2006, 12:37 PM
#3
Hyperactive Member
Re: API declare not allow
Do it like this and as long as the DLL is with the EXE or in the Search Path you should be set!
Private Declare Sub Principal Lib "myfunction.dll" (ByVal value As String)
-
Aug 18th, 2006, 12:37 PM
#4
Re: API declare not allow
Correct me if im worng... but if you register the dll in windows, the path should not be needed
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Aug 18th, 2006, 12:40 PM
#5
Hyperactive Member
Re: API declare not allow
Not all DLL's can be registered, right?
But as long as it is in the Search Path, where the .EXE is, or as Gavio states in the IDE it would need to be with VB6.EXE.
-
Aug 18th, 2006, 12:44 PM
#6
Thread Starter
Addicted Member
Re: API declare not allow
-
Aug 18th, 2006, 12:45 PM
#7
Re: API declare not allow
 Originally Posted by tward_biteme1
Not all DLL's can be registered, right?
But as long as it is in the Search Path, where the .EXE is, or as Gavio states in the IDE it would need to be with VB6.EXE.
that is correct
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Aug 18th, 2006, 12:47 PM
#8
Re: API declare not allow
Place the dll in App.Path and try just,
VB Code:
Private Declare Sub Principal Lib "myfunction.dll" (ByVal value As String)
@Static, AFAIK, if the dll is a standard windows dll (not ActiveX dll), it doesn't (and can't be) need to be registered.
By default, Windows first searches App.Path for the dll. If it is not found in App.Path, then it searches the System dir. If it is missing in system dir too, then Windows displayes the Dll not found error message.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|