![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jan 2005
Posts: 3
Rep Power: 0
![]() |
Linking dll failure (file not found)
i've been trying to link a dll file written with VC++ to VB6 ..
but it keeps telling me error 53 "file not found" i tried making an ordinary dll file in VC and link it to VB it worked perfectly (it contained a small program adding 2 values), but when i try to link my dll file it refuses telling me "file not found" note that my dll file contains many functions and takes many variables, also it calls other dll files from that dll the code i wrote in VB was in declaration: Private Declare Function Core Lib "CoreDll.dll" (ByVal File_Name As String, ByVal width_resized As Integer, ByVal height_resized As Integer, ByVal PaperROIWidth As Integer, ByVal PaperROIHeight As Integer, ByVal CornerWidth As Integer, ByVal CornerHeight As Integer, ByVal CornerArea As Integer, ByVal CornerVar As Integer, ByVal Num_Questions As Integer, ByVal Num_Answers As Integer, ByVal AnsxStart1 As Integer, ByVal AnsxStart2 As Integer, ByVal AnsyStart As Integer, ByVal AnsxShift As Integer, ByVal AnsyShift As Integer, ByVal AnsWidth As Integer, ByVal AnsHeight As Integer, ByVal AnsAreaThr As Integer, ByVal SecStartY As Integer, ByVal SecStartX1 As Integer, ByVal SecStartX2 As Integer, ByVal BNStartX1 As Integer, ByVal BNStartX2 As Integer, ByVal SecBNWidth As Integer, ByVal SecBNHeight As Integer, ByVal SecBNAreaThr As Integer) As Integer and i called it with the line .. X = Core("Ans-Exam_Networks-Model9.BMP", 778, 1100, 700, 1000, 70, 70, 100, 40, 60, 4, 78, 463, 131, 59, 27, 30, 30, 100, 74, 286, 315, 385, 414, 14, 21, 5) so VB halts at that line (the call one) i've been trying to know where the problem is for several days with no success. thank you |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I'm no expert on DLLs, but perhaps it's "Ans-Exam_Networks-Model9.BMP" that doesn't exist?
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jan 2005
Posts: 3
Rep Power: 0
![]() |
No .. i'm sure it exists
I'm sure that every file is in its place |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Is the message box that pops up from VB or the C++ DLL?
|
|
|
|
|
|
#5 |
|
Expert Programmer
|
Error 53 is from Visual Basic and it means it can't find your DLL. It must be located in one of two places - the %systemroot% (windows\system32 for NT) or the same folder as the executable. If running within VB, it must be in the same folder as the project ('vbp') file. Try adding the line chdir(app.path) before you call the function. If that still doesn't work, try replacing the Lib field with the absolute path to see if that works.
There doesn't appear to be any conventional way of dynamically assigning the Lib field at run-time - it must be a string constant - if your problems still persist, I'd recommend using COM instead of __stdcall, as CreateObject() in VB is much more flexible (and up to date). Hope this helps |
|
|
|
|
|
#6 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Oh, and if that doesn't work, this might - type the following into the Run dialog box:
regsvr32 <path to DLL>\CoreDll.dll |
|
|
|
|
|
#7 |
|
Expert Programmer
|
Actually, regsvr32 only works on self-registering COM components (i.e. ActiveX) that conform to the __stdcall. It won't help - DLL's do not need to be "registered" as such. Regsvr32 doesn't actually do anything special anyway, it's just a special case of rundll32 - it looks for a entry point called DLLRegisterServer, making the DLL responsible for registering itself in the COM registry.
Error 53 means that VB can't find the file specified by Lib, for which regsvr32 is no help - An error such as "ActiveX Component can't create object" would be the sort of thing caused by a registration issue that regsvr32 could solve. |
|
|
|
|
|
#8 |
|
Expert Programmer
|
Anway...
If your DLL just adds numbers, is that anything you couldn't do in VB anyway - why do you need a DLL. It's just another part of the program to go missing.
|
|
|
|
|
|
#9 |
|
Newbie
Join Date: Feb 2005
Location: Brasov - ROMANIA
Posts: 1
Rep Power: 0
![]() |
This problem is not because the first VC DLL. The responsible for error is another DLL that the CoreDLL.dll calls. The same problem I have. I don't know to resolve. Erase the outside function from CoreDLL.dll and error disapear.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|