?
Solved

Debug DLL that I'm calling from VB

Posted on 2003-03-11
19
Medium Priority
?
294 Views
Last Modified: 2010-04-01
Hi, everybody!

I use Borland C++ 5.0 and VB5(SP3) under Win2000.
How can I debug my DLL written in BC++ 5.0 that I'm calling from VB?
My problem is: I can't catch breakpoint in my DLL

Thanks in advance

Roman
0
Comment
Question by:Roman2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
  • 4
  • +1
19 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 8113921
>>My problem is: I can't catch breakpoint in my DLL

You can - just place a

DebugBreak();

or

__asm { int 3};

statement at the point of interest. This will cause an EXCEPTION_BREAKPOINT to be raised and invoke the debugger.
0
 
LVL 6

Expert Comment

by:thienpnguyen
ID: 8114150
Debugging BCB\BC++ .Dll from Visual Basic - by Borland Developer Support Staff

http://bdn.borland.com/article/0,1410,16434,00.html
0
 

Author Comment

by:Roman2
ID: 8114177
Yes, I know this article ! But it doesn't work...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:jkr
ID: 8114216
DebugBreak();

should work, though :o)
0
 
LVL 6

Expert Comment

by:thienpnguyen
ID: 8114297
If it doesn't work, could you recheck

1. Maybe, your compute contains other version of that DLL .

2. Maybe, the code at your break point doesn't execute because "you think the program will execute that line but it doesn't" . Could you print some message to make sure that line code executes  .

3. Maybe, you miss some step in that article .
0
 

Author Comment

by:Roman2
ID: 8114364
Thienpnguyen !

I set the breakpoint just on first real operator in my function, so that is before any "if".
What do you mean "your compute contains other version of that DLL"?

Thanks
0
 
LVL 86

Expert Comment

by:jkr
ID: 8114379
Is there any particular reason why you are consequently ignoring my suggestion?
0
 

Author Comment

by:Roman2
ID: 8114417
jkr!

There's no any reason, I just didn't try yet!
I promise, i will. I don't understand what the difference
between DebugBreak and when i set breakpoint with F5 for the same place.

Thanks
0
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 8114444
>>I don't understand what the difference between
>>DebugBreak and when i set breakpoint with F5 for the
>>same place

'DebugBreak()' will place a hard-coded breakpoint in your DLL. This comes in handy when you for various reasons cannot set a breakpoint manually. Even better, if you run the program and it reaches that statement, the debugger will be launched and attaches to the running process.
0
 
LVL 6

Expert Comment

by:thienpnguyen
ID: 8114478
Roman2 > What do you mean "your compute contains other version of that DLL"?

Assume your DLL is a.dll . Maybe, your system directory or a directory in PATH environment variable contains a.dll .... In that case, maybe system loads the different version of a.dll .

Sometime , you put the old version of a.dll in same directory with your execute file or in system directory . However, you debug the newest a.dll in other directory ==> system loads the wrong version of a.dll




 
0
 
LVL 86

Expert Comment

by:jkr
ID: 8181465
Well, anything new on this one?
0
 

Author Comment

by:Roman2
ID: 8181557
Not really...
0
 
LVL 9

Expert Comment

by:tinchos
ID: 9481875
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Delete/No Refund Points

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0
 
LVL 86

Expert Comment

by:jkr
ID: 9481902
Hum, I sort of think that this Q had been answered...
0
 
LVL 9

Expert Comment

by:tinchos
ID: 9481947
jkr

you're right, my mistake

I must have confused it with another question

I'm sorry
0
 
LVL 86

Expert Comment

by:jkr
ID: 9481966
Hey, it it 4:15am here now, I have a *lot* of sympathy :o)
0
 
LVL 9

Expert Comment

by:tinchos
ID: 9481972
It's 23:21 here and I'm having a lot of sympathy too

;)
0
 
LVL 86

Expert Comment

by:jkr
ID: 9481984
;o)

Nevertheless, I'll head for the sheets! 'Night!
0
 
LVL 9

Expert Comment

by:tinchos
ID: 9484189
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: jkr

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question