Groups | Blog | Home


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 > january 2006

Filter by week: 1 2 3 4 5

QI of IDispatch fails
Posted by Edwin Schild at 1/31/2006 4:06:53 PM
I have a dual interface IMyInterface defined in an unmanaged C++ project. In C# I make a reference to the typelibrary and implement a class which implements IMyInterface like this: public class SharpObject : IMyInterface { } In a C# program, I create a COM object witten in C++ which has a...more >>

Calling C written API from C# shows strange behaviour
Posted by jeanpaul.smit NO[at]SPAM gmail.com at 1/31/2006 8:48:27 AM
I have some strange behaviour when calling a function on a C written API. The API is part of the XCOM server by Computer Associates. It is very hard to find anything about this on the internet, so I hope to find some help here. The XCOM server documentation comes with a piece of sample code i...more >>

Multiple instances of Word
Posted by Paguro Bernardo at 1/31/2006 7:59:35 AM
Hi everybody, I'm encountering some problem in trying to activate more than one instance of Word from C#. To keep it simple, if I have a stupid Form, with just a button in it and the following code: private void button1_Click(object sender, System.EventArgs e) { Word.ApplicationClass w1 ...more >>

Running Excel when multiple versions of Excel are installed
Posted by Flack at 1/31/2006 5:59:09 AM
Hello, Lets say I built my app on a machine that has Excel 2003 installed. So, the interop assembly created was built off of 2003. Now, I have a few questions on what would happen if I ran the following code on a machine that had, lets say, both Excel 2000 and Excel 2003 installed. ...more >>

COM - DLL
Posted by martins at 1/30/2006 10:32:04 PM
Hi, I use a external reference to a COM DLL in my VB.NET project, when I build the solution it makes a interop DLL works fine, but the problem comes when I deploy my project to another computer if the external COM DLL doesn't exist In those cases, when the external COM DLL doesn't exist...more >>

my service stops when a user logs off
Posted by Rob Latour at 1/30/2006 4:08:23 PM
I am trying to run my app as a service using srvany. It loads and runs fine when windows starts. All is well when the user logs on. However, when the user logs off the app unloads from memory and is no longer running (but the service appears to be running). From what I've been able to de...more >>

Some issues regarding interop between .NET and VC++ 6.0
Posted by regimartins NO[at]SPAM gmail.com at 1/30/2006 9:35:16 AM
Hello all! I have been reading about interop here in google groups and I have found interesting stuff but I have been testing various solutions and one caught my attention. Here's what I do: In.NET I have writed code in C#: ******************************** using System; using System.Ru...more >>

Warning: Ambiguity between method 'Microsoft.Office.Interop.Excel._Worksheet.Activate()' and ..
Posted by Al Cadalzo at 1/30/2006 6:35:39 AM
Excel.Worksheet xls; ... <code to create the worksheet, etc.> xls.Activate(); I get the following warning: Ambiguity between method 'Microsoft.Office.Interop.Excel._Worksheet.Activate()' and non-method 'Microsoft.Office.Interop.Excel.DocEvents_Event.Activate'. Using method group. I a...more >>



marshalling pointers to classes in C#
Posted by marc joanisse at 1/29/2006 2:01:02 PM
Hi Folks, I am writing a c# app that interacts with some scientific hardware (a "bird", which is just a magnetic tracker) through a C++ DLL. The procedure birdGetFrame(), reads data from the hardware. The second parameter a pointer to the struct BIRDFRAME, into which all the data are written w...more >>

VB.NET Automation
Posted by Andy at 1/29/2006 12:05:45 PM
Hello, I am trying to automate a game with VB.NET but I am having trouble doing so. I have added a reference to the library (GameLib 1.0) and typed the following code. Dim A as Object A = GetObject("","GameLib.Game") but I always get an error saying unable to create activex control. Apa...more >>

Problems when Interface pointer returned from one thread, Getting called from another thread
Posted by staheli.bob NO[at]SPAM gmail.com at 1/28/2006 9:23:03 PM
I am developing a namespace extension in .Net and I am returning a pointer to the IExtractImage interface for thumbnail extraction. However, the interface methods are called on a different thread by Windows Explorer and as a result, Explorer slows down considerably. I am sure this is caused due ...more >>

<DLL> does not contain any types that can be registered for COM Interop.
Posted by Dick Swager at 1/28/2006 7:57:39 PM
After selecting 'Register for COM Interop' for a project with a class and a couple of interfaces in it, I am getting a message that the resulting assembly DLL 'does not contain any types that can be registered for COM Interop'. There is only one file in the project and only this one project ...more >>

How to call variouse COM wrappers in mscorwks.dll from managed cod
Posted by Dec at 1/28/2006 2:23:57 PM
I am developing a class similar to RSA and MD5 CryptoServiceProvider. I need to call advapi32.dll CryptAcquireContext in the .ctor and call CryptCreateHash, CryptHashData, CryptDeriveKey, CryptDecrypt, CryptEncrypt etc in other class methods. In the .ctor RSA and MD5 CryptoServiceProvider and ...more >>

Unable to get rid of MDA in IDE
Posted by ViRi at 1/28/2006 5:12:51 AM
According to http://msdn2.microsoft.com/en-us/library/d21c150d.aspx you only have to set MDA=0 in your registry (which i did), i also tried the COMPLUS_MDA=0. This all works fine for executing applications, but not in the IDE. I keep getting an invalidvariant error, the program works fine, i j...more >>

Disposing ActiveX Resources
Posted by Fred Chateau at 1/27/2006 4:37:09 PM
I have an ActiveX graphical display control running within a Windows Form. What is the proper method for disposing of everything when closing the application. When I add the dispose method to the Form class I notice Intellisense displays 5 overloads: Disposing the (1) Form instance, (2) Base ...more >>

reference parameters between C# and managed C++
Posted by Lee Crabtree at 1/27/2006 3:41:38 PM
I was under the impression that the 'ref' keyword in C# allowed you to pass a variable by reference (seems a bit pedantic, but I'm learning you can never be too careful). If I have a C++ function like this: void GimmeByRef(int *gimme), when I try to call it in C# via something like wha...more >>

SendNotifyMessage parameters IntPtr?
Posted by Eric at 1/27/2006 2:33:08 PM
I'm trying to send extra info with the SendNotifyMessage function. Does anyone know how to do this? if I try an int as a wParam or lParam it can't convert to IntPtr. Thanks [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] static extern bool SendNotifyMessage(IntPtr hWnd...more >>

Dllimport and calling function from c#
Posted by Martin Venter at 1/27/2006 2:07:56 PM
Hi All, I need to convert this code to c#. I'm dont know what the dll import should look like and how to call it from c#. struct iaxc_audio_device { char *name; long capabilities; int devID; }; EXPORT int iaxc_audio_devices_get(struct iaxc_audio_device **devs, int *nDevs, int *i...more >>

How can I tell which version of Excel is installed?
Posted by Flack at 1/27/2006 11:26:42 AM
Hey guys, Can someone tell me or show me how I can programatically discover what version of Excel a machine has installed, or if the machine has Excel installed at all? If anyone has some sample code (C#) that would be great. Thanks...more >>

Late-bound COM calls to overloaded .NET method need decorated names?
Posted by Alex K. Angelopoulos at 1/27/2006 6:20:24 AM
I've been working on a project where I call some .NET classes from a late-bound COM client (WSH-hosted VBScript), and I've noticed that in at least some cases the calls fail unless I decorate the method names to specify the correct overload to call. As an example, it's easy to create a Syste...more >>

Callback
Posted by Martin Venter at 1/27/2006 12:00:00 AM
Hi All, I need some help setting up a callback between C and C#. Here is the C code: typedef int (*iaxc_event_callback_t)(iaxc_event e); EXPORT void iaxc_set_event_callback(iaxc_event_callback_t func); iaxc_event is a struct. Any help will be appreciated. Regards, Martin Venter ...more >>

interop .ini path
Posted by Allen S. at 1/26/2006 3:39:03 PM
We are developing a web service that is calling a non-managed code .dll. The non-managed .dll uses an .ini file. We have tried putting the .ini file in the bin directory, as well as the web service root directory and we are getting a file-not-found error. Has anyone experienced this?...more >>

howto use user32 in c# without declaring functions
Posted by Abraham Andres Luna at 1/26/2006 1:29:49 PM
is there a way to create an interop assembly for the user32 dll i tried to add a reference to it through visual c# 05' express but it says it's not a valid com object i don't want to have to write reference code for each method i'm going to use, or is that the only way :( thank you for yo...more >>

access .Net components from Excel 97
Posted by ennis at 1/26/2006 10:32:50 AM
Hi Everyone, I am trying to access .Net components from Excel 97. For testing I am following an example presented in a 2001 posting by Manish Mehta at: http://www.c-sharpcorner.com/articles/accessingdotnetfromcom.asp Source code for the VB.Net component is: imports system namespac...more >>

Interop fails depedning on the Win Account
Posted by TDC at 1/26/2006 5:35:37 AM
On a Windows 2003 machine, I installed our software which makes use of COM Interop from a .NET service. We don't normally have any problems, but on this machine we were getting InvalidCast and/or QueryInterface errors. When I changed the account to Admin everything started working. I don't se...more >>

Excel interop deployment
Posted by gilles27 NO[at]SPAM talk21.com at 1/26/2006 2:24:02 AM
I am writing some code which exports the contents of a grid to Excel. It allows the user to specify a template (xlt file) from which to create the new workbook into which the data is pasted. The .NET project in which this code resides now has a dependency on Microsoft.Office.Interop.Excel. The...more >>

Best Practices? Inter Application Communication
Posted by Brien King at 1/25/2006 8:15:02 PM
I have a .NET (1.1) application and I need to allow a non-.NET application to communicate with it so they can control my application. The other application uses VBScript 5.6 and can control COM applications. Basically, I want to create an API in my app that allows another application to ope...more >>

marshalling a struct with a blittable array
Posted by Lee Crabtree at 1/25/2006 12:32:08 PM
Alright, this should be easy, judging by the number of entries that involve marshalling structs with non-blittable arrays, but I cannot for the life of me figure this out. I'm developing the managed side of what will eventually be a class for controlling a device across a USB connection. T...more >>

Problem marshalling two-dimensional array in structure
Posted by LarsJ at 1/25/2006 9:47:01 AM
Hi! Having a working excel app which calls a C-lib (not COM). Looks like this: Type curve_data Qmas(19, 2) As Double Qvol(19, 2) As Double Head(19, 2) As Double Eff(19, 2) As Double Pdis(19, 2) As Double Power(19, 2) As Double arraysize(2) As Long End Type P...more >>

delegate to void*
Posted by Antao Almada at 1/25/2006 7:30:03 AM
Hi, I'm trying to call a C function that has a void* parameter where the content type depends on a flag parameter: int SetProperty(const char* property, void* value); I'm wrapping it this way: [DllImport(libname)] public static extern int SetProperty([In, MarshalAs(UnmanagedType.LPS...more >>

C# methods with delegate parameters used from VB6
Posted by Clive Dixon at 1/25/2006 12:00:00 AM
How do I use a method with a delegate parameter from VB6? Is it even possible? I can't seem to find any documentation covering this. ...more >>

Best Practice: .NET Class Library Exposed as COM
Posted by beaudetious at 1/24/2006 7:21:02 AM
I've got a question regarding the best way to develop a .NET class library that will be consumed in an application as an Automation object. My particulars are VS.NET 2003 and C#. Here's the list of questions I have based on my research: 1) Do I have to use an interface approach or just ma...more >>

Strange Problem With The Interop
Posted by batista at 1/24/2006 3:53:45 AM
Hi there, i have a web service which is using a dll written in vc7.This dll in turn is accessing a vc6 com dll through interop. Now the problem is that i have a function in vc6 that takes as param zipped data and returns me unzip data.The params it takes r 1)the starting memory address of t...more >>

dllimport interface usage
Posted by Joan van den Heuvel, Netherlands at 1/24/2006 1:02:02 AM
I have written my application in VB6 When I upgrade to VB2005 some issues are easily fixed, but I need a DLL written in C to connect to a RDM database . TLBIMP makes a assembly (works better than the upgrade wizard) wich works fine for procedures like logging in. I can see the DLL in the o...more >>

What about SerialPort and performance?
Posted by JWagner at 1/23/2006 3:56:02 AM
Hello everyone, I'm new to the MS .Net framework and C#, but aware of MFC and Win32 programming. I have the task to communicate with electronic devices connected to the pc by rs232 (yes, even in 2006!) to exchange measurement and controlling data. In my former MFC applications I used an...more >>

Need help with DllImport Error
Posted by John Collins at 1/22/2006 11:38:21 AM
I am using DllImport to call a function in a seperate dll written in C: [DllImport("db.dll", EntryPoint = "DBL_ConnectServerAndOpenDatabase", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)] internal static extern void ConnectServerAndOpenDatabaseNa...more >>

Error creating PowerPoint.Application object
Posted by snicks at 1/21/2006 3:43:02 PM
I'm currently looking at this VB.NET code running on my IIS server which fails with the error below when it hits line #2. I've added a COM reference of Microsoft PowerPoint 11.0 Object Library to the project and all of the types below are recognized. I've added the user ASPNET to the Adminis...more >>

Getting the COM IDataObject interface from the DataObject class
Posted by staheli.bob NO[at]SPAM gmail.com at 1/21/2006 11:25:41 AM
The .Net DataObject class implements the COM/OLE IDataObject interface , so how do I get it. I have tried this, but it does not work : // Declare the COM/OLE IDataObject interface [ComImport, Guid("0000010E-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown...more >>

Need help declaring a method
Posted by phredlists.jeff NO[at]SPAM gmail.com at 1/20/2006 4:38:21 PM
I have no clue how declare the appropriate method in c# code to call the following c function in a dll int PvcsGetRevisionInfo2( unsigned int logHandle, // in unsigned char* fileName, // in unsigned char* revision, // in unsigned char**author, // out unsigne...more >>

passing string from c# to unmanaged dll
Posted by Ivonne Riedel at 1/20/2006 3:50:33 PM
Hi everybody, I know this has been discussed very often but I can not find a suitable solution for my problem that is: I have a smart device project that includes an unmanaged C++ dll. In that dll I have a method: int openFile(char* filename) In my C# project a PInvoke [Dllimport(...more >>

unmanaged C++ calling managed C++
Posted by KJ Cat at 1/20/2006 12:24:03 PM
I need to create an unmanaged COM VC++ 2003 Component to call a Dot Net Component and I'd like to know if there is a way besides COM callable wrappers to do so....more >>

Cannot unregister assembly
Posted by Emmanuel at 1/20/2006 5:10:59 AM
Hi, Using Microsoft Visual Studio 2003, I have created an assembly that was registered as COM component. On the project's options the "Register for COM interop" option was checked. The assembly was compiling and working without problems, until I switched to VS 2005. Now when I try to co...more >>

COM and VB.net AnCOMObject=Nothing What is happening with the Term
Posted by George at 1/20/2006 4:59:03 AM
I am using a COM ActiveX Dll, which supports Events. I am instanciating this object on a Form with new keword and then I am calling a method Init which supported by my COM ActiveX Dll. Then I am referecing the Events using the AddHandler. When I am closing the form I detach Events using Rem...more >>

Empty Type Library
Posted by rob at 1/19/2006 11:25:12 PM
I did create a class library that contains the code listed bellow. The goal is to make this class available in an MFC application. The code compiles fine and produces a dll. Then I use regasm to create a tlb file. Unfortunately, the tlb file does not contain any type definitions, i.e. it is empt...more >>

How to obtain the current CPU Usage?
Posted by Juan Dent at 1/19/2006 4:36:02 PM
Hi, I need to insert a simple graph like the one in Windows Task Manager that demonstrates the current CPU Usage. Is there a simple way? Any ideas appreciated! -- Thanks in advance, Juan Dent, M.Sc....more >>

System.NullReferenceException
Posted by phredlists.jeff NO[at]SPAM gmail.com at 1/19/2006 11:22:13 AM
I am trying to call a c function in a dll. The function has the following signature int PvcsOpenArchive( unsigned char* filename, // input unsigned char* workfile, // output unsigned short workfilelen, // input ...more >>

System.Xml in MFC
Posted by rob at 1/19/2006 9:40:11 AM
I tried to use System.Xml in MFC. Unfortunately, it turns out that all of System.Xml is set as COM-invisible. Therefore, my regasm gives me an empty type library. So my questions are: 1) Why was System.Xml marked as COM-invisible? 2) How do I go after using System.Xml in my MFC app anyways (so...more >>

NullReferenceException while calling PInvoke Function
Posted by NuTcAsE at 1/19/2006 8:50:37 AM
Hi, In our C# app we are trying to use PInvoke to call some unmanaged functions in a C++ dll. The function definitions and thier stucts look like this: The stuct definitions are: typedef struct tagDPTranInfo { char szDPTranDte[DP_TRAN_DTE_LGTH + 1]; char szDPTranCde[DP_TRAN_CDE_LGT...more >>

Memory growth when using PInvoke
Posted by Venkat at 1/19/2006 4:00:44 AM
I have a .Net form based application which uses a Win32 dll using PInvoke. The C# form supplies a delegate to the Win32 dll and the Win32 dll stores it as a function pointer and this will be called by the Win32 dll when some event occurs. The application works perfectly fine and now I am facing ...more >>

Window Stations and Desktops
Posted by Jerry Q at 1/18/2006 7:30:31 PM
Hello, Can WindowsServive have a Virtual Desktop and if can what can it do with it? Precisely saying can a WindowsService with a Virtual Desktop Render images? Where could I lear more about this subject and Virtual Desktops and Virtual Stations? Cheers! ...more >>


DevelopmentNow Blog