|
-
Oct 17th, 2001, 10:56 AM
#1
Thread Starter
Hyperactive Member
How to use .DLL with VB???
I have a very simple DLL that contain 5 routines.
1) What do I have to do to make this DLL available to Visual Basic??
2) What do I need to do to register this DLL with Windows, or do I???
I tried a few things, but I keep getting an Error saying "FILE NOT FOUND" and it referes to the below line in my declarations:
Private Declare Sub trInfo Lib "trackw" (rev%)
I have also tried it this way:
Private Declare Sub trInfo Lib "c:\windows\trackw.dll" (rev%)
Is this case sensitive??? I am lost?!?!?!
thanks for the help.
"If I had known it was going to be that kinda party, I would have stuck my disk in the mash potatos!"
-
Oct 17th, 2001, 11:02 AM
#2
Frenzied Member
You have to register it first. The best place to put it is in the System32 folder. Anyways then open a command prompt and type 'regsvr32 nameoffile' if you put it in system32 folder or 'regsvr32 [pathtofile]' if not. This will allow you to reference it from references in VB.
-
Oct 17th, 2001, 11:05 AM
#3
You register COM servers, not regular dll's
If you wrote the dll in VB it is a COM object, so you have to register it. Otherwise, Put the file in c:\Windows\System directory
A regular dll callyou declare it like this
Declare Function PrinterProperties Lib "somthin" (ByVal hWnd As Long, ByVal hPrinter As Long) As Long
"somthin" points to \windows\system\somthin.dll
-
Oct 17th, 2001, 11:08 AM
#4
Thread Starter
Hyperactive Member
Thanks! I was pretty sure I had to register it or something.
I tried to use the service to register though, and I got this message:
LoadLibrary("trackw.dll") failed.
GetLastError returns 0x0000001f.
This DLL was written for Win 3.1... does that matter??? What would need to be changed??
I was hoping since it was so simple that no changes would be necessary, but it looks like they might be!
Thanks for your excellent help.
"If I had known it was going to be that kinda party, I would have stuck my disk in the mash potatos!"
-
Oct 17th, 2001, 11:11 AM
#5
Thread Starter
Hyperactive Member
It all started as an ASM library add-in for Qbasic and PBasic... but then we made it into a DLL, but I don't know if the DLL is in ASM or C...
I am assuming I can use it, I just am not setting it up properly???
Thanks again... your answers have been more than helpful.
"If I had known it was going to be that kinda party, I would have stuck my disk in the mash potatos!"
-
Oct 17th, 2001, 11:19 AM
#6
Thread Starter
Hyperactive Member
I keep getting the same error:
Runtime error: 48
File Not Found
This is how I have it declared and the file is in the C:\windows\system directory:
Private Declare Sub trInfo Lib "trackw" (rev As Integer)
Is this right??? What am I doing wrong???
"If I had known it was going to be that kinda party, I would have stuck my disk in the mash potatos!"
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
|