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 > july 2004

Filter by week: 1 2 3 4 5

subclass a window
Posted by Steven at 7/30/2004 7:30:49 PM
Hi all, I am trying subclass a window that belongs to another process and catch the WM_CLOSE message and update my process' user interface. Does anyone have any code, pointers to code, or ideas that will accomplish this end? Thanks, Steve ...more >>


COM interop registration failed error
Posted by pkujchliu NO[at]SPAM yahoo.com at 7/30/2004 4:48:35 PM
I know of a *lot* of people have posted message of this error: COM interop registration failed error. Type library exported encountered an error while processing '***'. Error: Type library export can not load type '*****'(error: Sytem.TypeLoadException: method ****** in **** doesn't have an impl...more >>

Marshal SCSI_PASS_THROUGH
Posted by Scott at 7/30/2004 2:07:02 PM
I've recreated the SCSI_PASS_THROUGH from ntddscsi.h and then tried to use the Marshal routines to set up the structures and call DeviceIoControl. I always get a failure on the Marshal.StructureToPtr call saying that I didn't pass a real object. Here's what I'm doing: [StructLayout(LayoutKind.S...more >>

Understanding Marshal when a string is to be returned from the API
Posted by Just Me at 7/30/2004 11:29:59 AM
I've tried to get an answer to this before in a NG that usually answers so I'd guess it is not common knowledge. The following does work. 1) I'd like to kinow me why String works in this case. Since String can't be changed I thought StringBuilder should be used since I'm looking for a retur...more >>

winspool.drv interop?
Posted by Harry Simpson at 7/30/2004 11:16:16 AM
Can winspool.drv be interopted for a Windows Forms application. The WMI is not bringing back accurate info on status so.... I've got API declares but the API call is very unstable and crashes and brings down the call app. Try catches just don't work. Help! Harry ...more >>

Unable to get the window handle for the 'AxWebBrowser' control.
Posted by TS at 7/29/2004 11:41:45 AM
Unable to get the window handle for the 'AxWebBrowser' control. Windowless ActiveX controls are not supported. I am using the active x microsft web browser control. I am using a windows application in c#. I have a form that uses this control and it works ok, then when this new form finishes lo...more >>

How to detect network cable disconnection
Posted by vijaypatil78 NO[at]SPAM yahoo.com at 7/29/2004 3:13:46 AM
Hi all, i have TCP client server application written in C# using async socket methods, eg BeginReceive(), BeginEnd() etc server is continuesly running in the background, client connect to server and recives data from server. If server application shuts down client immedeatly recieves d...more >>

How to Marshal a Variable Length Structure
Posted by Charles Law at 7/28/2004 4:49:40 PM
Sorry for the cross post, but I have just realised that this might be a better place for this question. Can anyone suggest how I would marshal a variable length structure back from an API call. Specifically, I am looking at the WaitForDebugEvent function, which returns a DEBUG_EVENT structure....more >>



Help with PIA's and Office 2000
Posted by Frank Bacon at 7/27/2004 9:26:32 PM
I wrote an app that transferred data from Excel to Access (Office 2000 on XP Professional). I had it in release form and it was working fine. I installed PIA's to develop another App and now I get an error on the first App informing me of an unhandled Exception of the type "System.InvalidCast...more >>

Web Browser control: navNoHistory flag doesn't work
Posted by rsmith_666 at 7/27/2004 6:38:04 PM
I've created a project with a web browser control according to KB article 325079 (C#). The BeforeNavigate2 event fires correctly, but I'm not able to prevent the URL's from going into the browser history. I've tried to modify the Flags parameter in BeforeNavigate2 event but that had no effect and ...more >>

binary compatibility support for .NET assembly
Posted by someone at 7/27/2004 6:16:38 PM
Suppose that I have a class in an assembly that is delivered to the user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run with recompiling and relinking. I know that if I define an interface, and only expose the interface ...more >>

strong naming DLLs
Posted by DotNetJunkies User at 7/27/2004 3:15:22 PM
I created a .NET (DLL) called DBWrapperNET.DLL. It uses ADO 2.8 for the DB access. This DBWrapperNET.DLL is to be used by multiple VB6 applications. I wanted to "strongly name" this DLL so that it can be shared by different VB6 applications (like we created other DLLs and register them). I am n...more >>

COM Object Lifetime when called from VB.NET
Posted by Greg Doherty at 7/27/2004 12:02:28 PM
Hi, I have a C++ COM class that I instantiate from VB.NET, but the object never gets released. Is there something that I need to do to force the destruction of the object? Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim Im...more >>

Using VB.Net or C#, utilizing the clipboard object, how to copy an MS Excel graphic from the clipboard to an image control and obtain its source refer
Posted by TC at 7/27/2004 9:39:21 AM
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl + C -- Go to Word and look under Edit > Paste Special -- Note there is a source reference and an o...more >>

Marshaling Fixed Length Strings in Structure
Posted by Tom Wells at 7/26/2004 4:09:38 PM
I trying to pass this structure to a dll: <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi, Pack:=1)> _ Public Structure udtINTER01 <VBFixedString(8), MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public action As Char() <VBFixedString(7), MarshalAs(UnmanagedType.ByValArra...more >>

Help with Excel and Interop?
Posted by cduden at 7/26/2004 2:40:36 PM
I'm linking an excel workbook programmatically to a powerpoint presentation via an add-in written in C#. When opening the presentation, I check the document to see if it is the latest version, refresh the object if it isn't, and powerpoint spawns an Excel process that never goes away, which effe...more >>

Problem calling unmanaged API Functions
Posted by Brent at 7/26/2004 11:11:13 AM
Hi guys, Here is my problem: I have a C DLL function I need to ccall from VB.Net. long PBFNProcess(void *Reserved1, void *Reserved2, void *Reserved3, void *Reserved4, void *Reserved5, void *Reserved6, void Reserved7, void *Reserved8, void *Reserved9) These are all optional pointers to ...more >>

P/Invoke to Shell32 SHFileOperation
Posted by Brian Reed at 7/26/2004 2:01:01 AM
SHI am trying to use the Shell32 operation FileOperation to send a file to the recycling Bin. I have defined the structure in my class as follows and am hoping my definition is correct. Please let me know if I have it correct: [StructLayout(LayoutKind.Sequential)] internal struct _SH...more >>

Internet Explorer Automation
Posted by Adam Stirk at 7/26/2004 1:40:59 AM
Hi, I have a application that I need to create multiple new "iexplore.exe" processes (show more than once in taskmanger) and control them using the shdocvw/mshtml. I am able control Internet Explorer with instances created with the shdocvw. e.g. Activator.CreateInstance(Type.GetTyp...more >>

Best way to implement an object queue for excel interop
Posted by chrismasiero NO[at]SPAM hotmail.com at 7/25/2004 10:38:40 PM
Hi, I have written a class that intergrates with excel via the com interop in vb.net. Everything is working very nicly, no memory leaks and the excel process comes down gracefully. The only problem I can see myself facing now is that my web app is going to be hitting the excel stuff fair...more >>

How to marshal a struct
Posted by Thomas at 7/23/2004 3:01:02 PM
Hi, I am having difficulty accesing the member data in a struct. This what I am doing. In unmanaged code typedef struct { char name[20]; int id; } person; In C# [StructLayout(LayoutKind.Sequential)] public class person { [UnmanagedType.ByValTStr, SizeConst=20)] public string ...more >>

Exception thrown in managed C++ not understood in unmanaged C++
Posted by Mark Traudt at 7/23/2004 6:22:01 AM
The following managed C++ function is called from an unmanaged C++ DLL: double Divide( double num, double denom ) { if( denom == 0.0 ) throw new std::exception( "divide by zero" ); return num / denom; } The caller calls the function within a C++ try-catch block, with the follow...more >>

How to avoid this problem..
Posted by Henry at 7/22/2004 11:02:12 PM
I have written this code and it worked like a charm without any problem, DirectoryEntry de = New DirectoryEntry(); de.Path = path; de.UserName = userName; de.Password = password; de.AuthenticationType = AuthenticationType.ServerBind; de.RefreshCache(); string myName = "Henry"; de.Propert...more >>

.NET and COM Interop
Posted by Stephan Scheidl at 7/22/2004 5:01:35 PM
I have written a class library in c# and want to use it in VB6. Everything works fine so far but when I try to assign a value (an array of type defined in c#) to a property definded on the c# side the vb compiler does not want to compile. Reading access to the property is working. I added a func...more >>

COM+ and dlls in VB .NET (urgent)
Posted by Reza at 7/22/2004 11:26:51 AM
This looked pretty simple to me at first, and perhaps it still is, but I havnt been able to find out just what the trick is. Basically the aim is to compile a dll from VB .NET, which can be read using previously written Java code (or anywhere else) which reads and executes the methods within t...more >>

how to define this?
Posted by ZhangZQ at 7/21/2004 3:53:04 PM
if there is a C function in a DLL(My.dll) has this declaration, struct MyStruct { int a; int b; }; int MyFunc(int param1, MyStruct** param2); how to define this in C# ? if there is another C function like this int MyFunc1(int param1, char** szRtn);, I can define it as [D...more >>

PINVOKE an API requiring a callback
Posted by Paul Schauble at 7/20/2004 8:50:14 PM
Using EnumWindows as an example. PINVOKE EnumWindows is easy. How do you handle the callback. ++PLS...more >>

Q: P/Invoke with C-RunTime Library fopen() and FILE struct
Posted by Jacek at 7/20/2004 6:42:20 PM
Hello! My app has to use externel dll with ANSI C interface. Some of IO functions require passing prehistoric FILE struct as a parameter for any output input operations. I tried to call it with P/Invoke using following code but with no success, the return value from fopen seems to be valid ...more >>

COM interop, pathing from .NET
Posted by Troy at 7/20/2004 2:56:02 PM
I am having a problem which does not occur on all machines. I have a C# DLL that is being accessed by a VB6 app. After specifying COM interop on the C# project, and also using regasm /tlb on the deployed machine, the VB6 app will only 'find' the C# DLL if it located in the same directory. The C# ...more >>

Overloading Problem. Plz help !!
Posted by Maverick at 7/20/2004 2:38:02 AM
I have 2 log method overloaded in a VB.Net COM. ____________________________________________________________ Public Sub log(ByVal type As Integer, ByVal msg As String) Public Sub log(ByVal type As Integer, ByVal msg As String, ByVal ParamArray args() As String) __________________________________...more >>

how to get the system shell imagelist
Posted by baisword at 7/20/2004 2:36:04 AM
i wanna to use the following code to get the system imagelist ,but it doesn't work well,the value of variable iconCount always equal 5,and so i can't get the correct imagelist. pls help me with the correct method ,thanks! //note :the class SHFILEINfO and enum SHGFI has been defined previously...more >>

Problem using RegisterDragDrop to register a IDropTarget
Posted by SunStar at 7/20/2004 1:23:32 AM
Now I want to use RegisterDragDrop method to register a IDropTarget to a panel on my form.Below is my code, when I drag some url link to the panel , I found that the IDropTarget's dragenter method was invoked by drag, but the DragDropEffect always None so the drop method was never invoked. What '...more >>

how to Open an Office Document
Posted by Hazira B at 7/19/2004 9:05:03 PM
Can anyone tell me how to Open an Office Document in Visual Basic .NET Thanks in advance... -- Yours, Hazira B...more >>

IEnumIDList.Clone Implementations
Posted by Andreas HÃ¥kansson at 7/19/2004 8:33:13 PM
I'm struggeling to get this stuff into my brain =) Are all of the three declarations valid for the IEnumIDList.Clone metod? The first idea i had was that if I don't need the HRESULT return value I could do it like this void Clone( out IEnumIDList ppenum); Then I got thinking.....more >>

Problems using IPersistFile with VB.NET
Posted by Robin Tucker at 7/19/2004 5:27:08 PM
I'm having problems with the IPersistFile interface. We have in house objects that support IPersistFile (and have done for years). I would like to load an object using this interface with VB.NET (note: I'm already successfully using our IPersistStorage interface for structured storage with oth...more >>

C# Browser with HTA permissions ~ JOB request ~ Earn praise & cash.
Posted by jOs at 7/19/2004 11:20:17 AM
Attention all coders, I have posted a job on rentacoder. It is on topic for this newsgroup. If any of you are able to do it, you might as well log on and get paid. Thanks for considering this work request, I am willing to pay for work done and would like to hear from people who can do it. ...more >>

ANN: .NET 2.0 Beta - CODE COVERAGE EDITION
Posted by Thomas Scheidegger [MVP] at 7/17/2004 9:44:38 AM
NET Framework Version 2.0 Redistributable Package Beta 1 (x86) CODE COVERAGE EDITION The .NET Framework Code Coverage Edition is a new mechanism that enables you to give Microsoft direct feedback on what portions of the .NET Framework and Win32 you're most reliant on. http://www.microsof...more >>

VB Code question
Posted by Coder at 7/17/2004 7:34:30 AM
Can you write this code in a VB .Net application? Or is this code only understood by the VB .Net compiler? Public Sub LateCall( _ ByVal Instance As Object, _ ByVal MethodName As String, _ ByVal Arguments() As Object, _ ByVal ArgumentNames() As String, _ ...more >>

Serialize / Deserialization troubles .. Please help !!
Posted by agarwalpiyushk NO[at]SPAM yahoo.co.in at 7/16/2004 12:11:39 PM
Hello, I am trying to use shared memory mapped files for IPC between two applications, one of which may be in C++ (non .NET envi) As a first step I am trying to get serialization / deserializtion working within a single application and getting exceptions and errors. "Binary stream does not ...more >>

Where to Find Documentation for Interop Modules
Posted by David Elliott at 7/16/2004 10:50:37 AM
I am looking to do some work using Outlook. This is a link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnout98/html/msdn_movs105.asp that explains what I am going to do. My question is how do I find documentation for Interop Modules Given the following code, how can ...more >>

.NET Client calling Java webservices. Slow Performance
Posted by lnarasimhamurthy NO[at]SPAM labvantage.com at 7/16/2004 7:56:50 AM
Hi All, I am having performance issues with the .NET client calling the Java Webservice running on axis. Have detailed the problem below. Please help. I wrote a webservice in Java. Lets name this WebService1. (using Apache Axis 1.1) Scenario 1: ----------- I have a VB.NET code exposed ...more >>

Specifying credentials for access to a network share (UNC)
Posted by Robert Bouillon at 7/15/2004 10:42:50 PM
Is there a way to specify credentials to a network share without using impersonation? I have a backup program that contains a username/password for a target directory to drop zipped files to. The network share requires authentication, however, and I cannot map a network drive. Is there a way t...more >>

Want to work & share FULL-CODE base for #C WebBrowser ???
Posted by jOs at 7/15/2004 9:55:03 PM
C#B - SHARED SOURCE PROJECT FOR A C# Browser Let's sort this stuff out once and for ALL. =============================================================== Anyone who's having problems in the design space "C# WebBrowser Customization" is welcome to join me on...more >>

C# Interop of C dll passing a struct
Posted by Little Gazer at 7/15/2004 4:38:01 PM
I have a C dll which interfaces to a voice card. The function call requires a special structure to be passed. I am attempting to wrap the C dll in a C# class so I can use C# instead of C. The C structure is as follows: typedef struct { TCASGroupIndex firstGroupIndex; /* Index of first CAS ch...more >>

crash in mscorwks on 'simple' call, should be IUnknown but looks like it is trying IDispatch
Posted by Chad DePue at 7/15/2004 4:01:16 PM
Hello, I have a COM interface that looks like the one below (this is a simplied version). IFolder.GetNextItem always returns a subclass of IMyItem. The implemented classes for this typelib are in C# (SDK 1.1), the caller is a Win32 app. When my Win32 class gets a subclass of IMyItem and calls ...more >>

Attach a .NET Stream Class to StdOut/StdErro in StartupInfo for CreateProcessWithLogonW???
Posted by Shawn Anderson at 7/15/2004 12:37:37 PM
Anyone know how to do this? I have CreateProcessWithLogonW working in my C# app, but I cannot seem to be able to attach a handle to the StdOutput in the STARTUPINFO structure -- no matter what I do, I get a "Invalid Handle" error (Win32 error 6) Here is some code for anyone that is interes...more >>

OCX interop causes "Catastrophic failure"
Posted by Ian Hartley at 7/15/2004 4:37:01 AM
I have a 3rd party OCX control that I can happily use with VB6. E.g. Private bool As Boolean Private ocx As OCXLib.ocxInterface Private Sub Form_Load() Set ocx = New OCXLib.ocxInterface bool = ocx.Method() End Sub When I try the equivalent in VB.NET using the code: Priva...more >>

How to Get .Net dll's ClassId on VC++6 before CoCreateInstance ?
Posted by Maverick at 7/14/2004 8:46:02 PM
In VC++, I have to hardcoded the .net dll's ClassId if i want to create the com instance. How can i get the .net COM's classID without having to create the instance first ? --------------------------------------- #import "Sample.tlb" using namespace Sample; //******NOTE****** const IID CLSI...more >>

Need verification on RefreshCache method
Posted by Henry at 7/14/2004 7:00:48 PM
I feel rather confuse with the RefreshCache method. Let say I call the method using the following code, DirectoryEntry entry = new DirectoryEntry(); entry.Path = path; entry.Username = userName; entry.Password = password; entry.AuthenticationType = AuthenticationType.None; entry.RefreshCa...more >>

Marshalling riddle
Posted by joerg NO[at]SPAM krause.net at 7/14/2004 10:28:18 AM
I've an interface with the following method: void Show( [In, MarshalAs(UnmanagedType.I4)] int fShow); void UIActivate( [In, MarshalAs(UnmanagedType.I4)] int fUIActivate); When I call these methods, using this cocde in C#: interopDocumentView.Show(-1); interopDocumentView...more >>


DevelopmentNow Blog