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 2004 > threads for april 15 - 21, 2004

Filter by week: 1 2 3 4 5

question for Mattias (dllimport/params)
Posted by Sean Z at 4/21/2004 5:16:02 PM
Hello Mattias, I have a related question, this time on NetScheduleJobEnum API. I get a null reference exception (even though the api call correctly set EntriesRead and TotalEntries params). Thanks again! [DllImport("netapi32.dll", CharSet=CharSet.Unicode) static extern uint NetScheduleJobEnu...more >>

CreateProcess - Please help.
Posted by provo1234 NO[at]SPAM hotmail.com at 4/21/2004 4:32:14 PM
Hi All, Environment: Windows XP; Visual Studio .NET 2003 Edition Problem: Calling CreateProcess Function from a Windows Service Ultimate Aim: To print a pdf file using the command AcroRd32.exe /t "c:\myfile.pdf" "\\PRINTERS\printer1" from a Windows Service Program I need to call th...more >>

Please help importing API (parameters)
Posted by Sean Z at 4/21/2004 4:11:04 PM
Please help with syntax importing an API into .NET, below is the signature. I am having trouble with specifying and passing parameters. Thanks NetScheduleJobAdd LPCWSTR Servername, LPBYTE Buffer, LPDWORD JobId ) ...more >>

DateTimePicker on a TabControl in a UserControl - Crash
Posted by indhu at 4/21/2004 3:55:32 PM
Hi I have a User Control which has TabControl with 2 pages. I have DateTimePicker Control on one of the TabPages, whenever the Calendar is opened to change the dates it hangs. This happens when my calling program is an MFC program(unmanaged). But if the DateTimePicker is on the usercontro...more >>

IDispatch C# and Word
Posted by Dominic Godin at 4/21/2004 10:21:35 AM
Hi, I have been trying to get at the WordBasic.DisableAutoMacros method with C#. WordBasic is passed as a _ComObject so I can't call this directly. I have tried: Type t = Type.GetTypeFromProgID("Word.Application.10"); object MSWord = Activator.CreateInstance(t); object WordBasic = MS...more >>

InvalidCastException: QueryInterface for interface ... failed
Posted by Paul at 4/21/2004 8:41:01 AM
I am trying to access a managed com object created in VC6. I have created a ASP.Net form and have added a COM Reference to the project. This creates a interop.xxx.dll for the project. When I run the form I recieve an exception: InvalidCastException: QueryInterface for interface ... xxx. ... fail...more >>

Error 1928. Error registering COM+ Application
Posted by el_sid at 4/21/2004 2:46:05 AM
When we try and install our COM+ components using a client proxy from our Windows 2003 machine onto our XP machines we always get an error during installation on the client machine (see below). Now if we select the option "Save COM+ Component in 1.0 format..." when creating the client side proxy in...more >>

object to variant in parameter: ref object o
Posted by Morten Lyhr at 4/21/2004 2:41:04 AM
He I have made a interop assemby with VS 2003 on a COM dll I have the following problem A Sub in the COM dll has the following signature Sub Assign(ByVal FieldData As Variant VS generates the following method public void Assign(ref object FieldData The variant can be several different ty...more >>



WebService DllImport Unable to load DLL
Posted by James Chang at 4/20/2004 4:36:06 PM
Hello I am trying to import a dll from within a webservice. At the call of the dll function, a DllNotFoundException exception is thrown. I have tried to putting the dll in the web service directory, putting the dll in the system32 directory, specifying the full path for the DllImport function. I a...more >>

Translate VB6 to .NET
Posted by Steve at 4/20/2004 4:33:13 PM
Hi all Could some-one please tell me what the equivilent .NET code is for the CopyMemory API call? This is my vb6 code (some code ommitted): ------------------------------------- Private Structure FILE_INFO_3 Dim fi3_id As Integer Dim fi3_permissions As Integer Dim fi3_num_locks As...more >>

Adam Nathan's new P/Invoke Wiki
Posted by Sam Gentile [MVP - C#/.NET] at 4/20/2004 1:30:04 PM
This is of huge interest to this group.... The main man of Interop, Adam Nathan, has put together a Wiki for Win32 P/Invoke signtaures. This is a valuable contribution to the Interop community. http://pinvoke.net/ PINVOKE.NET attempts to address the difficulty of calling Win32 or other unman...more >>

VB6 into .Net into VB6
Posted by John Dough at 4/20/2004 11:24:55 AM
Hi, We currently have a legacy VB6 app which we want to gradually convert into VB.Net. We have been told its better to make calls from .Net to COM than vice versa, so the intention is to start by rewriting the screens in the order in which they are called, gradually shifting them from VB6 into...more >>

QueryInterface for interface xxx.yyy failed
Posted by Chris at 4/20/2004 6:21:07 AM
Hi everyone We are trying to access a remote COM object in our asp.net application and are running into difficulties. We keep receiving the error: QueryInterface for interface "dll.className" failed. This error occurred when we deployed the application to our test servers. During our development c...more >>

AllocHGlobal Problem: "The object is currently in use elsewhere"
Posted by Jesse Ezell at 4/19/2004 4:01:06 PM
When trying to free memory allocated with Marshal.AllocHGlobal, I get the message "The object is currently in use elsewhere Any idea why or how I can fix this? Sample code below int bufferSize = GetGlyphOutline(hdc, (int)c, (int)METRICSFORMAT.GGO_NATIVE, out metrics, 0, IntPtr.Zero, matrix) I...more >>

Problems with interop
Posted by Gasman at 4/19/2004 1:40:13 PM
Hello all, i am having a problem with a dll vb6 file. i'm programing a = nt service using vb.net with visual studio.net. The problem be when i use the final service, because when i debug it, = all works fine. But when i run the service in the service manager never, = execute a vb6 dll method. S...more >>

Duplicating a socket for another process
Posted by Brad Radaker at 4/19/2004 1:01:03 PM
I am needing to write a socket server in c# that will essentially dupe each socket handle from the process that receives the connections to separate processes that will handle each connection from that point on (one process per connection). This is so that if the process handling one of the connecti...more >>

Arrays of float passed by ref
Posted by gax700 at 4/19/2004 9:52:39 AM
I'm currently porting a working VB6 application in Visual c# but I'm having big troubles converting this external function call to a Fortran DLL. I think the problem is about passing arrays by reference as arguments. The VB6 version is Declare Sub CALC Lib "CALC32.DLL" (ByRef V1 As Single,...more >>

Error while adding Class to COM+ using regsvcs .NET1.1
Posted by ravi_jon NO[at]SPAM hotmail.com at 4/19/2004 7:39:59 AM
Hi, I am having a strange problem when trying to register .NET DLL to COM+. I am using .NET framework 1.1. The DLL I created works fine through ASP.NET pages when I import the Class. But I want to register it under COM+ Services. I did the following: 1) Assigned Strong Name 2) I ad...more >>

COM and hosted controls in IE
Posted by Diego at 4/19/2004 6:36:03 AM
Hello I'm working on a .NET C# user control to use it in Windows Forms Applications. This User Control uses a COM Library via RCW. I would like to use the control also through a web page with <OBJECT> tag accessing via IE, in a similar way of old ActiveX Controls The point is that if I call the .h...more >>

Help 3DES File Encrypt in VB6 to 3DES File Decrypt In VB.NET
Posted by underwmd at 4/18/2004 12:51:18 PM
Hello, My problem is two fold. 1) I must support a deployed legacy application written in VB6 SP5. I need to export data from a database, compress it and the encrypt the data using 3DES (to prevent tampering) data gets transmitted at night to the home office of my company. Rewriting th...more >>

Problem Using PRNADMIN.DLL in .NET
Posted by Dave Wee Pei Yang at 4/18/2004 2:21:30 AM
Hi, Can anyone help? Although PRNADMIN.DLL was meant to be used by scripting however, due to certain requirements, I had to use it in my vb.net project as a COM interop. When enumerating the Printers using PrintMaster, everything's ok. Problem appears for enumerating Drivers/Forms/Ports. ...more >>

What delegate works for BOTH keyboard AND mouse?
Posted by ~greg at 4/17/2004 4:31:12 PM
I got the following signature from the E appendix of Adam Nathan's ".NET and COM...Interoperability Guide". --------------------------------------------------------- [DllImport("user32.dll")] private static extern IntPtr SetWindowsHookEx ( int idHook, HookDel...more >>

Exception not thrown in WebBrowser event handlers!!!
Posted by Neo at 4/17/2004 1:46:13 AM
See the code below. I only get the first messagebox. Private Sub AxWebBrowser1_DocumentComplete(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles AxWebBrowser1.DocumentComplete Dim doc As mshtml.IHTMLDocument2 doc = Me.AxWebBr...more >>

InvalidCastException calling Outlook
Posted by Jeff Curren at 4/16/2004 5:36:44 PM
Additional information: QueryInterface for interface Outlook._Application failed. I'm running: golApp = new Outlook.ApplicationClass(); gnspNameSpace = golApp.GetNamespace("MAPI"); on Windows XP with Outlook 2002. I've completed the steps described by KB Q309336 and downloaded the Offi...more >>

VBA.Excel.RefEdit via InterOp ?
Posted by Patrick Kowalzick at 4/16/2004 4:57:13 PM
Dear all, I set up an shared-add-in for Excel (2003) in Visual Studio (as well 2003 using c#). This works quite nice as well as putting in place menu structure or using forms. But I am a little bit stuck with a "range selector". Selecting several ranges in sheets out of a form would be nice...more >>

structs, pointers and other such magicks...
Posted by MZK at 4/16/2004 2:56:07 PM
Having asked a question recently about casting a byte buffer to a struct and receiving an excellent response from Mattias Sjorgen (sorry about that o ;) which resulted in the following code struct rec01 ushort rt .. byte[] buffer = new byte[512] rec01 rec // fill buffer with dat un...more >>

Event Sink tutorial - Error Updating Props using EventReg
Posted by Notlwonk at 4/16/2004 11:51:06 AM
Not sure where to post this Q I am trying to write a Managed Exchange Server Event Sink (as a class library) in C# I have been following this tutorial step-by-step http://www.codeproject.com/csharp/CsManagedEventSinksHooks.as So far so good....except when it comes down to binding the compone...more >>

Interop, COM Objects and asp.net
Posted by Midbar at 4/16/2004 10:42:15 AM
Hello! We are considering the purchase of some ASP components for a asp.net project. Our knowledge of Interop is very short. Vendor says that their components "are COM objects, not native .NET components, but using COM Interop assemblies you can certainly use them in a .NET environment." Ques...more >>

Type Mismatch when calling old COM through VB.NET
Posted by loudrider NO[at]SPAM hotmail.com at 4/15/2004 12:20:11 PM
Hi guys, I'm trying to call a method on this COM Object. I have an example on how to do this in VB6. However, I kept getting Type Mismatch Exception when trying this in vb.net. Here is the method signature : BOOL QryMessage(short MsgIndex, BSTR FAR* MsgText, BSTR FAR* MsgDetail, short FAR...more >>

Can't release Excel from Memory!
Posted by John Mark Howell at 4/15/2004 11:48:17 AM
I'm trying to handle when my app opens Excel and the user closes it instead of my app. Excel will remain in memory until a reboot. To demonstrate, create a CSharp WinForms app with one button. Here is the button click code: private void button1_Click(object sender, System.EventArgs e) { /...more >>

Accessing unmanaged DLL from C# client
Posted by Vini Deep via .NET 247 at 4/15/2004 9:37:14 AM
(Type your message here) How can I dynamically load a unmanaged dll in C#=2E Is it using= DllImport? As in VC, can I use the LoadLibrary() directly? I have an unmanaged C++ DLL which exports certain classes=2E I want= to access these classes from the C# client=2E I was able to do so= by mo...more >>


DevelopmentNow Blog