.NET
Development Blog moved …
by admin on Aug.26, 2010, under .NET, Mac, OpenOffice, Smalltalk, Unix and Linux
I moved my development blog to schrievkrom.wordpress.com … my more private posting will stay at www.schrievkrom.de
Team Foundation Server - Source Control - too difficult ?
by admin on Jun.17, 2010, under .NET
I’ve worked with binary source code repositories over the last 20 years - and now I tried to switch to Team Foundation Server and I get the feeling, that this stuff is pretty difficult - and when this technology is broken - then your are in trouble …
When I tried to install TFS2010 together with VS2010 I tried to create a new project and all I got was the following error message:
Error
TF30004: The New Team Project Wizard encountered an unexpected error while initializing the Microsoft.ProjectCreationWizard.TestManagement plug-in.
Explanation
TF30171: The Microsoft.ProjectCreationWizard.TestManagement plug-in used to create the new team project could not be initialized and returned the following error: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.OLE.Interop.IServiceProvider'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{6D5140C1-7436-11CE-8034-00AA006009FA}' failed due to the following error: Schnittstelle nicht unterstützt (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))..
User Action
Contact your Team Foundation Server administrator.
and here is the dialog.

Any idea, what it could be ? (Software here: TFS 2010, VS2010, W7 Home Premium 64 Bit).
Printing under C# and OpenOffice
by admin on Aug.14, 2009, under .NET, OpenOffice
We have an application which uses OpenOffice (3.0/3.1) under Windows and .NET 3.5 more or less as a reporting tool. Whatever I do I did not manage to get printing done in a reliable way, that works for hundreds of reports (one page size).
I tried API way, I tried dispatcher way - more or less I noticed, that my C# application simply hangs at some points (in the print() method):
XPrintable aPrintableDocument = (XPrintable)this._aOOTextDocHelper.mxDocument;
PropertyValue[] propValues = new PropertyValue[1];
propValues[0] = new PropertyValue { Name = "Name", Value = new Any(theSetting.PrinterName)};
aPrintableDocument.setPrinter(propValues);
propValues = new PropertyValue[2];
propValues[0] = new PropertyValue { Name = "CopyCount", Value = new Any((short) theSetting.CopiesToPrint) };
propValues[1] = new PropertyValue { Name = "Wait", Value = new Any(true)};
aPrintableDocument.print(propValues);
Very often the system hangs then in the last line …. and the printer shows, that second job is going to be
added and the state information shows “In Warteschlange”. Number of pages are N/V. This continues for several
minutes and then the job finshed.
Yesterday I changed the printing method to:
XPrintable aPrintableDocument = (XPrintable)this._aOOTextDocHelper.mxDocument;
PropertyValue[] propValues = new PropertyValue[1];
propValues[0] = new PropertyValue { Name = "Name", Value = new Any(theSetting.PrinterName)};
aPrintableDocument.setPrinter(propValues);
propValues = new PropertyValue[2];
propValues[0] = new PropertyValue { Name = "CopyCount", Value = new Any((short) theSetting.CopiesToPrint) };
// !!! false !!!!
propValues[1] = new PropertyValue { Name = "Wait", Value = new Any(false)};
// check for ending
bool abort = false;
while (!abort)
{
System.Threading.Thread.Sleep((100));
PropertyValue[] stateValues = aPrintableDocument.getPrinter();
for (int index = 0; index < stateValues.Length; index++)
{
PropertyValue aValue = stateValues[index];
if (aValue.Name == "IsBusy")
{
abort = !(bool)aValue.Value.Value;
break;
}
}
}
And problems were reduced radically.
I am not sure if this is a reliable solution, but it works much better, that with wait=true, which is published as a standard way.