473,466 Members | 1,334 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to debug a macro

AS
Hello,
Can anybody tell me how to debug a macro ?

for ex,

#define PRINTSTRING() \
CString str = _T("hello"); \

AfxMessageBox(str); \
Mar 10 '08 #1
4 1488
AS wrote:
Can anybody tell me how to debug a macro ?

for ex,

#define PRINTSTRING() \
CString str = _T("hello"); \

AfxMessageBox(str); \
Most compilers support an option to output the result of
preprocessing. RTFM and see if yours does as well. Then
use your macro and see what it expands into.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mar 10 '08 #2
AS wrote:
Hello,
Can anybody tell me how to debug a macro ?
Rewrite it as an inline function.

--
Ian Collins.
Mar 10 '08 #3
Ian Collins wrote:
AS wrote:
>Hello,
Can anybody tell me how to debug a macro ?
Rewrite it as an inline function.
With all due respect, declarations cannot be rewritten as
inline functions.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mar 10 '08 #4
Victor Bazarov wrote:
Ian Collins wrote:
>Victor Bazarov wrote:
>>Ian Collins wrote:
AS wrote:
Hello,
Can anybody tell me how to debug a macro ?
>
Rewrite it as an inline function.
With all due respect, declarations cannot be rewritten as
inline functions.
Did you read the OP's example Victor?

Yes, I did. It contains a declaration.
So it does. That'll teach me to post before breakfast!

--
Ian Collins.
Mar 10 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Alexander Malkis | last post by:
Why do programmers like to use NDEBUG instead of DEBUG? -- Best regards, Alex. PS. To email me, remove "loeschedies" from the email address given.
2
by: Axel Dahmen | last post by:
Hi, when applying changes to the code and hitting to debug, a MessageBox pops up asking me if I want to build before debugging. Of course I want, that's why I've changed the code... Is there a...
1
by: lukwagoroy | last post by:
Loaded 'ntdll.dll', no matching symbolic information found. I'm writing a small program. It compiled and run. But when trying to debug by select, I got the following error messages: Loaded...
6
by: pauldepstein | last post by:
To help me debug, I am writing a lot of information into a stream which I call debug. However, because of the large amount of time taken to print this information, I only want this printed while...
0
by: Oenone | last post by:
I have a VS2005 macro that runs in my BuildEvents.OnBuildDone event handler each time I build my solution. I'd like to get this macro to write to either the Output/Debug window or the Immediate...
0
by: Mike Grice | last post by:
I wanted to create a macro to open the debug...Processes window, make a specific selection, attach to it, make that selection then close down. Unfortunately, the debug...Processes window is modal...
5
by: sujeet | last post by:
Dear friends, I'm facing a strange problem... My Application is in Debug mode, and the third party static library i'm using is in release mode. When i compile and try to link my...
9
by: vivek | last post by:
Hi i have used some debug macro and called several times(hundreds) in the code. The purpose of the macro was to print the values at that time to the screen Now that i have finished...
5
by: Peng Yu | last post by:
Hi, It is benifitical to use macro in certain cases. http://www.boost.org/doc/libs/1_35_0/libs/preprocessor/doc/index.html However, I found that it is not easy to debug a macro. For example,...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.