macros

Writing a Macro for this: (Objective-C)

Hi, I have a method like this: - (CGPoint) _convertCGPointCT2UIKit:(CGPoint)ctPoint{ CGPoint uikitPoint = CGPointMake(ctPoint.x + INITIAL_HORIZ_OFFSET, self.bounds.size.height - ctPoint.y - INITIAL_VERT_OFFSET); return uikitPoint; } Is there any way I can make this a macro? I tried this but I get errors like "; expected b...

Struct initialisation through macro overuse

Hi, I've got some structs to initialise, which would be tedious to do manually. I'd like to create a macro that will help me with it... but I'm not sure C preprocessor is good enough for this. I've got structs which represent menus. They consist of function pointers only: typedef uint8_t (*button_handler) (uint8_t); typedef void (*peda...

Need help creating a conditional copy macro for Excel 2003

I would like to conditionally copy data from multiple worksheets into a single worksheet in a given workbook in order to consolidate data. The macro would look at column F in all the worksheets, and if a row in column F matches a given number, that row gets copeid. Any help would be great!! Terry ...

autotools: autoreconf can't find macro but aclocal can

I'm trying to use autotools for the first time as a developer, so excuse any noobishness. I'm using the Check unit testing library which defines the macro AM_PATH_CHECK in check.m4, which was installed in /usr/local/share/aclocal. I managed to get aclocal to recognize AM_PATH_CHECK by editing /usr/share/aclocal/dirlist to include /usr/...

Accessing the value of a Preprocessor Macro definition

If I add a macro "FOO=bar" under GCC_PREPROCESSOR_DEFINITIONS (or Preprocessor Macros if you use XCode"), what would be the best way to access the value of "FOO"? Currently, I use the clumsy: #define MACRO_NAME(f) #f #define MACRO_VALUE(f) MACRO_NAME(f) #ifdef FOO NSLog(@"%s", MACRO_VALUE(FOO)); #else ...

Umbraco caching

I'm having real problem with caching in a macro. I've set the cache period to 0 but still a dropdownlist that returns a list of other items in the content tree won't update until I force the application to recycle e.g. touch the web.config file. The Macro uses umbraco.content.Instance.XmlContent.SelectSingleNode to select a parent node ...

Need to keep track of types of opencv Mats

Hi, So I'm using the class Mat from opencv in a program I'm writing. Mat looks something like this: class Mat { public: Mat(int width, int height, int type); template <typename T> T getElt(int x, int y); int depth(); ... } The type in the constructor specifies whether elements in the Mat are float...

Moving Flag Messages from Folder to any folder which originally that messages belongs too

Hello, I have created a Macro which will move messages for follow up in particular folder under Inbox which I created Say "Follow Up" .Also created a macro for to clear the follow up and send that message to another folder say" Flag Over". My query is message goes automatically to that folder when run the macro.But I want that message t...

What is difference between these 2 macros?

What is the difference between __IPHONE_OS_VERSION_MAX_ALLOWED and __IPHONE_OS_VERSION_MIN_REQUIRED Which should I use to detect old/new SDKs, like #if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_2 ...

How can I close all the document windows in Visual Studio from an external script?

Hi, I'm creating the software for a course. What with exercise start points and worked solutions and both C# and VB I have about 100 VS2010 solutions. During development I reopen these as neccessary and they get a lot of tweaking. When I'm done I want to leave the solutions with NO documents open. That way when the student opens the...

Macro: how can I select multiple sheets in a workbook?

The workbook has over 50 worksheets and I'm working through an old macro that will help me amend the same range within each sheet. Howvere they have ahrdcoded the sheets.selectstatement. How do you write: Sheets(Array("Sheet1", "Bob", "1953", etc, etc, etc)).Select so that all the sheets are selected - from first to last, no matter what...

Message boxes (VBA): how can I include/use them in my Excel Macros?

I'm teaching myself (read hacking) through some old Excel Macros that are quite long. However, as I change quite a few lines I want to be sure that I know when and where my new and re-hashed elements are occuring - or not. So my question/s is: How do I insert a simple message box function that will pop up when a loop/procedure/event ha...

How to specify dynamically the 'To:' field into a SendObject within a Macro in MS Access 2003?

Hello, I'm using a form where I have one control/textbox which get populated from a query. I also have a button which launches a Macro, sending an email with an attached file. My problem is that I want to set the value of the "To:" field within the SendObject with the value which is in the textbox in my form. See enclosed the screensh...

Visual Studio macro that references current project

I want to do the following in my macro: Dim selection As EnvDTE.TextSelection = CType(DTE.ActiveDocument.Selection, EnvDTE.TextSelection) Dim selType As Type = Type.GetType(selection.Text) // do some stuff with the type But the problem is that the macro editor doesn't have a reference to my project, so it can't figure out how to get i...

C++ What is this simple macro doing?

I'm converting a C++ application in C# and managing to work my way through most of it. However I'm stuck with the following statement: #define GET_SHCALL_ID(L) (((L) >> 24) & 0x000000FF) It's called by another part of the application that receives a Window Message and is passing in the lParam to this call, as...

Calling a C++ macro with fewer arguments

Hi, is it possible to call function-like-macros with less that all the parameters in linux? actually doing this only generates a warning in Visual Studio (warning 4003) and unassigned variables replaces with "". But compiling it using g++ generates an error in linux ("error: macro * requires ** arguments, but only ** given"). is there...

Visual Studio macro to select the startup project

In MSVC several operations (such as Menu: Build: Build ) are context sensitive to the currently selected Solution Project. However, that Project often changes if you've been navigating Solution Explorer. I'd like to write a macro that find the project specified as the "startup project", and the selects it to make it active. I haven't f...

vba: what is 97.45 * 1# = ?

some_integer = 97.45 * 1# what does this notation mean? what will some_integer = ? ...

How to declare a specific snippet in textmate {MAC}

Hello, i don't know if this is the right place, but i would know how to declare a new macro/snippet in textmate to do this : I select the text Sample Text I use whatever combinaison of key and it transforms it into : <?php echo __('Sample Text') ?> Thank you ;) ...

Start Windows Task from Outlook Macro

Is it possible to run a scheduled Task in Windows Server 2008 from an Outlook Macro? Background is that it should be possible to start this task on incoming emails with a special subject. The task normally runs every day, but sometimes it should be triggered manually and not everybody has access to the server. Maybe someone has a solutio...