<sig Type=Disclaimer>UPFRONT DISCLAIMER:(©FarligOpptreden 2009) Don't like my code, speak to them.</sig>
<sig Type=PimpMySticky>Need help with .NET?</sig>
Right, lets hope the right person with the correct permissions responds to my humble little request...
EDIT: W00t! It's done!
Last edited by FarligOpptreden; 29-09-2009 at 11:17 AM.
SCubed: Human Capital Management
Originally Posted by Crossbearer
UPFRONT DISCLAIMER © 2009 FarligOpptreden
Export data to Office 2007's XML-based formats:
Right, so you, like many other developers, have grown sick and tired of using the terrible (and mostly redundant) Office Interop APIs to create Excel and Word documents from your precious data... There is a solution in the form of OpenXML. If you didn't know it already, all Office 2007 XML-based documents are essentially an archived file filled with XML files. Don't believe it? Try renaming any .docx or .xlsx file to .zip and extract the contents to a folder. Ta-dah! Study the directory and file structure a bit, especially the .rels files, which indicate the relationship of all the files in the archive.
So, a more scalable solution to exporting Excel and Word files in the Office 2007 XML format, is to build up the necessary XML files in the correct directory structure, zip them up and rename to .docx or .xlsx (depending on the type of document you just created, obviously). By conforming to the different Markup Languages specified in the OpenXML framework (i.e. WordML for Word Documents and SpeadsheetML for Excel Spreadsheets) you can easily export any of the data in your application to document formats that business users are constantly badgering you for...
You might be wondering how on earth you are going to zip up the files from C#, right? Have a look at the SharpZipLib .NET Zip Library. It works wonders.
So, what's the best thing about this solution? You don't need Office installed on the client or server computer! You might be concerned about the fact that about 75% of your target market might still be stuck on Office 2003, right? Well, that's not necessarily a problem anymore... Just redirect the users here and they will be basking in the OpenXML document glory in no time!
Last edited by FarligOpptreden; 29-09-2009 at 03:19 PM.
SCubed: Human Capital Management
Originally Posted by Crossbearer
UPFRONT DISCLAIMER © 2009 FarligOpptreden
WinForms
General
- Populating Controls using a Background Thread
- RCM v1.2 - Theming library: Customize the Appearance of Forms and Common Controls
- Windows 7 : New Features Explained Using .NET
Inter-Form Communication
- Passing Values between Forms in .NET 1.x with C# and VB.NET examples
- Using delegates to communication between windows forms
- How To:Creating Dialogs in .NET
Notify Icon AKA System Tray Icon
- Notify Icon control in .NET 2.0 with balloon tips
- SystemTrayNotifyIcon with Event Generator <- If you want to animate your NotifyIcon
Application/User Settings
Win32 API
Last edited by dequadin; 11-01-2010 at 12:25 PM.
<sig Type=Disclaimer>UPFRONT DISCLAIMER:(©FarligOpptreden 2009) Don't like my code, speak to them.</sig>
<sig Type=PimpMySticky>Need help with .NET?</sig>
I'll see if I can dig up some resources for WinForms on creating custom-look menus. Struggled with it a few years ago and it's bound to be useful to someone...
SCubed: Human Capital Management
Originally Posted by Crossbearer
UPFRONT DISCLAIMER © 2009 FarligOpptreden
Real world tip for n00bs: If you ask for advice, be prepared to follow it before commenting about how it won't work. Experienced programmers take the time out of their day to help you. Try it. If it doesn't work or you don't understand why they suggested the advice or piece of code, please feel free to ask them about it. Some code won't compile because most help will be in the form of pseudo code. It's up to you to interpret this into something workable for yourself.
Remember, programming is not about language. It's about logic. If you understand the logic, you can apply it to any language of programming you desire. If you expect others to give you working code for a problem they couldn't give two ****s about, don't whine about it.
Last edited by AcidRaZor; 01-10-2009 at 04:16 PM.
http://www.ajaxload.info/
For all your loading images' needs
SCubed: Human Capital Management
Originally Posted by Crossbearer
UPFRONT DISCLAIMER © 2009 FarligOpptreden
What do you expect the output of this program to be?
Code:using System; class Foo { public Foo(string s) { Console.WriteLine("Foo constructor: {0}", s); } public void Bar() { } } class Base { readonly Foo baseFoo = new Foo("Base initializer"); public Base() { Console.WriteLine("Base constructor"); } } class Derived : Base { readonly Foo derivedFoo = new Foo("Derived initializer"); public Derived() { Console.WriteLine("Derived constructor"); } } static class Program { static void Main() { new Derived(); } }
"The oldest and strongest emotion of mankind is fear, and the oldest and strongest kind of fear is fear of the unknown" - H.P. Lovecraft
SCubed: Human Capital Management
Originally Posted by Crossbearer
UPFRONT DISCLAIMER © 2009 FarligOpptreden
nope, if you knew the answer you would also know the why* it is so and that is knowledge to share or is it ?
*spoiler warning
well i suppose i should rather just link the tut, pleads mini guilty....
Last edited by Pr⊕phet; 02-10-2009 at 03:02 PM.
"The oldest and strongest emotion of mankind is fear, and the oldest and strongest kind of fear is fear of the unknown" - H.P. Lovecraft
Lambda, Lambda, Lambda - Uncovering the Mystery Behind Lambda ExpressionsIntroduction
At first glance, a lambda expression looks like something your professor may have written on the blackboard in calculus class, but in reality, it is "syntactic sugar" built into the C# language over delegates. In this article, we will begin to explore the nuances of lambda expressions by seeing how they they relate to delegates and how they can be used to implement a popular mathematical formula, the quadratic equation.
"The oldest and strongest emotion of mankind is fear, and the oldest and strongest kind of fear is fear of the unknown" - H.P. Lovecraft
A simple code snippet to compile a piece of C# code at runtime into an executable, saved at the specified path. The sample adds the necessary assembly files to compile a Windows Application:
After the code is executed, the "results" variable will contain any compiler errors, so you can easily iterate through the errors to see what went wrong.Code:Microsoft.CSharp.CSharpCodeProvider provider = new Microsoft.CSharp.CSharpCodeProvider(); System.CodeDom.Compiler.CompilerParameters compiler_params = new System.CodeDom.Compiler.CompilerParameters(); compiler_params.OutputAssembly = path; compiler_params.GenerateExecutable = true; compiler_params.ReferencedAssemblies.Add("System.dll"); compiler_params.ReferencedAssemblies.Add("System.Drawing.dll"); compiler_params.ReferencedAssemblies.Add("System.Windows.Forms.dll"); System.CodeDom.Compiler.CompilerResults results = provider.CompileAssemblyFromSource(compiler_params, source);
SCubed: Human Capital Management
Originally Posted by Crossbearer
UPFRONT DISCLAIMER © 2009 FarligOpptreden
Dynamically Compiled Assemblies
Last edited by dequadin; 11-01-2010 at 12:00 PM.
<sig Type=Disclaimer>UPFRONT DISCLAIMER:(©FarligOpptreden 2009) Don't like my code, speak to them.</sig>
<sig Type=PimpMySticky>Need help with .NET?</sig>
.NET and COM Interop
General .NET COM Articles/Tutorials
- COM Interoperability in .NET Framework: Part I.
- Understanding Classic COM Interoperability With .NET Applications.
- Exposing .NET Components to COM.
- Building COM Objects in C#.
- Calling Managed .NET C# COM Objects from Unmanaged C++ Code.
- Native & Managed Interop Made Simple.
- Using .NET Assembly with COM Client.
- Moserware: Using Obscure Windows COM APIs in .NET
- COM Interoperability in .NET Part 1 Part 2 Prt 3
- COM Interop Part 1: C# Client Tutorial Part 2: C# Server Tutorial
- Calling a COM Component From C# (Late Binding)
- Building COM Objects in C#
MSDN on .NET & COM
- COM Interop Tutorials (C#)
- Exposing .NET Framework Components to COM
- Interop Marshaling
- Advanced COM Interoperability
- How to: Register a Component for COM Interop
ActiveX in .NET
- Internet Explorer ActiveX Control C# Class Library
- Create ActiveX in .NET Step by Step.
- Dynamically adding ActiveX controls in managed code.
- Exposing Windows Forms Controls as ActiveX controls.
- Importing and Extending ActiveX Controls in .NET.
- C# Tutorials - ActiveX With C#
- CodeGuru: Extensible OLE Property Pages in .NET
- Writing an ActiveX Control in .NET
- ActiveX Controls in the .NET Compact Framework 2.0
- Hosting Windows Forms Controls in COM Control Containers - O'Reilly Media
<sig Type=Disclaimer>UPFRONT DISCLAIMER:(©FarligOpptreden 2009) Don't like my code, speak to them.</sig>
<sig Type=PimpMySticky>Need help with .NET?</sig>
Bookmarks