| Auto interface conversion (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I am looking for a utility that can convert DLL export interfaces into the proper C# class interface. Is there such a beast or do I need to learn that a LPBYTE buf [MarshalAs(UnmanagedType.LPArray, ArraySubType UnmanagedType.U1, SizeParamIndex 4)] byte[] buf Thanks, Michael |
|
| Call FindMimeFromData from C# (3 replies) |
| microsoft.public.dotnet.framework.interop |
| I've been trying to convert the FindMimeFromData() function, from the urlmon.dll, into a C# friendly wrapper: HRESULT FindMimeFromData( LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer, DWORD cbSize, LPCWSTR pwzMimeProposed, DWORD dwMimeFlags, LPWSTR* ppwzMimeOut, DWORD dwReserved ); ...into.. [DllImport("urlmon.dll", CharSet CharSet.Auto)] public static extern int FindMimeFromData ( [MarshalAs(UnmanagedT... |
|
| does ComRegisterFunctionAttribute works in VB.NET ? (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I've a DLL where I've created a function with the ComRegisterFunctionAttribute attribute. but when I try to register this dll I receive an error where the DllRegisterServer function is unknown. my DLL is in VB.NET. any idea of what is the problem ? thanks. Jerome. |
|
| connetion log (4 replies, VIP) |
| microsoft.public.dotnet.framework.interop |
| HI I wish to log the connection status means What are all the queries issued using that connection object , time, result. How to get this?I wish write code in dll thx Murali |
|
| Code-Project Twain (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi ich habe folgende Definition: The definition of TW CAPABILITY is: typedef struct { TW UINT16 Cap; /* ID of capability to get or set */ TW UINT16 ConType; /* TWON ONEVALUE, TWON RANGE, */ /* TWON ENUMERATION or TWON ARRAY */ TW HANDLE hContainer; /* Handle to container of type */ /* ConType */ } TW CAPABILITY, FAR *pTW CAPABILITY; Was bedeutet hier TW HANDLE hContainer; /* Handle to container of... |
|
| What COM interfaces are implemented by Windows.Forms.Control & UserControl (4 replies) |
| microsoft.public.dotnet.framework.interop |
| I have created a Windows.Forms.Control and have exposed its COM interfaces. I am able to open this control, with a few registry modifications, in PowerPoint. However, it is clear that there are certain interfaces that PowerPoint requires that are not implemented. What interfaces are implemented? Howard Swope Software Engineer Spitz, Inc [http://www.spitzinc.com] |
|
| Marshalling a void pointer (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi all, I'm trying to make a call to an unmanaged dll. One of the members of the structure I have to pass to the function call is a void pointer. //Unmanaged C structure typedef struct sAStructure { void *Obj; ULONG StructureType; ULONG Code; ULONG Operation; } tAStructure, *pAStructure; This is how I would have thought you would have done it //Managed C# [StructLayout(LayoutKind.Sequential, Pack ... |
|
| Excel Interop Error wiht VB.NET (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello I have this code: ' Dim ws As New Worksheet() ws CType(objExcel.Application.Worksheets.Item (1),Worksheet) If ws.AutoFilterMode True Then ws.AutoFilterMode False ' Excpetion End If ' When i execute this code there is a exception on ws.AutoFilterMode False The exception is: {System.Runtime.InteropServices.COMException} System.Exception Message "Exception from HRESULT: 0x800A03EC." Option Stri... |
|
| Accessing Array of ELEMDESC for Type Library Function Parameter Info; Offsets for IntPtr (2 replies) |
| microsoft.public.dotnet.framework.interop |
| When working with reading information from type libraries, the "lprgelemdescParam" member of the FUNCDESC structure points to an array of ELEMDESC structures. Each structure element in the array describes one of the parameters for the function. How do I work with the array in .NET? I can use PtrToStructure() to get the first element, so I can write ElementDescriptionArrayPtr FunctionDescription.lp... |
|
| Component Services Mystery (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm running a pooled object in COM , and it functions properly, but I can't get it's statistics to display in the Component Services MMC snap in. In fact, the component doesn't even spin when it's activated. In the MMC, the "Component supports events and statistics" option is checked, and I'm even setting the "EventTrackingEnabled" to true declaratively (see below). ObjectPooling(Minpoolsize: 5, M... |
|
| using VARIANT in .NET (9 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a problem: a property of the DCOM class I'm trying to implement looks like VARIANT GetRecipes; in the type library. In .NET (C#), I can only interact with that through an Object. But an object doesn't populate the collection the way the old variants do: that means I cannot loop through the instance with something like myObject[index], while I could do it with a variant in VB. Needless to sa... |
|
| Declare as Decimal but marshal as Variant? CustomMarshaler needed? (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, public function GetDecimal as Decimal return value is marshalled as wchar t (shouldn't it be DECIMAL? But that's not the point) For a VB6 application it must by marshalled as Variant: public function GetDecimal as Object return 5d 'example (returns variant, sub type VT DECIMAL) end function works But: public function GetDecimal as marshalas(?) Decimal end function What do I have to write for t... |
|
| DllImport specified search path (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a third party 'C' interface dll that I need to interface to. I have been able to work through the PInvoke issues for other dlls, this one has me stumped. The problem here is that this dll loads other dlls. There is a large number of these dlls and they are segregated into a specified directory. The way this was handled before was to use LoadLibraryEx with the fully qualified path and LOAD W... |
|
| How To Marshall A Pointer To A String Ending In Two Nulls (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a structure member which in unmanaged code is LPCSTR. This needs to point to a file name terminated with two null chars. I don't think the marshalling code is putting the two nulls in the buffer it is creating. Anybosy dealt with this? Joel |
|
| VARIANT* containing SafeArray: marshalling fails (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a COM component with the following dual interface: Method([in]VARIANT input,[out,retval] VARIANT* output) The output variant is of type VT UI1 | VT ARRAY, ouput parray SafeArrayCreateVector(....) The .NET interop wrapper throws a SafeArrayTypeMismatchException when marshaling the output parameter. If the output variant is filled with a BSTR (vt VT BSTR, bstrVal SysAllocString(...)) the call... |
|
| SetThreadToken/OpenThreadToken (5 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a NullReferenceException when I call this method. Yes, the params wasn't null. [DllImport("Advapi32.dll", SetLastError true)] private static extern Int32 SetThreadToken([In] IntPtr threadHandle, IntPtr token); I think my declaration is not correct for BOOL SetThreadToken( PHANDLE Thread, HANDLE Token ); Also, I should ask: why OpenThreadToken fails when called? Someone have ever tried to im... |
|
| Convert a COM object to a WebService? (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I was wondering if there are tools to convert a COM object to a WebService? Thansk, Alex |
|
| File or assembly name XXX, or one of its dependencies, was not found (3 replies) |
| microsoft.public.dotnet.framework.interop |
| HI, I am having a problem loading an assembly from a server activated ServicedComponent. I am trying to load it as follows: objAssembly Reflection.Assembly.Load("MyAssembly") This works fine if the recompile the caller as library activated. All of my components are in the GAC. From looking at the details given by the Assembly Binding Log Viewer (see below) it seems that it is only looking in C:\Wi... |
|
| TLBIMP on MSACC.OLB fails (2 replies) |
| microsoft.public.dotnet.framework.interop |
| The Framework samples include two examples of automating Word and Excel. I assumed the same approach should work for Access. Unfortunately trying to create the interop dll fails with the error Resolving reference to type library 'ADODB'. TlbImp error: System.ApplicationException The assembly for referenced type lib rary, 'ADODB', will not be imported since it would overwrite existing assembly ' C:... |
|
| COM exception when querying Active Directory (4 replies) |
| microsoft.public.dotnet.framework.interop |
| I have some simple C# code that uses System.DirectoryServices.DirectorySearcher to query an Active Directory. The code works fine on my development machine, but on my test machine, .NET throws the following exception: [COMException (0x80070057): The parameter is incorrect] System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) 514 System.DirectoryServices.DirectoryEntry.Bind() 10 System... |
|
| Response.Redirect inside ASPX PAge kills inetserver.exe and aspnet_wp.exe (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Response.Redirect(), inside an ASPX page, shuts down IIS and NET Framework when redirecting to another ASPX page file. It works ok when redirecting to a plain HTML file. In fact, the problem occurs only when the "target" ASPX page is "opened" (When the Response.Redirect is inside a "Try/Catch" statement, no exception is catched). The following two messages are displayed: "inetserver.exe has genera... |
|
| Can't derive C# class from RCW class (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi. I have a VC6 ATL Com server that I have created an RCW for. My Com Server progid is 'MyServer.MyComObject' By importing the type library, I get a C# RCW assembly called interop.MyServer.dll, which contains the namespace MyServer and the RCW wrapper class named: MyComObjectClass. I then derive a new class from the RCW class MyComObjectClass: using MyServer; public class MyDerivedClass : MyComOb... |
|
| C# - C++ dll | Interop Callback Issues (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I'm trying to wrap a C dll interface into a C# class. I'm having problems passing a reference to a datastructure, to a callback method, and getting the proper values in the structure. I have several structures to pass, just trying the simplest one. Here is the structure def in C : Note the pragma directives: #pragma once #pragma pack(push,TESTAPI,1) typedef struct { BYTE OldState; BYTE NewStat... |
|
| What's wrong ? (struct with func pointers) (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Clear DayHi, I want to know what is the best way to convert this in C#... (myfile.h) typedef struct dx uio { int (* u read)(int, char *, unsigned); /* User Defined read() */ int (* u write)(int, char *, unsigned);/* User Defined write() */ long (* u seek)(int, long, int); /* User Defined lseek() */ } DX UIO; extern int cdecl dx setuio( DX UIO ); (myfile.c) #include myfile.h void SomeFunc() { DX UI... |
|
| Releasing COM reference? (4 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a COM (EXE Server) I'm calling from C#. Everything works great, But... The EXE server continues to run after I've 'null'ed all my references (I'm dbl checking this). It shuts down right after the .Net client shuts down. Is there something I can do to control this? Note, this happens on one machine, but not another. It's possible the problem machine is not up to date with .Net SPs. |
|