If you have ever worked with extended MAPI I am sure that you have come across the need to use the win32 API function GetProcAddress. There is now a stub library over at codeplex and some sample code to show you how to get started with Office 2010 or 2007. The project includes sources if you are interested in seeing how it is built. In addition, for those looking for more comprehensive MAPI code samples, there is a really in depth sample at codeplex as well Called: MFCMAPI
Category Archives: Applications Development
.Net Trimming Whitespace in an image
In case you wanted to know, it’s not quite that difficult to trim pure white pixels from an image in .net. The crux of the problem is really getting access to the color data and understanding what you are looking at when you have it. I will be demonstrating a method using 24 bits per pixel images only, but the concepts can be applied to other types.
Continue reading
Breaking Down Space Invaders – A possible implementation in dot net
Breaking Down Space Invaders – A possible implementation in dot net
I have wanted to write a space invaders clone for a while, and thought to myself that it wasn’t really difficult at all, and I should write a blog about it. I am going to try and minimize the BS in order to keep the entry short enough and to the point.
Continue reading
Dot Net html editor to image
Dot Net html editor to image
While working on a commercial project, I was involved in providing a simple html rendering engine. Simple in terms of not being 100% complete, not necessarily in complexity. To help debug this, I created a sample app that demonstrates the workings of an html editor and the rendering in action.
Parsing Html with Web Browser Control
Parsing Html with WebBrowser Control
It is relatively easy to parse html with the WebBrowser for VB and C# or any other .net language. The trick with the WebBrowser Control is to first load a blank document into the control by using one of the following methods:
Reusing the WebBrowser Control
Reusing the WebBrowser Control
I have found the need in several projects as of late to reuse the WebBrowser Control in .net languages such as c#/vb.net. I have not ventured into the j# domain, but I have also played around with c++.net a little bit for various projects. There are a couple of things to keep in mind when reusing the control in different scenarios – most of which for my purposes do not include in a windows form for display purposes. For the most part making sure that there is a reference to System.Windows.Forms dll is in your References and making sure that the using or imports statements are also included this is a good first start.
Unexpected Error Adding new Data Connection in Visual Studio
Unexpected Error Adding new Data Connection in Visual Studio
Recently I was adding a Data Connection in Visual Studio, and I found that I kept getting an error message box whenever I tried.
There were a number of suggestions such as:
devenv.exe /reset
and doing a repair install which didn’t work.
RPC and WCF Samples Coming Soon
RPC and WCF Samples Coming Soon
In a later article, we will be providing source code and examples of simple RPC client/server and a WCF service/client using the Microsoft Visual Studio environment.
If you are looking for information regarding these technologies, post a message on our facebook page
OpenRPCDebugEndpointInfoEnumeration failed: 5
OpenRPCDebugEndpointInfoEnumeration failed: 5
If you have received this error using dbgrpc -e from windows debugging tools or the platform sdk, please use this program from within an administrators command prompt. For instance, if you have UAC activated, then right click on command prompt and left click on Run As Administrator.
WM_COPYDATA with .net and c
WM_COPYDATA with .net and c
WM_COPYDATA is a window message that you can use as a very simple ipc(Inter Process Communication) mechanism. There are some small issues to overcome when using this with .net, the least of which is the need to use the user32.dll in .net.
Dot Net Regular Expression Callback
Dot Net Regular Expression Callback
Want to learn how to use regular expression callbacks in dot net languages? The following examples will be using c# for starters but you can easily translate that to vb. Optionally if anyone requests I can translate that to VB and send it.
Continue reading
Capture Tab Key in dot net Textbox
Capture Tab Key in dot net Textbox
Although it would seemingly be a simple task to capture a tab to perform some special operation in a form like say – begin a processing thread or something like that, it is not necessarily straight forward.
Where to find sos.dll
Where to find sos.dll
If you are looking where to find sos.dll, please check the following locations before you download windebug tools:
C:\Windows\Microsoft.NET\Framework\v2.0.50727
C:\Windows\Microsoft.NET\Framework\v4.0.30319
For Details on why this may be missing in other framework versions see:
ASP.net SQL Vulnerabilities
In case anyone hasn’t been bashed over the head enough with SQL Injection strategies and mitigation, lets have a quick look at the simplest methods.
EM_UNIVERSAL_ARGUMENT undeclared – Building Asterisk 1.8.2 on Solaris 10 x86
EM_UNIVERSAL_ARGUMENT undeclared – Building Asterisk 1.8.2 on Solaris 10 x86
When building on Solaris there are a few Rules to follow and these are shared with regular building as well, but sometimes there are some particularities
Sqlite Hashing Functions Library
Looking for Sqlite Hashing Functions Library? Look No Further!
I have found a way to quite easily use the existing digest functions provided by OpenSSL. I have successfully been able to compile and run this on Solaris 10×86 and I think that as long as you have a current ssl implementation, this should work quite well. I have not thoroughly tested everything however, but have repeated the EVP_ function code pattern found here. This pattern is very simple and easy to use. I have also used a code pattern for a sample Sqlite3 Extension from here. As it is, the documentation is good enough to perform the simple task a few times and at a minimum for my implementation include these algorithms: md2, md5, sha, sha1, ripemd160.
Code Pattern for the Sqlite Extension
static void [function_name]( sqlite3_context *context, int argc, sqlite3_value **argv ){ unsigned char md_value[EVP_MAX_MD_SIZE]; int md_len,i; if ( argc != 1 ){ sqlite3_result_null(context); return ; } EVP_MD_CTX ctx ; EVP_MD_CTX_init(&ctx); if(EVP_DigestInit_ex(&ctx,EVP_[function_name](),NULL)){ char * input = 0 ; char * output = 0 ; input = ( char * ) sqlite3_value_text(argv[0]); EVP_DigestUpdate(&ctx, input, strlen(input)); EVP_DigestFinal_ex(&ctx,md_value,&md_len); output = ( char * ) malloc ( md_len * 2 + 1 ); if ( !output ){ sqlite3_result_null(context); EVP_MD_CTX_cleanup(&ctx); return ; } for (i = 0; i < md_len; i++){ sprintf (&output[i*2],"%02x", (unsigned char)md_value[i]); } sqlite3_result_text(context,output,strlen(output),(void*)-1); free(output); output=0; }else{ sqlite3_result_null(context); } EVP_MD_CTX_cleanup(&ctx); }
Sqlite Init Function
int sqlite3_extension_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi) sqlite3_create_function(db, "md2", 1, SQLITE_ANY, 0, md2, 0, 0); sqlite3_create_function(db, "md5", 1, SQLITE_ANY, 0, md5, 0, 0); sqlite3_create_function(db, "sha", 1, SQLITE_ANY, 0, sha, 0, 0); sqlite3_create_function(db, "sha1", 1, SQLITE_ANY, 0, sha1, 0, 0); // ** Not Used as it didn't seem to be available in my OpenSSL // sqlite3_create_function(db, "mdc2", 1, SQLITE_ANY, 0, mdc2, 0, 0); sqlite3_create_function(db, "ripemd160", 1, SQLITE_ANY, 0, ripemd160, 0, 0); return 0; }
Command Line Used for Compilation
The command line I used to compile was quite simple and just needed to include the -lssl .
gcc -shared -fPIC -Isqlite3 -lssl -o sqlite_digest.ext sqlite_digest.c
My set up includes sqlite and openssl in my include path so there may be issues if this is not your set up.
Loading the library in Sqlite
To load the library in Sqlite, you simply need to run the command line version as follows:
sqlite3 [optional database name] sqlite>SELECT load_extension('./sqlite_digest.ext'); sqlite>SELECT md2('test'); dd34716876364a02d0195e2fb9ae2d1b sqlite>SELECT md5('test'); 098f6bcd4621d373cade4e832627b4f6 sqlite>SELECT sha('test'); f8d3b312442a67706057aeb45b983221afb4f035 sqlite>SELECT sha1('test'); a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 sqlite>SELECT ripemd160('test'); 5e52fee47e6b070565f74372468cdc699de89107
Source Code
New Updated Link
Source Code to Sqlite Hashing Functions Library
SwhistleSoft Downloads
Gzip Headers in Php Output
Gzip Headers in Php Output
I have noticed wierd binary characters being generated after var_dump of ( $_POST, $HTTP_POST_VARS, and $_REQUEST ) when debugging CMS code. Before these characters there were empty array(0){} statements in the output.