Skip to main content

Posts

Showing posts with the label Programming

Xamarin Studio: F# project does not work with message "Build failed. MSBuild operation failed"

Followed installation instruction from  http://fsharp.org/use/windows/  to install F# using option #2. Installation was not smooth (could be because of my internet connection). Retried several times with few workarounds (delete corrupted files, install files manually, etc). Tried to create a new F# project with all default values, running it failed with the message Build failed. MSBuild operation failed Build: 1 error, 0 warnings Took me several days (tried several minutes a day to check logs, tweak settings, etc). Finally found a workaround. In Project | [project] Options | Main Settings , ensure that " Use MSBuild build engine (recommended for this project type) is unchecked . Tags: F# Xamarin Studio Windows 8.1

Excel 2013 enable developers toolbar

Do File | Options | Customize Ribbon | select Developer option.

SHGetFolderLocation C++ sample code

Original code is from MSDN . Sample code demonstrates how to use  SHGetFolderLocation in C++. #include #include #include #include int main() {     IShellFolder *psfParent = NULL;     LPITEMIDLIST pidlSystem = NULL;     LPCITEMIDLIST pidlRelative = NULL;     STRRET strDispName;     TCHAR szDisplayName[MAX_PATH];     HRESULT hr;     hr = SHGetFolderLocation(NULL, CSIDL_DESKTOP, NULL, NULL, &pidlSystem);     if (!SUCCEEDED(hr))     {         std::cout << "hr bad" << std::endl;         return -1;     }     hr = SHBindToParent(pidlSystem, IID_IShellFolder, (void **) &psfParent, &pidlRelative);     if(SUCCEEDED(hr))     {         hr = psfParent->GetDisplayNameOf(pidlRelative, SHGDN_NORMAL, &strDispName);         hr = StrRetToBuf(&strDispName, pidlSystem, szDisplayName, sizeof(szDisplayName));         std::wcout << "SHGDN_NORMAL - " < << '\n';     }     psfParent->Release();     CoTaskMemFree(pidlSyste

SHGetFolderLocation

Sample code on how to use SHGetFolderLocation, shamelessly copied from this link . This code was verified to work in Windows 2000 and VB SP6. Private Declare Function SHGetFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, ByVal hToken As Long, ByVal dwReserved As Long, ppidl As Long) As Long Private Declare Function SHBrowseForFolder Lib "shell32.dll" (lpbi As BROWSEINFO) As Long Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal pv As Long) Private Type BROWSEINFO hwndOwner As Long pidlRoot As Long pszDisplayName As String lpszTitle As String ulFlags As Long lpfn As Long lParam As Long iImage As Long End Type Private Sub Command1_Click() ' This code is licensed according to the terms and conditions listed here. ' Open the Browse

Converting CString to CComBSTR

Code below shows how to convert CString to CComBSTR. // CComBSTR.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include int _tmain(int argc, _TCHAR* argv[]) { CComBSTR szDbgMsg; CString sMsg; sMsg = _T("Hello world new"); sMsg.Format(_T("%s : %d"), sMsg, 12); //szDbgMsg = L"Hello world "; szDbgMsg = sMsg.GetBuffer(); CW2A printstr(szDbgMsg); std::wcout << ((CString)szDbgMsg).GetBuffer() << std::endl; std::wcout << sMsg.GetBuffer() << std::endl; return 0; } ~ts

List all installed applications in a machine

The script below will list and save all installed applications to a csv file. Save the script as say, save.vbs. Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile("c:\software.csv", True) strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery _ ("Select * from Win32_Product") objTextFile.WriteLine "Caption" & vbtab & _ "Description" & vbtab & "Identifying Number" & vbtab & _ "Install Date" & vbtab & "Install Location" & vbtab & _ "Install State" & vbtab & "Name" & vbtab & _ "Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _

Office 2007 RibbonX resources

Custom UI Editor : Custom UI Editor for Open XML file format. XML Notepad 2007 provides a simple intuitive user interface for browsing and editing XML documents. 2007 Office System: XML Schema Reference RibbonX Resources blog by Savraj Dhanjal. Customizing the 2007 Office Fluent Ribbon for Developers ( Part 1 of 3) Customizing the 2007 Office Fluent Ribbon for Developers ( Part 2 of 3) Customizing the 2007 Office Fluent Ribbon for Developers ( Part 3 of 3) 2007 Office System Document: UI Style Guide for Solutions and Add Ins VSTO version 3.0 How To Create Office COM Add-Ins by Using VBA and Office Developer ~ts

Enable SVN access to Sourceforge project

SVN repository is not enabled by default when creating a project in SourceForge . To enable SVN is easy. Go to the summary page, see below for sample screen shot, then hover to Admin tab. You should see the screen below, then just enable "The following box should be checked to enable Subversion" and Update and off you go. Enjoy! TS

TestPartner .Net Fusion

Yesterday, I came across a Microsoft website discussing .Net and Visual Basic 6.0 integration, they dubbed this as VB Fusion . Skimming through the documentation, I came to realize that most of these stuff can be used in TestPartner. That is where my journey into the world of .Net with TestPartner, which I dubbed as TestPartner .Net Fusion, comes alive. I am planning on making this as a series of blogs discussing the ins and outs of integrating .Net functionality into TestPartner 6.1.x. For this blog post will try to get our hands wet into the world of .Net integration using System assembly. In fact, what we will do is re-implement what's being dicussed in this site into TestPartner. In a nutshell, we want to display an image downloaded automatically from  Space Science and Engineering Center, University of Wisconsin-Madison . We'll grab the latest photo from the east coast of the United States using the System assembly. So let us create a new form in Common project in T

Windbg stack tracing

This is a very crude documentation only. If you got "Module load completed but symbols could not be loaded for....." do the following to investigate: kd> !sym noisy kd> .reload This should pin point why debug symbols are not being loaded. To use the Microsoft Symbol Server 1. Make sure you have installed the latest version of Debugging Tools for Windows. 2. Start a debugging session. 3. Decide where to store the downloaded symbols (the "downstream store"). This can be a local drive or a UNC path. 4. Set the debugger symbol path as follows, substituting your downstream store path for DownstreamStore. SRV*d:\msdndebug*http://msdl.microsoft.com/download/symbols This will download debug symbols to d:\msdndebug automatically. If you got "Couldn't load mismatched pdb for appname.exe", you can force Windbg to load the pdb file via : kd> .symopt 0x40 kd> .reload To check if the symbols match: #>!itoldyouso bff c:\path\bin\bff

Programming icons

"Packaging is the product itselft." This is the matra for most marketing folks. This is no different in designing user interfaces for customer use. Selecting a nice set of icons then becomes a serious issue if the product is for general public consumption. This complicates even more for small shops or one man team designing software solutions. Thanks to the current revolution in software development... open source, creative commons and the likes. Listed below are some icon set that are either LGPL, CCA or etc. Ximian icon sets License : LGPL The icons are being used in OpenOffice and Ximian Desktop 2 Silk Icon set License : Create Commons Attribution 2.5 License “Silk” is a smooth, free icon set, containing over 700 16-by-16 pixel icons in strokably-soft PNG format. Containing a large variety of icons, you're sure to find something that tickles your fancy. And all for a low low price of $0.00. You can't say fairer than that. ~ts~

Free Compilers from Borland

Direct link to free version of the compilers ftp://ftpd.borland.com/download/turbo/English/Delphi_Explorer/TurboDelphi.exe ftp://ftpd.borland.com/download/turbo/English/Delphi_.NET_Explorer/TurboDelphi4Net.exe ftp://ftpd.borland.com/download/turbo/English/C++_Explorer/TCPP_EXPL_EN_DL.exe ftp://ftpd.borland.com/download/turbo/English/Csharp_Explorer/TurboCsharp.exe Pre-requisites can be found here ftp://ftpd.borland.com/download/bds/bds_2006_trial/english/arch/disk2/prereqs.zip Official website of the turbo products can be found here . Important information: User can create commercial application using Turbo products