macros

Firing a macro on saving a calendar event - Outlook VBA

Hi, I'm trying to automate the adding of a keyphrase to events added to my outlook calendar (depending on the type of the event, want to add different keyphrases so that my smartphone profile switching software will correctly switch the profile depending on what I'm doing...) Ideally, I'd want to hook an onsave event for calendar items...

Word macro cannot save filename > 255 characters

I have this in my Word Macro ActiveDocument.SaveAs FileName:="D:\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\Ug F Blug and Bug f Goo - Blank Address - 2009-09-...

XCode Preprocessor Macro for Configuration?

I want my XCode Objective-C project to be able to detect which configuration it is being built with. How can I achieve this? Thanks in advance. ...

visual studio 2008 macro: write to output pane

In a Visual Studio macro, how do you write execution information on the output pane (i.e. the window that usually contains build output)? I'm using Visual Studio 2008, if that is relevant. Solution: I added the following subs to my macro project, I'm posting them here in case they could be useful. Private Sub Write(ByVal name As Strin...

Learning Scheme Macros. Help me write a define-syntax-rule

I am new to Scheme Macros. If I just have one pattern and I want to combine the define-syntax and syntax-rules, how do I do that? (define-syntax for (syntax-rules (from to) [(for i from x to y step body) ...] [(for i from x to y body) ...])) If I just have one for, how do I combine the syntax definition and the rule? Thanks...

Macro input Value and extract rows accordingly

This is an excel sheet with 4000 rows * 200 columns. one column has 10 different names in the column. Function of my macro is to first ask for the name of person whose report is required. Suppose I say "Ram" it will extract all the rows equal to that name and save the values in new workbook and save the file name as "Ram" ...

XCode 3.2: Changing the default "Code Sense" indentation and whitespaces

I'm working with XCode 3.2 (on "Snow Leopard") which (still) has this nice "Text Macro" auto-completion feature (eg. if you type if it will expand to if (<#condition#>) { <#statements#> }). These macros are also available via "Edit->Insert Text Macro". Unfortunately, the default templates don't match my beloved indentation and whitespac...

Does the C preprocessor strip comments or expand macros first?

Consider this (horrible, terrible, no good, very bad) code structure: #define foo(x) // commented out debugging code // Misformatted to not obscure the point if (a) foo(a); bar(a); I've seen two compilers' preprocessors generate different results on this code: if (a) bar(a); // and if (a) ; bar(a) Obviously, this is a bad thing ...

Highlighting #defined value in VIM

Hi all, I have XYZ highlighted in the header file where I have defined XYZ. However at the point of where it is used, XYZ is not highlighted. How would I fix this ? I have attached two screen shots (see TH_SYN in the code) to clarify my question- link text Any pointers are welcome. Many thanks. ...

What's going on in the 'offsetof' operator?

Visual C++ 2008 C runtime offers an operator 'offsetof', which is actually macro defined as this: #define offsetof(s,m) (size_t)&reinterpret_cast<const volatile char&>((((s *)0)->m)) This allows you to calculate the offset of the member variable m within the class s. What I don't understand in this declaration is: Why are we cas...

Stringification on a enumeration member

Hello, I need to convert an enumeration member (its value, not the identifier) to a string. I have tried the following, which works for a MACRO (TYPE_A), but not for an enum value (typeA). This is a little bit strange in my opinion. Do you have any idea how to do this? #define _tostr(a) #a #define tostr(a) _tostr(a) typedef enum _S...

#defined bitflags and enums - peaceful coexistence in "c"

I have just discovered the joy of bitflags. I have several questions related to "best-practices" regarding the use of bitflags in C. I learned everything from various examples I found on the web but still have questions. In order to save space, I am using a single 32bit integer field in a struct (A->flag) to represent several different ...

List of the $(xxx) macro in visual studio

I would like to establish a list of all the visual studio macro that can be used in the post-build event script. $(Configuration) : Name of the current build configuration (ie: Debug or Release). ...

Add header and footer macro

Hi. I need to make a difficult makro. When the makro has been activated (will happen via a button), it has to add a header and a footer to the document. Also page1/frontpage needs a different header and footer than all the other potential pages. So far, I have accomplished making page1/frontpage to work - somewhat. I did this by recor...

Generating and saving code from Macro

I am analyzing a legacy code which heavily using macro , I am lost in understanding how macro are expanding in code. Could any one suggest me some tool or technique so that i can study actual code generated from macro expansion. Platform : Windows XP Language : C++ Compiler : VC6 Thanks in Advance ...

How do I dismiss a modal window created during a Visual Studio 2008 macro?

I am trying to create a macro in Visual Studio 2008 to attach to my local webdev server for an asp.net mvc project. Here's the current macro code: Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports System.Diagnostics Imports System.IO Public Module Macros ' This subroutine attaches to the first Development Web...

Visual Studio 2008 Macro for Building does not block thread

Hello, I am trying to write a macro for Building my application, kicking off an external tool, and ataching the debugger to that external tool. Everything is working except for the building. It builds, but it is not blocking the thread so the external tool gets kicked off before it can finish. Is there a way I can run ExecuteCommand an...

A more complex word macro then I'm used to (i.e. I can't record it)...

I am trying to write a word macro that Selects everything that is Heading 2 (or any specific style), copies it and pastes it into an Excel document. Macro recording doesn't work here and I'm stumped as to the syntax for the necessary commands. Is it possible to do? P.S. It would be really great if it could select whatever style the curs...

Access a function pointer without parenthesis

I have this code: #include <stdio.h> int getAns(void); int num; int main() { int (*current_ans)(void); current_ans = &getAns; // HERE printf("%d", current_ans()); } int getAns() { return num + 3; } However, is it possible to have something in the // HERE spot that allows the next line to be printf("%d", curre...

C++ template macro shortcut

Often when working with templates, you end up with something like: template <T> class the_class { public: // types typedef T value_type; typedef const value_type const_value_type; typedef value_type& reference; typedef const_value_type& const_reference; typedef value_type* pointer; typedef const_value_type* const_...