| Exception not being caught (3 replies) |
| microsoft.public.dotnet.framework.interop |
| While using the System.Management namespace I'm trying to connect using the ManagementScope object as follows: try { ManagementScope wmiMgmtScope new ManagementScope(); wmiMgmtScope.Options.Username "NAME"; wmiMgmtScope.Options.Password "PWD"; wmiMgmtScope.Path.Server "SERVER"; wmiMgmtScope.Connect(); } catch(Exception e) { Console.WriteLine(e.Message); } If I use a invalid password, I get a unhan... |
|
| COM Interop - The provider could not determine the Object value (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi all, I have a COM Component in COM . I have a .Net wrapper for it, which I use for invoking the COM Component. Th COM Component returns a Recordset. Now I use OLEDb providers fill method to fill a DataSet from this recordset. When I do this, I get a error which says "The provider could not determine the Object value. For example, the row was just created, the default for the Object column was n... |
|
| Tlbimp generates Interop with no exposes classes (5 replies) |
| microsoft.public.dotnet.framework.interop |
| I recently wrote an application that allows an end user to modify settings in an .msi installation database file. The application was written in C# and worked fine in Beta2 of .NET. After recompiling to the final version of .NET and running the program there is a problem. Using Tlbimp to generate an Interop DLL for the MSI.DLL generates an interop that appears to no expose and class objects. The i... |
|
| callbacks with unmanaged code (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi all, Im trying to implement a C# callback that I can pass to the WinApi midiInOpen. I do get called back once as the midi port opens but thats all. I dont get called back after the first time and my app wont shut down properly. I suspect the garbage collector is deleting my callback how do I make it stick around? Heres what Im doing so far... public delegate void MidiInProc(uint hMidiIn, uint w... |
|
| using out-of-process COM object (2 replies) |
| microsoft.public.dotnet.framework.interop |
| CoCreateInstanceEx allows you to pass machine name that runs COM server. How I can do it in .NET when I create the object with "new"? |
|
| C# accessing PowerPoint/MSGraph.Chart causes "Old format or invalid type library" exception (6 replies) |
| microsoft.public.dotnet.framework.interop |
| I need access and modify embedded Chart object data in PowerPoint 2000 presentation. Otherwise I'm able to (fully) manipulate the PP presentation, but when I try to access Chart (and it's DataSheet), following exception is thrown: System.Runtime.InteropServices.COMException (0x80028018): Old format or invalid type library. at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingF... |
|
| Using COMs on remote mashine from C# (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello, Maybe anybody could describe step by step procedure what do I need to do to use a COM object residing on different mashine from C# Web Application. Do COM classes need to be registered locally? How do I do that? I could not find any documentation on this topic so far thanx a lot, Gundas |
|
| Please! Please! Help me to get ridd of the CopyMemory function. (4 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I working with MS WTSAPI in VB, I have all functions working in VB 6, now I'm trying to do the same in VB.NET. The code below worked with VB.NET BETA 2, now I get errors in copy memory function. What I would like to know is how should this code look like in a "TRUE" VB.NET. I hope some one "guru" out there could please help me to conver correct this example below. Regards, Richard Eikeland ric... |
|
| C# and overloading vs. MIDL defaultvalue (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have made an ATL/COM library originally intended to be easy to use from VB6, VBScript and ATL/COM. Some of this ease of use is due, in part, to extensive use of the MIDL defaultvalue attribute. (I chose to use defaultvalue over optional because the two approaches are equally easy in VB6/VBScript, but defaultvalue is, I think, easier to use in ATL/COM.) I find that, through the magic that is COM ... |
|
| C# - Marshalling simple types as VARIANTs with Word 2000 (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm very frustrated at how difficult this has been to figure out. I've read almost all the ..NET interop documentation and all postings here with VARIANT in the body, but it's still unclear. I've never used COM components heavily, but my understanding of Variant data types is that they are simple structures that describe and point to the data being passed. In J , there were a few Variant classes t... |
|
| using WM_COPYDATA for interprocess communication (2 replies) |
| microsoft.public.dotnet.framework.interop |
| for backward compatibility, I need to handle a WM COPYDATA message. the problem i am encountering is that the data that needs to be copied is contained in a C type string (null terminated). i have defined a struct (see the attached files), that contains an int member and a char array, defined as (globals.cs, line 28): public int iMot; [MarshalAs(UnmanagedType.ByValArray, SizeConst 128)] public cha... |
|
| Calling Biztalk from a component with a strong name (7 replies) |
| microsoft.public.dotnet.framework.interop |
| hello, I am attempting to call SubmitSync from a vb.net component. All is well until a add a strong name to the component. It produces the following error. Unable to emit assembly: Referenced assembly 'Interop.BTSInterchangeLib' does not have a strong name Any help in solving this would be appretiated. scott |
|
| IMalloc * (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Does anyboy know how I can handle SHGetMalloc(IMalloc * pMalloc) in C# and .NET? I could not find anything like SHBrowseFolder() in .NET so I decided give win32 interop a try. I got everything working fine including the callback mechanism, but the pidl I get from SHBroweFolder() has to be freed by me by getting the Shell's IMalloc interface. Then I have to call release on IMalloc. .NET support for... |
|
| UnmanagedType.LPStr steals my buffers (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm using C# to access an old school C DLL (from clearparse.sourceforge.net) that has structs of this form: typedef struct tagSFilePos { ULONG nCharOffset; ULONG nLine; ULONG nLineOffset; LPSTR pszFile; }SFilePos; Typical usage would be like this: SFilePos FilePos; memset(&FilePos,0,sizeof(FilePos)); ClearParseDLLFunction(&FilePos); The ClearParseDLLFunction() function will then make assignments t... |
|
| Mashaling a C-style array of structs (4 replies) |
| microsoft.public.dotnet.framework.interop |
| I am having problems marshaling a C style array of structs from COM to the CLR (C#). Examples in MSDN seem to provide some leads as to how to marshal a C style array of int using the function Marshal.Copy( buffer, arrayRes, 0, arraySize ). Not much on arrays of structs. when I tried to use Marshal.PtrToStructure I got an error. Any help is appreciated. Thanks http://msdn.microsoft.com/library/defa... |
|
| Handling an HTMLElement's onclick event. (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I've been messin' with imported WebBrowser and MSHTML.dll "pieces" and can't figure out how to simply handle an onclick event on an arbitrary element. Is there any way anyone could post an example or point me to one? Thanks ahead of time Matt |
|
| QueryInterface in my COM object from C# .NET app (5 replies) |
| microsoft.public.dotnet.framework.interop |
| I am trying to QueryInterface in my COM object from C# .NET app. As I understand System.Runtime.InteropServices.Marshal.QueryInterface that takes IntPtr types should do the job. But I don't know, and couldn't find any clues/samples, how to cast IntPtr parameter to my interfaces. I have tried a few things and neither worked. |
|
| VB.Net Events in COM Interop (2 replies) |
| microsoft.public.dotnet.framework.interop |
| After converting an existing VB6 dll to .net I'm now trying to get VB6 clients to use the .net dll. To accomplish this I added the following to the AssemblyInfo.vb file of my .net library : Assembly: ComVisible(True) Assembly: ClassInterface(ClassInterfaceType.AutoDual) (I understand that there are COM versioning issues with this approach but I can live with that while I run some tests.) After reg... |
|
| Interop marshalling for Decimal as a return value (7 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm trying to use TLBIMP to create an interop assembly for an automation server whose return type is decimal (VT DECIMAL). Trying to call the automation server, however, results in the following exception: Unhandled Exception: System.TypeLoadException: Method's type signature is not PInvoke compatible. at ... Things work fine if you use a decimal as an argument rather than the return value. I've s... |
|
| Security Issue in COM Interop (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I have a VB COM Component which returns a Recordset Object. I have a managed wrapper. But when I invoke it from ASP.NET I get the following error "Exception Details: System.UnauthorizedAccessException: Access is denied. The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited p... |
|
| how can I use interop to get an array of string back from a dll ? (3 replies) |
| microsoft.public.dotnet.framework.interop |
| hi all, I have a function in a DLL exported like this "DllExport char *DSGetthingList(void)" the return value (the char*) is an array of strings seperated by nulls with two nulls at the end. how can I get this back intact ? I have tried StringBuilder and String and String[] but I only ever get the last string in the array back. i.e [DllImport("C:/build/server/asd/asd.dll")] internal static extern ... |
|
| IClassFactory2::CreateInstanceLic() (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I need to create an existing COM object (it is an ActiveX control) through a class factory: IClassFactory2::CreateInstanceLic() How does this map to the .Net Framework, where I have imported the ActiveX control through the "Customize toolbox" menu item and dropped it onto a windows form? How can I specify the license key for the imported control? Thank you, Christian |
|
| .NET/COM Collections (2 replies) |
| microsoft.public.dotnet.framework.interop |
| According to this really cool document I found at http://www.codeproject.com/dotnet/cominterop.asp, my metadata proxy should show my collections implementing System.Collections.IEnumerable... but it doesn't. My COM collections implement Count, Item and NewEnum, all according to COM's collection rules. What am I doing wrong? |
|
| Help with VB interop calls to SetConsoleCursorPosition (4 replies) |
| microsoft.public.dotnet.framework.interop |
| Tried creating a VB.NET console app that made us of the Win32 SetConsoleCursorPosition function via interop, but getting a false. I'm not yet familiar with the proper methods of setting up the interop codes, by here's a small test that fails. Can anyone offer insight and/or correct code for doing what I want? Thanks in advance. Imports System.Runtime.InteropServices Module Module1 StructLayout(Lay... |
|
| How to get notified of volume/cd changes? (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I would like to have my app notified about swapping of Zips, CDs, Disks etc.? Any suggestions? |
|