Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Debug DLL that I'm calling from VB

Posted on 2003-03-11
19
Medium Priority
?
295 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
  • 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
Industry Leaders: 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

581 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