C++ Getting the size of a type in a macro conditional
Is there some way to do something like this in c++, it seems sizeof cant be used there for some reason? #if sizeof(wchar_t) != 2 #error "wchar_t is expected to be a 16 bit type." #endif ...
Is there some way to do something like this in c++, it seems sizeof cant be used there for some reason? #if sizeof(wchar_t) != 2 #error "wchar_t is expected to be a 16 bit type." #endif ...
I have to update this code to do a substring or regex match but I don't even understand the code: INDEX( $DATA.B$2:B$1501; SMALL( IF( $DATA.$A$2:$A$1501=$B$3; ROW($DATA.$A$2:$A$1501)-ROW($DATA.$A$2)+1 ); ROWS($DATA.$A$1:$A1) ) ) The bit that has me scratching my head the most is $DATA.$A$2:...
This is going to be both a direct question and a discussion point. I'll ask the direct question first: Can a stored procedure create another stored procedure dynamically? (Personally I'm interested in SQL Server 2008, but in the interests of wider discussion will leave it open) Now to the reason I'm asking. Briefly (you can read more e...
I have some big documentation to do that will contain pieces of code I'd like to give the conventional "coding language" syntax highlighting. I've searched the styles feature to do such a thing, but there is no way to do that (in fact I could only found a forum where people were fighting about adding this feature or not, but this is not ...
Can some provide me a VBA macro to import data from a CSV file into ms access tables ? ...
I have a excel cell where its value is updated every minute. What i need is a alert message box; while that cell value moves to a particular time. Suppose a cell has value 10 if it reaches 7 in one minute .. i need a message box to alert that. if it is not reaching 7 in one minute its not needed to be alerted. Please help to write...
I have a class based on CSocket in a DLL which has various threaded buffers for holding the incoming stream. I have a couple of applications with which this works perfectly, using a timer to poll the buffer to see if anything is there to be pulled out and then displayed. Now I've got the timer in some VBA code, a macro if you will, in a...
I've got an NMake project in Visual Studio 2008 that has the Build command set to a custom tool that performs a long build task. Build = "@call MyTool -config $(ConfigurationName)" I want a way to to pass a special flag ("-quickbuild") to my tool to tell it to do a quick subset of the overall build. Build = "@call MyTool -config $(Con...
I have a test like LEFT('F13',2)='F1' I want to change it from a left-side match to a test that supports wildcards 'F13'='F?3' Excel doesn't support regex except in VBA code but i'd prefer this was done in a macro. I should point out that the actual test isn't a simple string, but cell references (this may be important, I'm not sur...
I have this macro in my header file: #define UIColorFromRGB(rgbValue) \ [UIColor colorWithRed:((float)((rgbValue So I want to ask everyone is this better or should I use this approach: cell.textColor = [UIColor colorWithRed:66/255.0 green:33/255.0 blue:33/255....
When I do =RIGHT(DATA!$A$2:$A$1501,1) I get the value 3. When I do =$B$5 I get the value 3. When I do =RIGHT(DATA!$A$2:$A$1501,1)=$B$5 I get the value FALSE. How the f%^k can 3 not equal 3. Is this a data type issue? Do I need a cast? If so how? ...
Currently I use a \mytodo macro, which just calls \todo[inline]: \newcommand{\pbtodo}[1]{\todo[inline]{#1}} But I'd like to call this macro \todo. The simplest solution: \renewcommand{\todo}[1][]{\todo{#1}} unsurprisingly resulted in what I presume to be a stack overflow: ! TeX capacity exceeded, sorry [input stack size=5000]. D...
I'm trying to run the Visual Studio 2005 sample macro that attaches the debugger to calc.exe. Neither it nor any other macro seem to do anything when I run them. Calc.exe is running. "Tools->Options->Add-in/Macros Security->Allow macros to run" is checked. The error list shows no errors. ...
I am learning Macros in Clojure and wanted to write the "cond" macro. I am having problem de-structuring the arguments into (condition) (arguments) and writing a recursive macro. Please help me. ...
Hi, Initially I thought I needed this, but I eventually avoided it. However, my curiosity (and appetite for knowledge, hum) make me ask: Can a preprocessor macro, for instance in #include "MyClass.h" INSTANTIATE_FOO_TEMPLATE_CLASS(MyClass) expand to another include, like in #include "MyClass.h" #include "FooTemplate.h" template c...
You can see what i'm trying to do below: typedef struct image_bounds { int xmin, ymin, xmax, ymax; } image_bounds; #define IMAGE_BOUNDS(X) ((image_bounds *)(X)); typedef struct { image_bounds bounds; float dummy; } demo; int main(void) { demo my_image; /* this works fine */ ((image_bounds *)(&my_image))->xmin...
Hi, We are using a macro wrapper to Bind Where Parameter function. #define bindWhereClause(fieldName, fieldDataType, fieldData) _bindWhereClause(fieldName, fieldDataType, sizeof(fieldData), &fieldData) void _bindWhereClause(const char *name, int dataType, int dataSize, void *data) { // Implementation } Database.bindWhereClause( "FI...
Hi! Are there any good reasons (except "macros are evil", maybe) NOT to use the following macros ? #define DELETE( ptr ) \ if (ptr != NULL) \ { \ delete ptr; \ ptr = NULL; \ } #define DELETE_TABLE( ptr ) \ if (ptr != NULL) \ { \ delete[] ptr; ...
After reading another question about the use of macros, I wondered: What are they good for? One thing I don't see replaced by any other language construct very soon is in diminishing the number of related words you need to type in the following: void log_type( const bool value ) { std::cout << "bool: " << value; } void log_type( const ...
We use one big enum for message passing and there are optional parts of our code base that use specific messages that really only need to be added to the enum if those parts are to be compiled in. Is there a way to define a macro that could do this or something similar? I would like to be able to just add REGISTER_MSG(MESSAGE_NAME); to ...