Background
We are developing some in-house utilities using ASP.NET 2.0. One of which is extracting some information from databases and building an Excel workbook containing a number of spreadsheets with data based on queries into the database.
Problem
The proof-of-concept prototype (a simple ASP.NET page that queries a single item fro...
Vista has introduced a new API to display a text in the list view control when it doesn't have any items. As the MSDN library states, I should process the LVN_GETEMPTYMARKUP notification.
In the inherited ListView control the WndProc method is overriden:
protected override void WndProc(ref Message m) {
try {
if(m.Msg == 78 /* WM_...
I have a C++ API prototype
void Func(int& size);
How can I translate it to P/Invoke in C#?
From what I know, if I use
public static extern Func(ref int size);
, the function will receive a pointer to the int instead of the value.
...
I would like to search the bodies of all outlook items. I know how to do this for the four PIM items (Notes/Tasks/Appointments/Contacts). But the code is identical for all of them with the exception of casting the COM object to the specific item type (i.e., ContactItem, AppointmentItem, etc). Is there a parent class for these PIM items...
I need to do some process injection using C++ but I would prefer to use C# for everything other than the low level stuff. I have heard about "function wrapping" and "marshaling" and have done quite a bit of google searching and have found bits of information here and there but I am still really lacking.
Things I have read in order of u...
When working with window handles, is it good enough to use the plain IntPtr or should I subclass SafeHandle?
Are there any significant pros/cons?
Thanks.
...
I have a Browser Helper Object project in c# that (obviously) references shdocvw.dll. I think I want to create a strongly named interop dll for shdocvw.dll. How do I do this - I've seen a bunch of suggestions out there with aximp.exe and tlimp but I'm not clear how they fit together.
...
I'm using Interop.Domino.dll to retrieve E-mails from a Lotus "Database" (Term used loosely). I'm having some difficulty in retrieving certain fields and wonder how to do this properly. I've been using NotesDocument.GetFirstItem to retrieve Subject, From and Body.
My issues in this regard are thus:
How do I retrieve Reply-To address...
I'd like to include custom .Net controls and .Net forms within MS Access.
It's possible but I was wondering if there was any new good articles on that subject.
Over time I've found a few related to the subject the but always found the process a bit cumbersome (see references below).
One of the issue is deployment:
my user's machines hav...
I have the following in a program (written in VB.NET):
Imports Microsoft.Office.Interop.Excel
Public Class Form1
Dim eApp As New Excel.Application
Dim w As Excel.Workbook
w = eApp.Workbooks.Open( "path.xls", ReadOnly:=True)
.. Processing Code ..
//Attempts at killing the excel application
w.Close()
eApp.Work...
Using Managed C++ (VS 2005), how would you pass a array< unsigned char > to a function as a unsigned char*?
ref class Utils
{
public:
static void A(array<unsigned char, 1> a)
{
//How do I call B()????
}
static void B(const unsigned char* a)
{
//do stuff
}
};
...
Hi!
Is there some smart way to retreive the installation path when working within a dll (C#) which will be called from an application in a different folder?
I'm developing an add-in for an application. My add-in is written in C#. The application that will use is written in C and needs to compile some stuff during evaluation, so I have ...
Hi,
I'm using the Outlook 2003 PIA and VS 2005 to access items in a public folder. The item.UserProperties collection always comes back empty, despite the items having several user defined fields.
If I add a property in code using UserProperties.Add, it is saved correctly with the item and is then available in the UserProperties next ...
There is very strange assembly reference problem and loading problem I experience with my Outlook addin. Here are the detail (a long story :) ):
I have an old Outlook addin, written and build using .Net 1.1. The addin is loaded using an unmanaged shim in its own application domain. It works OK, with .Net 2.0, even if 1.1 is not present ...
I am trying o load a custom font in C#, so it is usable by COM libraries (like ESRI) and by GDI+.
I want to load the font from disk and don't want to install the font on the system.
COM font is of type stdole.IFontDisp.
EDIT: using in AddFontResourceEx combination with the PrivateFontCollection solves the issue.
...
I'm developing a script that involves creating an email contact, and forwarding mail to that contact. Last part of the script is to automatically send a test email to the address to make sure the forwarding works.
So I use the following code:
[void] [Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Core")
$olApp = new-object...
I've created a .Net library at work that is used by all of our developers. The security part of it uses Microsoft AzMan for the security backend. In order to create a security (AzMan) ClientContext I have to pass it a token value (as a uint). This is all fine an dandy until I needed to make a COM wrapper for our common library so some of...
I've read many of the other threads here about managing COM references while using the .Net-Excel interop to make sure the Excel process exits correctly upon exit, and so far the techniques have been working very well, but I recently came across a problem when adding new worksheets to an existing workbook file.
The code below leaves a z...
I have a Winform with a BackgroundWorker. The BackgroundWorker, among other things, has to make an HTTP call to a page, fill out some data, submit the form, and retrieve the HTML that comes back after "clicking" the submit button. I've run into a number of roadblocks while doing this:
Can't POST the data because the target webserver do...
I was wondering what I could do to improve the performance of Excel automation, as it can be quite slow if you have a lot going on in the worksheet...
Here's a few I found myself:
ExcelApp.ScreenUpdating = false -- turn off the redrawing of the screen
ExcelApp.Calculation = Excel.XlCalculation.xlCalculationManual -- turning off the ca...