Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008


all groups > dotnet interop > april 2006

Filter by week: 1 2 3 4 5

Error entring values the cells in Excel from the VS 2005 env
Posted by tomer at 4/30/2006 8:07:01 AM
when running the following code in the VS 2005 environment (AxWebBrowser1 is a microsoft web browser): Public Class Form1 Dim WB As Microsoft.Office.Interop.Excel.Workbook Private Sub AxWebBrowser1_NavigateComplete2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_...more >>

Re: Use Native COM Servers with CRCWs
Posted by jaffy at 4/29/2006 7:36:01 PM
Article: http://msdn2.microsoft.com/en-us/library/f31k2c87.aspx This article and the other 3 related ones (about TLBIMP) have lost me. In this explanation, I don't need to generate another assembly from quartz.dll, but I do need a type library, which I believe is quartz.tlb in this case. ...more >>

.NET 1.1 / 2.0 Side-By-Side Interop
Posted by Thomas S. Trias at 4/28/2006 10:12:01 AM
I have a web service proxy developed in .NET 1.1. It is used by traditional ASP, and I have some test projects that use it in other COM environments. We are migrating to VS 2005 / .NET 2.0, so I installed VS 2005 (which installed .NET 2.0). I can still access almost every property or meth...more >>

Problems creating v2.0 Interop for third party product
Posted by Dick at 4/28/2006 2:59:01 AM
I'm trying to create a v2.0 interop for a third party product. We managed to do this achieve this with v1.1 and have been using it succesfully for a few years now. But with v2.0 TlbImp gives the following messages (I've included them all but I guess the last couple are the important ones). Tha...more >>

should vb dll be packaged for interop
Posted by Debi at 4/27/2006 11:19:02 PM
Hi, I'm referencing a vb dll from my .net windows application. When I deploy this application to the client's machine should I include this dll, or is the interop dll that vb creates enough? If I have to include the vb dll, do I have to register the dll using regsvr32? Thanks in Advan...more >>

Deploying Office 2003 Add-ins with W2K and VS.Net 2003
Posted by mac7attack NO[at]SPAM gmail.com at 4/27/2006 2:49:25 PM
Hello, I have written an Outlook add-in in Visual Studio .net 2003 and installed it on the machine it was built on. I need to be able to deploy this add-in to about 6 other computers. I tried to install the MSI package on another computer. This installation went through fine but the add-in is...more >>

excel 2003 not using latest framework for com interop
Posted by vomacka NO[at]SPAM gmail.com at 4/27/2006 11:28:35 AM
I am having some trouble running a 2.0 assembly from an excel VBA macro (unmanaged code). Essentially, on some machines, excel (2000 and 2003) defaults to using the 1.1 framework to load assemblies even though the 2.0 framework is installed. I've seen this on Win 2000 and XP machines with and ...more >>

Memory allocation in C# callback
Posted by mortb at 4/27/2006 10:41:43 AM
Hi! I'm writing a C# program that uses a dll-library called libmng. The library relies heavily on callback fucntions. To use it you have to provide callbacks for memory allocation ammongst other things. Using Marshal.AllocHGlobal memroy allocation seems to work ok, but I get wierd errors t...more >>



Why does WINSPOOL GetPrinter show different job counts on different computers?
Posted by Lee Gillie at 4/26/2006 2:18:32 PM
I am interoping WINSPOOL, and retrieving LEVEL 2 info for each printer using GetPrinter. On two W2K computers it correctly returns the number of jobs waiting in the queue for the paused printer, and the paused status. On two W2003 computers, however, it always shows ZERO JOBS waiting to prin...more >>

passing umanaged void * to managed c++
Posted by JasonD at 4/26/2006 1:55:01 PM
I'm exporting a method from a managed C++ DLL using __declspec(dllexport) so that I can call it from a plain old C app. This method takes as one of its arguments a void * that comes from the C app. I store this void * in one of the members of my managed C++ class. Since the void * is from...more >>

VB6 app with .Net 1.1 and .Net 2.0 controls?
Posted by holysmokes99 NO[at]SPAM hotmail.com at 4/26/2006 1:44:23 PM
I am working on a large project that currently is based primarily in VB6. There are a number of .Net 1.1 assemblies that are used and registered via regasm in the VB6 application. Is it possible to also use 2.0 assemblies in the same VB6 app, or can only one .Net framework be loaded at any time?...more >>

Callback not being called
Posted by Bruce Parker at 4/26/2006 10:15:02 AM
Below is some sample unmananged C++ code and managed C# code. The callback does not fire when invoked from the timer in the unmanged code. Any ideas? Managed code: [DllImport("NativeTest.dll")] private static extern void InitCallBackReturningStringFromTimer(CallBackDelegateR...more >>

.net installation problem
Posted by JeffH at 4/26/2006 7:30:49 AM
Hi, I don't know if I am in the correct newsgroup. If I'm not, please let me know. I have a workstation that has recently received an installation of .Net Framework. This Windows 2000 machine should have never received that installation and it is causing problems with other software produ...more >>

Outlook COM object in C#
Posted by Bruno Windels at 4/25/2006 5:04:30 PM
Hi, I am developping an application in C# that creates outlook contacts from a database. For the outlook part of the application, I use the outlook COM object (Version 11 from Office 2003). If a contact is already present in the outlook contact database, it should be updated. Therefore I stor...more >>

.NET and IE Favourites
Posted by paulanthonyquinn NO[at]SPAM gmail.com at 4/25/2006 3:38:55 PM
I've been trying to use c# to read .url files. Yes, I've read other post, and yes, I've read Mattias and Eduardo Morcillo's posts, but nothing. The code below is an amalgam of all those posts (and I've tried many other variations...), but no joy. The code runs, throwing no exceptions, but then r...more >>

Problem calling .NET 2.0 dll from VB6 on Win2000Pro machine
Posted by Anders Nilsson at 4/25/2006 1:45:02 AM
I have a problem getting following error message when calling a .NET 2.0 component from my VB6 code on a Win 2000 Pro machine (SP4). "Run-time error '429' ActiveX component can't create object" Doing the same on an XP machine works just fine. Doing the same calling the same component using...more >>

Attach to Console?
Posted by ME at 4/24/2006 11:51:16 PM
I have a application that someone else has wrote that runs in a console window. It does not take parameters, but when running it asks three questions and then exits. I would like to write a small utility to attach to the console app, send the necessary answers (typically typing the letter ...more >>

DllImport attribute and platform independence
Posted by cody at 4/24/2006 9:30:09 PM
Is it possible to redistibute a .net app compiled with vs to linux without recompiling with say mon compiler? And what if I import functions from external non-.net dlls like [dllimport("fmod.dll")] public static extern fmod_playsound(string file, int flags); the library fmod itself is pl...more >>

Register for COM Interop in VB Express 2005
Posted by Curtis at 4/24/2006 4:55:51 PM
I am trying to write a small DLL in VB Express 2005 and expose it via COM but I don't see the "Register for COM Interop" checkbox in the Express edition. In Visual Studio 2003 it was located in the project properties -> Configuration Properties -> Build . This article http://support.microsof...more >>

How to determine bitness of underlying OS from C#?
Posted by StewLG at 4/24/2006 3:11:36 PM
I have a C# app I'm writing that will be run on both Win32 and Win64 platforms. I'm limited to XP, 2003, Vista and beyond, and don't have to support 9x/2000/NT. This application calls other, external tools to do its work, and which tool should be used varies depending on the platform and whe...more >>

AxHost and ActiveX initialization
Posted by Raj Wall at 4/23/2006 12:15:36 PM
I have a third-party ActiveX component that I have brought into my c# application using the AxHost wrapper. This gives me two assemblies, AxInterop.Foo and Interop.Foo. Inside of each of these is a class with the methods I expected to find--the functionality I want from the ActiveX component...more >>

ActiveX dll / com in vb.net 2005
Posted by Philip Wagenaar at 4/23/2006 7:50:01 AM
I created a few plugins in vb6 (activex dll) for an OCR application. Now I am trying to re-write one simple plugin in vb.net 2005. In vb6 I created a new ActiveX DLL, added a reference to a dll from the OCR application, added some, and entered some config info into the ini file of the OCR a...more >>

Serial Port without interoping
Posted by eduwushu at 4/23/2006 3:34:01 AM
Hi, I need to handle the serial port of my computer for my application but the problem is that using interoping is too complicated and i have few time to develop the serial port management. I've heard that there is in the .net framework version 2.0 a class SerialPort that will let me manage e...more >>

Interop stops working with new version of COM library
Posted by Jon at 4/21/2006 12:48:01 PM
We have customers developing custom applications with a .NET API we have provided. Internally, the API uses COM interop to talk to a legacy COM interface. The problem is that now we want to upgrade the COM library to the latest version. Ideally, we would like to do this without requiring th...more >>

Can GetActiveObject find multiple running objects?
Posted by Christopher at 4/21/2006 2:19:02 AM
Hi, I can use Marshal.GetActiveObject to attach to a running instance of some application. I can then use Type.InvokeMember to control it. My question is how to attach to a SPECFIC running instance of some application when there may be two instances running. How do I distinguish between them?...more >>

Marshalling "packed" struct
Posted by Marcin Rzeznicki at 4/21/2006 1:37:02 AM
Hello, What is the best approach to marshal structure declared like: typedef struct tag_SCRIPT_CONTROL { DWORD uDefaultLanguage :16; DWORD fContextDigits :1; DWORD fInvertPreBoundDir :1; DWORD fInvertPostBoundDir :1; DWORD fLinkStringBefore :1; DWORD fLinkStringAfter :1; DWORD...more >>

GetWindowPlacement problem. RECT members are all zeroes
Posted by Thue Tuxen Sørensen at 4/20/2006 6:29:02 PM
Hi ! Ive been wrapping GetWindowPlacement function of the Win32 API. The function call succeeds and returns != 0 and the showCmd member looks correct. The problem is that all coordinates in the RECT (rcNormalPosition) are 0 when the functions returns. It all looks like this: [DllImport(...more >>

Excel: Custom Style Color
Posted by Josef Brunner at 4/20/2006 3:50:32 PM
Hi, I need to create a Styel object for my Excel Workbook that contains a special color. I only know the html-like string for this color. Like Style.Interior.Color = "#FFFFF" Any help is appreciated, Kurt ...more >>

SDIOCam.dll and Pinvoke
Posted by Gusa at 4/20/2006 1:21:01 PM
Hello I am trying to use the VEO camera api to take a snapshot. The call to the method goes OK and I get a result indicating that the call was ok. However the dll is supposed to write a file with the picture and there is no file. I cannot find it anywhere. can anybody help with this...more >>

Assembly registration - interface missing
Posted by Peter Hase at 4/20/2006 12:41:24 PM
Hi, I register an assembly with regasm useally like regasm L:/Common/BIN/ComWrapper.dll /tlb:L:/Common/BIN/ComWrapper.tlb /codebase This works excellent most time, but on a few machines there's the problem, that the interface definitions are incomplete. If the coclass is activated via ...more >>

E_FAIL
Posted by danjones.email NO[at]SPAM gmail.com at 4/20/2006 12:29:39 PM
I am trying to use AccessibleObjectFromWindow() and it keeps returning E_FAIL. This seems to be an ambiguous error message and i feel like i have tried everything. I used Spy++ to verify that i am giving it the correct handle and several sources have told me that I do have the correct dwObject...more >>

Calling a C++ managed code from C#
Posted by Tooraj at 4/20/2006 9:49:47 AM
Hi, I have wrapped an unmanaged C code in a C++ wrapper. When I call the methods in wrapper everything works perfect but when I add a ref to the wrapper within my C# app and call the wrapper's method there I get a File Not found exception: An unhandled exception of type 'System.IO.FileNotFoun...more >>

fix lenght char c parameter
Posted by cheloman12 at 4/20/2006 7:21:03 AM
HI, I’m trying to get a fix length string from an unmanaged C dll. This is an example of the method I must invoke: typedef bool __stdcall (*Add3_t)(char *, char *, char *); Add3_t Add3 = (Add3_t) GetProcAddress(hInstance, "Add3"); // Execute the function char szResul...more >>

Using .NET dll from VB6
Posted by uwe.braunholz NO[at]SPAM hotmail.de at 4/20/2006 7:11:37 AM
Hello, I want to use a .NET classlibrary from my VB 6-Application. There are some tutorials for that, but I want to do some specials. In some thread I read, it would be possible to place the .net dll in the apps-dir and I would not have to register the dll on the target system. How can I...more >>

Making [DllImport(...)] configurable at runtime in C#
Posted by It's the Angry Snapping Goose at 4/19/2006 9:51:05 PM
Hi All: Can the following be done in C# Go from: [DllImport("test.dll")] extern "C" int testFunc(int y); To: [DllImport(dllNameVariable)] extern "C" int testFunc(int y); Where "dllNameVariable" is some kind of "string" object that can be initialized either by looking at an envi...more >>

Accessing core .NET Framework classes from COM
Posted by Zoe Hart at 4/19/2006 5:37:02 PM
Can any of the classes that are part of the .NET Framework be accessed directly from COM? I.e. are they ComVisible? Or do I need to develop a custom .NET wrapper which is ComVisible and use that as the middleware between my COM client and the .NET Framework class? My specific scenario is th...more >>

Registering .NET assembly that used COM Interop
Posted by DWrek at 4/19/2006 7:48:01 AM
Hello, I have a .NET assembly that is called from a classic ASP website. Can I still use XCopy deployment for this assembly if it utilizes COM Interop or do I need to use RegASM.exe? I plan to deploy the assembly in question to the "bin" directory of my web application. Thank you. ...more >>

calling COM objects
Posted by ramaseshan.k NO[at]SPAM gmail.com at 4/19/2006 7:11:21 AM
Hi I am c# newbie coming from c++ background. I need to call a COM object(which was written in VC++) from my c# program. The c++ application(Let's call it abc) has an .ODL file that defines the COM interface. It generates a tlb(abc.tlb) file. The application's COM is registered in the regis...more >>

exception handling
Posted by Vigj at 4/19/2006 5:59:02 AM
Hi I'm developing a com object (later used by a mfc c++ application) in C#. The result is a dll that the C++ application loads and from which istantiates forms, objects etc etc sometimes C# code throws an exception and c++ code gets killed. My question is very simple: is there a way to set ...more >>

uninstalling 3rd party application
Posted by Gregory Khrapunovich at 4/18/2006 10:12:59 AM
Hi, I would like my C# program to uninstall our old installation. Is it possible from C# to do the same think that user does, i.e get the list of installed applications (similar to Add/Remove programs), select an application, and command it to uninstall? I am using Visual Studio 2003, but ...more >>

Enumerating MarshalByRefObject objects in VB script
Posted by Eugene Pavlov at 4/17/2006 7:20:04 AM
Hi, I have the following interfaces in my C# project: [Guid("EFA1BE2F-92E3-4c69-9204-AE77D31A1E22")] [InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IMyEnumerable { [DispId(-4)] IEnumerator GetEnumerator(...more >>

FASTEST way to write in Excel - VB.NET
Posted by Niyazi at 4/17/2006 5:47:01 AM
Hi, I have a data table that contains around 9000 rows, And I am sending the data into pre-formated Excel sheet and you can see my code below: Dim myRow as Integer = 13 Dim rowNTMS as DataRow With oWB.ActiveSheet For Each rowNTMS In ExcelTABLE.Rows .Cells(myRow, 1).value = rowNT...more >>

Cannot successfully can C++ function from C#
Posted by Mike at 4/14/2006 2:41:08 PM
I have been banging my head againt my desk for a couple days now and nothing I try seems to work. I know I am missing something small and it's killing me. This is the error I am getting with this code: A call to PInvoke function 'SmartworksTest!SmartworksTest::MTGetEventCodeDescription'...more >>

System._Comobject Exception (E_NOINTERFACE)
Posted by hankman at 4/14/2006 12:05:30 PM
Hello, I am trying to connect to an automation server. I've imported the type library and everything matches with the tlb file when I view it using the old OleViewer. I n the old vb6 days I just used Getobject("BACtalk.ActiveX.Interface") and everything worked just fine, Now I am trying ...more >>

Help with Marshaling an Array of Pointers from COM to Managed Objects
Posted by Joshua Taylor at 4/14/2006 11:50:21 AM
Ok so I've been beating my brains out over this for two days now pouring through the SDK, MSDN Documentation, and the Internet at large. I'm not new to programming or .NET, but definately new to Interop and shell programming, and am getting tripped up by all the marshaling, importing, and po...more >>

How to determine if the windows screensaver option "on resume, display windows Welcome screen" is checked
Posted by Rob Latour at 4/14/2006 9:35:56 AM
using vb.net (2005) how can I determine if the windows screensaver option for "on resume, display windows Welcome screen" is checked? Thanks in advance, Rob ...more >>

using /namespace with tlbimp.exe
Posted by Farrukh at 4/13/2006 5:53:07 PM
Hi I want some information regarding /namespace switch. Is this the name of Namespace of the source code where our COM dll is referenced for which we will generate Interop.dll or is this some variable string or what? Thanks in advance. Best regards Farrukh ...more >>

Invoking C# object from C++ DLL
Posted by Daniel F. Devine at 4/13/2006 5:50:30 PM
I wish to provide a C++ DLL interface for non-framework clients to access a C# DLL - is this possible? I have had some limited success by using a pimpl idiom to cross from unmanaged to managed - but anything more than a simple message output yields an exception. I cannot debug past the C++/C# ...more >>

convert unmanaged pointer to managed pointer?
Posted by Alan Baljeu at 4/13/2006 10:36:56 AM
I have some C# code I want to use from C++. One of the C# method's parameters expects a COM interface (which was defined in a separate COM component, which is used by both of my assemblies), but I can't seem to pass a COM interface over to C# because I get error C2664: cannot convert par...more >>

C++ dll1 calls c#-wrapper-dll calls C++ dll2
Posted by MSDNAndi at 4/13/2006 9:08:02 AM
Hi, I have the following situation: I have one C++-dll that I am not allowed to touch (dll1) dll1 calls a C++ dll2. Now, I have to "plug" myself in with a c# dll. I can change dll2. The reason is, that functionality in dll2 will over time be implemented in C# (wrapper DLL) and over time less ...more >>


DevelopmentNow Blog