简体   繁体   中英

Added library; Borland C++ Builder pauses without reason

I've been trying to use the UnderC library (gives c++ scripting functionality) in a program in Borland C++ Builder (in Windows XP), but it's giving me difficulties that I'm not sure how to fix. Other problems that've come up, I found solutions to them online, but this one is hard to describe with easily searchable words. I've added (to the compiler search path) the folder that contains the files needed - "ucdl.h" and "ucc12.lib" (C++ told me I needed to convert the .lib from coff to omf, so I did; it stopped giving me that error). I added the line #include "ucdl.h", and now it doesn't give me any error messages - but when I run it, the first thing it does is stop in the middle of the cpu debugging window, as though I had set a breakpoint. There are no break points. It doesn't give any reason as to why it stopped. If I have it continue running, it then gives me an access violation error. One thing that may or may not be useful - if, in the cpu debugger, I back up a line from where it paused, it reparses the visible assembly, and the line it was on is then shown to begin a byte earlier. As the code runs from where it stops, as far as I can tell, to get to where it crashes, it goes (in the assembly code) from
___CRTL_VCL_Init into
___CRTL_VCL_Sharemem into
__roundToInt64(), at the following line:
00403204 FF25387B4000 jmp dword ptr [$00407b38]

This line is preceded and followed by many similar lines, pointing to adjacent memory locations. The address contained by the pointer is 0x00009B47, which appears to be out of the program's range or whatever, and thus gives an error. I'm not sure how to address this problem, since it doesn't give me any errors when it first stops (really weird), there's no source code associated with where it gives the error, and it seems to give the error in a VCL initialization area, and I don't know how the addition of a library would cause that. Any ideas, anyone?

Oh, also, it appears to pause just after loading borlndmm.dll, whereas a normal program keeps loading more dlls. The event log shows:

Thread Start: Thread ID: 3028. Process ManualEventLogger.exe (4932)
Process Start: C:\Documents and Settings\Matthew\My Documents\Borland Studio Projects\Cantrips\Manual Event Logger\Debug_Build\ManualEventLogger.exe. Base Address: $00400000.     Process ManualEventLogger.exe (4932)
Module Load: ManualEventLogger.exe. Has Debug Info. Base Address: $00400000. Process ManualEventLogger.exe (4932)
Module Load: ntdll.dll. No Debug Info. Base Address: $7C900000. Process ManualEventLogger.exe (4932)
Module Load: KERNEL32.dll. No Debug Info. Base Address: $7C800000. Process ManualEventLogger.exe (4932)
Module Load: vcl100.bpl. No Debug Info. Base Address: $52000000. Process ManualEventLogger.exe (4932)
Module Load: rtl100.bpl. No Debug Info. Base Address: $51F20000. Process ManualEventLogger.exe (4932)
Module Load: OLEAUT32.dll. No Debug Info. Base Address: $77120000. Process ManualEventLogger.exe (4932)
Module Load: ADVAPI32.dll. No Debug Info. Base Address: $77DD0000. Process ManualEventLogger.exe (4932)
Module Load: RPCRT4.dll. No Debug Info. Base Address: $77E70000. Process ManualEventLogger.exe (4932)
Module Load: Secur32.dll. No Debug Info. Base Address: $77FE0000. Process ManualEventLogger.exe (4932)
Module Load: GDI32.dll. No Debug Info. Base Address: $77F10000. Process ManualEventLogger.exe (4932)
Module Load: USER32.dll. No Debug Info. Base Address: $7E410000. Process ManualEventLogger.exe (4932)
Module Load: msvcrt.dll. No Debug Info. Base Address: $77C10000. Process ManualEventLogger.exe (4932)
Module Load: ole32.dll. No Debug Info. Base Address: $774E0000. Process ManualEventLogger.exe (4932)
Module Load: VERSION.dll. No Debug Info. Base Address: $77C00000. Process ManualEventLogger.exe (4932)
Module Load: MPR.dll. No Debug Info. Base Address: $71B20000. Process ManualEventLogger.exe (4932)
Module Load: IMAGEHLP.dll. No Debug Info. Base Address: $76C90000. Process ManualEventLogger.exe (4932)
Module Load: WSOCK32.dll. No Debug Info. Base Address: $71AD0000. Process ManualEventLogger.exe (4932)
Module Load: WS2_32.dll. No Debug Info. Base Address: $71AB0000. Process ManualEventLogger.exe (4932)
Module Load: WS2HELP.dll. No Debug Info. Base Address: $71AA0000. Process ManualEventLogger.exe (4932)
Module Load: OLEACC.dll. No Debug Info. Base Address: $74C80000. Process ManualEventLogger.exe (4932)
Module Load: MSVCP60.dll. No Debug Info. Base Address: $76080000. Process ManualEventLogger.exe (4932)
Module Load: MSIMG32.dll. No Debug Info. Base Address: $76380000. Process ManualEventLogger.exe (4932)
Module Load: COMCTL32.dll. No Debug Info. Base Address: $5D090000. Process ManualEventLogger.exe (4932)
Module Load: SHELL32.dll. No Debug Info. Base Address: $7C9C0000. Process ManualEventLogger.exe (4932)
Module Load: SHLWAPI.dll. No Debug Info. Base Address: $77F60000. Process ManualEventLogger.exe (4932)
Module Load: WINSPOOL.DRV. No Debug Info. Base Address: $73000000. Process ManualEventLogger.exe (4932)
Module Load: comdlg32.dll. No Debug Info. Base Address: $763B0000. Process ManualEventLogger.exe (4932)
Module Load: oledlg.dll. No Debug Info. Base Address: $7DF70000. Process ManualEventLogger.exe (4932)
Module Load: borlndmm.dll. No Debug Info. Base Address: $21670000. Process ManualEventLogger.exe (4932)

Ok...I was messing with the settings, and I used "add a file to your project" on ucc12.dll (as opposed to .lib), and then checked "copy local", which copies the file to the program's local directory...and the program worked fine that time. So, it works now...but I still have no idea why that worked, or what exactly was causing the very odd behavior before. If anybody has any ideas about that, I'd be interested to know. But at least the program's working, now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM