How do I intercept a paste event in an editbox?
How do I intercept a paste event in an editbox, possibly before the value is transferred to the object? ...
How do I intercept a paste event in an editbox, possibly before the value is transferred to the object? ...
This isn't a holy war, this isn't a question of "which is better". What are the pros of using the following format for single statement if blocks. if (x) print "x is true"; if(x) print "x is true"; As opposed to if (x) { print "x is true"; } if(x) { print "x is true"; } If you format your single statement ifs without...
I've been somewhat spoiled using Eclipse and java. I started using vim to do C coding in a linux environment, is there a way to have vim automatically do the proper spacing for blocks? So after typing a { the next line will have 2 spaces indented in, and a return on that line will keep it at the same indentation, and a } will shift b...
Here is a test case: void foo(int i, int j) { printf("%d %d", i, j); } ... test = 0; foo(test++, test); I would expect to get a "0 1" output, but I get "0 0" What gives?? ...
An example of unspecified behavior in the C language the the order of evaluation of arguments to a function. It might be left to right or right to left, you just don't know. This would affect how foo(c++, c) or foo(++c, c) gets evaluated. What other unspecified behavior is there that can surprise the unaware programmer? ...
I'm looking for an extremely fast atof() implementation on IA32 optimized for US-en locale, ASCII, and non-scientific notation. The windows multithreaded CRT falls down miserably here as it checks for locale changes on every call to isdigit(). Our current best is derived from the best of perl + tcl's atof implementation, and outperform...
When asking about common undefined behavior in C, souls more enlightened than I referred to the strict aliasing rule. What are they talking about? ...
How do I write a cpp macro which expands to include newlines? ...
I am retrieving multiple rows into a listview control from an ODBC source. For simple SELECTs it seems to work well with a statement attribute of SQL_SCROLLABLE. How do I do this with a UNION query (with two selects)? The most likely server will be MS SQL Server (probably 2005). The code is 'c' for the Win32 API. This code sets (wha...
My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem." ...
I am working with a very large code in C/C++. Indexing and referencing is a must in this environment. What tools would you recommend for viewing/browsing the code? Preferably open source. I tried CDT for indexing but it is useless. Other tools I've tried is cscope, but it does not work well with C++... ...
I'm trying to automate a gdb session using the --command flag. I'm trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL) . My cmds.gdb looks like this: set args /home/shlomi/conf/bugs/kde/font-break.txt b IA__FcFontMatch r However, I'm getting the following: shlomi:~/progs/bugs-external/kde/font...
A rather comprehensive site explaining the difficulties and solutions involved in using a dll written in c/c++ and the conversion of the .h header file to delphi/pascal was posted to a mailing list I was on recently, so I thought I'd share it, and invite others to post other useful resources for this, whether they be links, conversion to...
Per man pages, snprintf is returning number of bytes written from glibc version 2.2 onwards. But on lower versions of libc2.2 and HP-UX, it returns a positive integer, which could lead to a buffer overflow. How can one overcome this and write portable code? Edit : For want of more clarity This code is working perfectly in lib 2.3 if...
I cannot understand the Oracle documentation. :-( Does anybody have any pointers to an example how to fetch multiple rows of simple data from Oracle via OCI? I currently use OCIDefineByPos to define single variables (I only need to do this for simple integers -- SQLT_INT/4-byte ints) and then fetch a single row at a time with OCIStmtEx...
When I used to write libraries in C/C++ I got into the habit of having a method to return the compile date/time. This was always a compiled into the library so would differentiate builds of the library. I got this by returning a #define in the code: C++: #ifdef _BuildDateTime_ char* SomeClass::getBuildDateTime() { return _Buil...
For IronPython there is a project - IronClad, that aims to transparently run C extensions in it. Is there a similiar project for Jython? ...
What is the most efficient way given to raise an integer to the power of another integer in C? // 2^3 pow(2,3) == 8 // 5^5 pow(5,5) == 3125 ...
What sort of registration frameworks are available for C / C++ applications? I'm looking for a library that will handle the cryptographic verification of license and registration keys to enable the full features of an application, and optionally disable features after a specified time interval has elapsed. For example, on the Mac one m...
If by some miracle a segfault occurs in our program, I want to catch the SIGSEGV and let the user (possibly a GUI client) know with a single return code that a serious problem has occurred. At the same time I would like to display information on the command line to show which signal was caught. Today our signal handler looks as follows...