macros

How to correctly define char array

Hi all, Does anyone know how should ASF_OBJECT_GUID_TEST be defined to avoid compilation error in the line marked below, or where I can find more information about it? Thanks, Andre #define ASF_OBJECT_GUID_TEST {(char)0x75, (char)0xB2, (char)0x00} void testFunction(char * testChar) { } int main(int argc, char * argv[]) { char t...

Visual Studio macro writes extra " mark

I thought i'd use a macro to speed up writing <xsl:choose> blocks. DTE.ActiveDocument.Selection.Text = "<xsl:choose>" DTE.ActiveDocument.Selection.NewLine() gives me (thanks to auto complete) <xsl:choose> </xsl:choose> however DTE.ActiveDocument.Selection.Text = "<xsl:choose>" DTE.ActiveDocument.Selection.NewLine() DTE.ActiveDocu...

Is there a way to control macro expansion order.

Howdy! I am hoping that someone may have an idea on how to control/specify the order of macro expansion. Here is the context: // 32 bit increments, processor has registers for set, clear and invert #define CLR_OFF 1 #define SET_OFF 2 #define INV_OFF 3 #define SET(reg,bits) *((volatile unsigned long*)( SET(LATB, STATUS_LED); // LATB...

VS macros: How to change command line arguments for debug in C# project properties?

Is it possible using macros in Visual studio 2008 to change command line arguments for debug project? In project->properties->debug i can set manually comm line args for debugging. I'd like to change them with macros, not with hands. ...

How can I programmatically add a macro to a MS Word document using Perl?

I have a Perl script that can define and write a MS Word macro according to the user's input. But how can I make the Perl script open Word and add the macro into its macros data base? ...

Outlook VBA: How to get started - need to save attachment from current email to a derived folder.

I'm looking for a starting point here, so no code to post I'm afraid ! I would like (if possible) to be able to open an email in Outlook (in the normal way, from the front-end), and then click a button to run a macro, which will extract the attachments from this email and save them to a directory path (derived from the subject). Sound ...

Why is post-compilation code injection a better idea than pre-compilation code injection?

So we all know that C# doesn't have a C-like macro pre-processor (and there's a good thread on why here). But now that AOP is gaining traction, it seems like we're starting to do stuff with post-processors that we used to do with pre-processors (bear in mind that I am only getting my feet wet with PostSharp so am perhaps off base). I am...

Outlook VBA Macro: Best way to indicate 'please wait'...

What's the best practice for indicating to the user that a Macro is running within Outlook ? The macro can take around 1-30 seconds to complete. I want to avoid a modal 'msgbox' popping up before the macro is run, as this can be annoying. I would rather avoid the hourglass cursor if possible, and wondered if there was a better way. Is...

C/C++ cool macro definitions?

Besides __ LINE__ and __ FILE__ are there other useful pre-defined macros, like __ FUNCTION_NAME__ ? If not, but you know of other cool/useful defined macros (especially for debugging purposes), I'd love to hear about them. EDIT: some have asked about platform: I'm using gcc/g++ on MacOSX. ...

Pattern matching style in C++?

I love Haskell style pattern matching. I have my C++ code as follows: ObjectPtr ptr; if(ptr.isType<Foo>()) { // isType returns a bool Ptr<Foo> p = ptr.convertAs<Foo>(); // convertAs returns a Ptr<Foo> ...... } if(ptr.isType<Bar>()) { Ptr<Bar> p = ptr.convertAs<Bar>(); ...... } Now, are there any macros I can do define to simp...

Netbeans 6.7.1: problem with macros

I find the macros feature, accessed via the red circle and the grey square in the toolbar of the source editing window, in Netbeans to be a rather nifty way of getting things done quick. However, I find it annoying how they cannot be toggled on/off. I can be typing some code, and if it contains just the first (not all) the keystrokes in...

can you limit the number of items in a recently-updated macro in confluence 2.9?

i see in confluence 2.10, there is a max and maxresults parameter but i dont see these parameters in 2.9.1 or below. Is there anyway to limit the results in these versions ? ...

Excel Development through .Net losing Macros

Good Afternoon, I have a an Excel template file - which contains Macros - that I load up in .Net. The excel document is built up on a case by case basis (the same format, but with different data dependent on what the user picks). When the Excel document is loaded up, the Macros have disappeared, does anyone know why and how to resolve t...

#if 0 as a define

I need a way to define a FLAGS_IF macro (or equivalent) such that FLAGS_IF(expression) <block_of_code> FLAGS_ENDIF when compiling in debug (e.g. with a specific compiler switch) compiles to if (MyFunction(expression)) { <block_of_code> } whereas in release does not result in any instruction, just as it was like this #if 0 ...

Emacs: Is there a way to create a interactive script using Emacs?

I am new to emacs, but shocked at what I can really do and how much time it saves (Macros save A LOT of time). But I was wondering it was possible to create step based scripts where it asks the user for input and executes code based on that. For example maybe I want to create a SQL query so it would prompt something like: >table name? m...

How to write a recursive macro call on a &REST parameter in Lisp?

Hi, I've been writing some simple test cases for one of my assignments, and have built up a bit of a test suite using macros. I have run-test and run-test-section and so on. I'd like run-test-section to take a number of parameters which are run-test invocations and count up the number of PASSes and FAILs. run-test returns T on PASS, an...

How To Automatically Start iMacros Javascript Upon Browser Loading

This question is specific to the iMacros suite in particular. What is the best way to go about automatically starting a javascript file that controls my macros inside firefox? Basically, I have an imacros.js file that calls a series of imacros.iim files. How can I run this javascript automatically? ...

Excel user-defined function not called on cell update

I have a user-defined function written in VBA that updates colors in a drawn shape (traffic light consisting of three circles). The call in a worksheet cell looks somehow like this: setTrafficLight(A1, "Oval 1", "Oval 2", "Oval 3") where A1 is a cell containing e.g. "green" or "red". The other parameters are the names of the shapes. ...

Excel 2003 data input and transfer it to another field which scrolls upwards to keep the last input and previous inputs

Here is the goal- I have a table of data that I am trying to populate. The spreadsheet is financial in nature and it tracks portfolio values as the user inputs them. It is a trailing 18 month data sheet. The most recent data is that the bottom of the list. I am trying to create a field where a user can enter a month/dollar value a...

How to setup different Resources for different compile macros in Visual Studio?

I have a String resource that needs to have different value based on the conditional compile. How to setup different Resources for different compile macros in Visual Studio 2008 Professional? ...