[windev] Macro
Chris Becke
Chris.Becke at derivco.com
Mon Jul 27 07:29:55 GMT 2009
Lookup the "Stringizing operator" in the msdn help.
To convert macro parameters into strings you use #:
So this should work:
#define SMLABEL(a) GetSMLabel( a, #a )
________________________________________
From: windev-bounces at windev.org [windev-bounces at windev.org] On Behalf Of truckleaj-windev at yahoo.co.uk [truckleaj-windev at yahoo.co.uk]
Sent: 25 July 2009 04:53 PM
To: windev at windev.org
Subject: [windev] Macro
Hello
I have code a bit like this:
strText = GetSMLabel(IDS_STR_XXXX,"IDS_STR_XXXX");
Etc ...
The GetSMLabel(n,"n") call always has the id (integer) and then the same value as a string as above. It returns a CString.
Can I do a macro:
SMLABEL(IDS_STR_XXXX) that expands to the above, to save me typing in the same value twice, and it automatically put quotes around?
I tried:
#define SMLABEL(a) GetSMLabel(a,"a")
but it didn't work.
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.windev.org/pipermail/windev/attachments/20090725/37539c75/attachment.htm
--
Windev mailing list at Windev at windev.org
Lost your password? Need to unsubscribe or change your delivery options?
Go to http://lists.windev.org/mailman/listinfo/windev
--
Search the Windev Archives - www.windev.org
#############################################################################################
The information transmitted is intended only for the person or entity to which it
is addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of, or taking of any action
in reliance upon, this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact the sender and
delete the material from any computer.
Furthermore, the information contained in this message, and any attachments thereto, is
for information purposes only and may contain the personal views and opinions of the
author, which are not necessarily the views and opinions of the company.
#############################################################################################
More information about the Windev
mailing list