Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!


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
February 2010
all groups > dotnet interop > february 2007

Filter by week: 1 2 3 4

Must the .NET DLL be installed in the GAC to be used by COM?
Posted by Jen at 2/28/2007 10:38:46 PM
The docs I've read aren't too clear about that. Seems to me they should work anyway. That's what registration is for. Also, I have successfully created a .NET DLL with a public class and public default constructor and registered it but nothing shows in the object browser in VB6. When I us...more >>


Use of DLL in VB6 works fine, but I want to learn something and try to get the intellisense of the DLL
Posted by Screaming Eagles 101 at 2/28/2007 12:00:00 AM
Hi, In an earlier post I received a perfect solution to use a visible VbNet USERCONTROL in VB6 and get the intellisense. I'm rewriting the answer I got beneath my new question which is => I use a DLL, probably written in VB6, which is a NON VISUAL 'control' (?). We pass some arguments to...more >>

Excel Automation - Range.set_Value fails with "Exception from HRESULT: 0x800A03EC."
Posted by vvenkie NO[at]SPAM gmail.com at 2/26/2007 8:18:43 PM
Hi, I am trying to save data from a dataview to an excel spreadsheet. The data volume is quite huge. As per the recommendation from MS article, I dump all the data from the Data View to a 2D array and then use Excel.Range to pump all the data to the spreadsheet. It used to work quite well...more >>

Memory leak with this code
Posted by Jeremy Hannon at 2/26/2007 1:07:47 PM
I am not the greatest at COM Interop. I understand cleaning up your resources, but usually I am using a VS generated interop library, or primary interop assemblies. Making API Calls is somewhat new to me. Could someone please explain to me why the code at http://www.wischik.com/lu/Program...more >>

Type of System.__ComObject
Posted by barker7 NO[at]SPAM yahoo.com at 2/26/2007 12:42:15 PM
I have created an IDocHostUIHandler class that I pass to the AXWebBrowser class. Part of this interface is the callback method "ShowContextMenu". It is called when the right mouse button is clicked. My question revolves around getting the Type of the pDispReserved argument: public uint Sho...more >>

Mashaling array of structures... not working I don't know why
Posted by Pedro Mota at 2/26/2007 9:52:12 AM
Hello, I'm having the following problem and I need some help from you: I've a dll writen in C that has one function that has a parameter that's an array of structures of type T_MyStruct. The structure T_MyStruct has just one field, being an array of 7 stuctures of type T_A. The stru...more >>

Best way to create ActiveX for Access 2000 in (vb).net
Posted by hagipro NO[at]SPAM gmail.com at 2/26/2007 2:45:23 AM
Hi, I'm currently expanding the capability of an Access 2000 database for a customer who's limited by the "regime" of it's IT-department. The client wishes to do things in his Access 2000 (with VBA) that are easily done in (vb).NET. I have finished an ActiveX component that works well whe...more >>

Dynamic DllImport
Posted by phrosty NO[at]SPAM gmail.com at 2/24/2007 6:57:15 AM
Hey folks, I'm trying to DllImport the SendMessage and SetWindowTheme APIs, but maintain backward compatibility with Win2k and stay cross-platform with Mono. So I need a way to import these APIs if they are there but fail gracefully if they aren't. Any ideas? ...more >>



How to catch this error Access Violation
Posted by johnxhc NO[at]SPAM gmail.com at 2/23/2007 7:01:37 PM
I have a crash; I know that crash is in the following code 0012d300 12d75f49 OLEAUT32!VariantClear+0xb1 It is because the VariantClear tries to release a COM Object that is not long valid. Because I did not know how to prevent this error from happening,, (Please see http://groups.google.c...more >>

VB6 app interop with VB.NET dll
Posted by drvice NO[at]SPAM nppd.com at 2/21/2007 2:37:02 PM
I'm having some issues I hope someone can assist me with. I have a VB6 application which needs to interact with a VB.NET assembly (dll). The VB6 application is being developed on a separate PC from my .NET development PC. I have setup the .NET assembly for COM interop and have given it a str...more >>

Saving Excel file from VB.Net
Posted by Peter A at 2/21/2007 9:54:27 AM
In a VB.Net program I am opening an Excel workbook, adding some data, and then saving the file. My code is: Dim xlApp As New Excel.Application Dim wb As Excel.Workbook Dim ws As Excel.Worksheet ' Code to add data here. wb.Save() xlApp.Quit() xlApp = Nothing The problem is t...more >>

Interop within a web service
Posted by Curtis Justus at 2/21/2007 9:06:59 AM
Hi everybody, I am baffled by this problem and was hoping that somebody could help me out. I have a COM DLL that was created by Delphi that I am calling indirectly within my web service. The WS is calling a .NET component that calls the COM DLL. I unit test the .NET component and it works...more >>

Winforms and LVM_SETITEMSTATE sendmessage interop
Posted by Robert Ludig at 2/20/2007 5:54:35 AM
I try to set an overlay image for items in winforms listview using the following simple code. Do you see any mistakes (because sendmessage returns 1, but nothing happens - no overlay image is set) ?: [StructLayout(LayoutKind.Sequential)] struct LVITEM { public uint mask...more >>

Late-bound interop confusion
Posted by Christian_Fröschlin at 2/19/2007 3:29:30 PM
Suppose I have a native COM class A which implements an interface ITest, and a native COM class B which features a member function taking a parameter of type ITest. With normal COM Interop, I can call this function in C# by explicitely casting to ITest as in someB.TestFunction((ITest) someA...more >>

COM interop with IIS/ISAPI
Posted by Kyle Szklenski at 2/19/2007 7:37:19 AM
Hi. I posted a while back about an interop question sending a string from C++ to C#. I got the executable for that working just fine. Now, I'm going to change it to an ISAPI dll so we can use this program through our web server and it seems to be getting some kind of error when it runs its main ...more >>

Passing reference from C# to C++
Posted by pedro NO[at]SPAM dinisnet.com at 2/19/2007 2:25:59 AM
I have some code in C++ i want to call this code from C# i have tried ref , out, & everything i can=B4t fix this error the following code shows the C++ and the call from C# and the compiler error //C++ void ImporterW::InitWizard(array<System::String ^>^ colunas,System::String^ &meu_XML,arr...more >>

How to read and write from and into Excel file
Posted by AleXmanFree at 2/17/2007 2:38:36 PM
Hello , I have working sample of C# code that creates and writes into Excel file simple text. And this is not hard as there is a lot of samples at microsoft's msdn site: http://msdn2.microsoft.com/en-us/library/bbx26t8w(VS.80).aspx But the problem is when you need to just ready existing ...more >>

Event not firing on runtime new instance of form
Posted by bidalah NO[at]SPAM yahoo.com at 2/16/2007 12:17:51 PM
Hello all, I am firing an event on one form that is getting handled on another. Following is my basic code: __________________________________________ ON FORM #1: Public WithEvents A_Form2 As New FORM2 Try A_Form2.Show() Catch ex As Exception Dim A_Form2 As New FORM2...more >>

Exposing .Net Class to Com, Dependancy Problem
Posted by AsharGhani at 2/15/2007 11:10:14 PM
Hi, I am new to COM as well as to .Net COM interop. I want to expose a .Net class(lets say (lets say A::ClassA) of an assembly (A ) to COM with a method that returns an Object of another .Net class(B::ClassB). The problem is ClassB has been defined in another assembly (B) that the assembly ...more >>

VB2005 usercontrol in VB6 works fine, but I want to know something about controls here....
Posted by Screaming Eagles 101 at 2/15/2007 4:52:58 PM
Hi , my VB6 code says : Dim ctlDynamic As Object Private Sub Form_Load() Set ctlDynamic = Controls.Add("stlOperators.stlOperator", "stlOp") ctlDynamic.Visible = True End Sub My form shows the control and I can access Public Properties and Subs in the VBNet control, all OK so f...more >>

Problem exporting powerpoint slides to jpg
Posted by Cubaman at 2/15/2007 3:19:42 AM
Hello: I'm currently exporting a powerpoint presentation to jpg. It works fine till there is a graph object embed in the presentation. In this case the resulting image apears as a white empty image. The code i'm using is as follows: Private Shared Sub ConvertToImageInternal(ByVal params As Ob...more >>

VB6 COM update crashing C# application
Posted by Paul Lance at 2/14/2007 2:18:00 PM
Hi, I'm having a bad experience with C# and interop and I hope some one can share a little light on my dilemma. We have a third party VB6 com object that our C# 2005 app is utilising. We are early binding so the application is using interop. Every thing is working fine until the third party ...more >>

The format of the file [DLL] is invalid
Posted by Paul Jones CSG at 2/13/2007 12:48:27 AM
This one's a bit messy. Our application is written across VS2003 and VB6. We write plug-ins to link to other people's account packages as COM DLLs in VB6. We now need to link to an accounts package where all integration tools are written in VS2005, Framework v2.0.50727. This wasn't a probl...more >>

E_ACCESSDENIED on Folder.BindToObject (Vista)
Posted by Jim Parsells at 2/10/2007 8:11:00 PM
I have a class library which uses the IShellFolder interface to implement folder browsing. This has worked under all 32-bit versions of Windows, until now. The following code fragment: If m_IsFolder Then Dim HR As Integer HR = folder.BindToObject(pidl, IntPtr...more >>

P/Invoke Fails To Function As Expected -- This is NOT COM-related
Posted by Mark Rockman at 2/10/2007 4:52:05 PM
The following is an unmanaged C++ DLL combined with managed code using = P/Invoke in C#. Real simple code. The program in action locates the = DLL because I gave it the exact location of the DLL. However, even = though the C++ function is stdcall and extern "C", the CLR reports that = it cann...more >>

COM object that has been separated from its underlying RCW cannot be used (IADsUser)
Posted by Hayato Iriumi at 2/9/2007 5:11:32 PM
Hello, folks. I have an issue using ActiveDS COM object from .NET Framework 2.0. When I access one of the properties of IADsUser, I get the following error. "COM object that has been separated from its underlying RCW cannot be used" This doesn't happen all the time, but it happens intermit...more >>

Pass through object above c-callback
Posted by Michael Sabo at 2/9/2007 2:17:01 PM
Hello, is in C# no way to realize this problem? { object x = new xy(); callback = new CBDelegate(callback_func); c_call_callback(callback, ref x); .... <wait until finished long operation> GC.SuppressFinalize(callback); } private callback(ref object context) { if( context is ...more >>

Regasm /u couldn't unregister .Net dll (.tlb)
Posted by Hanna Yu at 2/9/2007 9:52:01 AM
I created a .Net component, and used "regasm" to get the compoennt registered. I used an ASP page to call this component, and it worked ok. Later I needed to make change to this component, so I unregistered the dll by using "regasm /u" without getting any error. But it seemed like the ungiste...more >>

Translating from the C++
Posted by Mark Rockman at 2/8/2007 7:39:49 PM
Much of the Win32 API has yet to become natively supported in the dotnet Framework. So often we come across sample code that only works in C++. What is the standard approach to making these calls from C#? Do I write a DLL and decorate its call appropriately (and what would that entail) in C#...more >>

To sign a pdf document from .net
Posted by Santi at 2/8/2007 6:45:43 PM
Hi, I'm looking for an ActiveX/dll or someting similar, to sign pdf files with Visual Basic .NET. I don't mind if it's shareware or i have to pay. Can anybody help me? Thanks a lot ...more >>

Trying to use unmanaged with C#
Posted by Steven Edison at 2/8/2007 9:31:45 AM
Hi, My company has a large library of COM objects we've been using for years, it's massive, re-writing would take months to years. One of these objects has a method that looks something like this: HRESULT EnumItems(IUnkown* pUnk, VARIANT Param); The IUnknown is a callback, where you w...more >>

VB6 automation error trying to use a COM-exposed C# DLL
Posted by Tremendo at 2/7/2007 9:11:16 AM
Hi, I have two PCs: PC1: Visual Studio 2005 (including .NET framework 2.0. PC2: Visual Studio 6 (using Visual Basic 6) + .NET framework 2.0 installed separately. On PC1 I wrote and built a C# DLL (see code below), and created one .tlb and one .reg file to expose its methods to COM. On PC...more >>

Enumerate File Handles for a Given Process
Posted by Demetri at 2/6/2007 6:38:00 PM
The short question I have here is how would one enumerate file handles for a given process in C#? I know p/invoke is needed. Sysinternals uses NtQuerySystemInformation and NtQueryObject. However, my knowledge of how to uses these are pretty limited and to save myself some time of ramping up...more >>

How to marshal complex data structures
Posted by James Whetstone at 2/4/2007 8:13:58 PM
Hi, I'm using Pinvoke and C# interop to interface to a C DLL. The DLL function signiture is as follows: int fun(char *name, my_id_t *id, my_buffer_t *buffer); The user defined types (in C) are as follows: struct my_id_t { unsigned char guid[16]; } struct my_subbuffer_t ...more >>

Converting big-endian to litle-endian
Posted by Andreas at 2/2/2007 1:45:04 PM
Hi, Im filling a known structure with data from a byte-array and I know that the values are represented in big-endian. Would it be possible to make this conversion "on the fly" ? Example structure [StructLayout(LayoutKind.Sequential)] public struct MyStructure { public ushort Width; ...more >>

memory leak .. passing output string arg from C# to Managed C++
Posted by tintincat1977 NO[at]SPAM yahoo.com at 2/2/2007 12:27:44 PM
I have the following sample code that is slowly leaking memory. Any ideas? TIA! Tian --- managed c++ code: ---------------- void foo::bar (String __gc * __gc *out_str) { //do something //assign some "hard-coded" value to out_str *out_str = Marshal::PtrToStringAnsi(static_cast<IntP...more >>

Loading 32-bit unmanaged DLL on Windows XP 64-bit with x86 .NET 2.0 Framework
Posted by Emmanuel Stapf [ES] at 2/1/2007 6:14:29 PM
Hi, I have two machines running Windows XP 64-bit. On one machine it works, and on the other it does not. All my assemblies have been compiled on a Windows 32-bit platform and I'm trying to execute them on the 64-bit machine. The .exe assembly has the 32bit flag set (verified through corfla...more >>

LoaderLock exception with VB OCX
Posted by John Hall at 2/1/2007 4:50:55 PM
Hi, I have a C# application that is using an VB OCX that has references to some C dlls. On exiting the application in the IDE I get the message: Managed Debugging Assistant 'LoaderLock' has detected a problem in 'Example.vshost.exe'. Additional Information: Attempting managed execution ins...more >>

Need help. How to deal with sbyte*?
Posted by mtv at 2/1/2007 11:43:00 AM
My C++ function is declared like this: void Connect (const char* dest); That translates to Connect(sbyte* dest) in C# world when it's interoped. I need to call Connect(...) from C#, but do not know how to prepare data for it. How do I create sbyte* in C#. Since C# does not deal w/ pointers, ...more >>

"W" vs. "A" constants
Posted by chris.o.m.bray NO[at]SPAM gmail.com at 2/1/2007 5:38:56 AM
Hello, I'm using P/Invoke to make calls into the Win32 APIs, and am using constants that I have seen used in examples. Some of these constants appear to have one of two possible values, and the constant name varies by adding either a "W" or "A" to the end. For example, LVM_GETITEMA and LVM_...more >>


DevelopmentNow Blog