| TLBIMP-generated code doesn't do events right? (9 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm having trouble getting events to work correctly with TLBImp'd code. The problem, in a nutshell: TLBImp generates helper classes called eventinterfacename SinkHelper, but because those classes are not public, COM cannot call QueryInterface(IID IDispatch) on them. I don't know if this should be considered a TLBImp bug or a .NET framework bug, but it's definitely one or the other. Gory details: I... |
|
| Accessing common properties of Outlook Items in .NET (5 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm trying to find a clean approach to accessing the common properties of Outlook items using the Outlook object model under .NET. The Outlook Items collection can contain heterogeneous object types such as MailItem, PostItem, ContactItem etc. In VB6 it was possible to declare an item as variant and then you could access properties common to any of item types without having to cast to a specific o... |
|
| .NET component in COM+ (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello, I've created a component in C# that can be used from VB 6, as a COM component. Now, i need to register this component in W2000 COM . When i select the component in COM for a package, the following error message is returned: "One or more files do not contain components or type libraries. These files cannot be installed." Can someone help me? Thanks in advance, Rafael |
|
| Structure having Structure Array How to Declare- (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I wanted to use the IphlpApi function GetTcpTable in VB.NET, but the declaration I provide gives me error, I have tried a lot with no success, I would appreciate any help on this .. StructLayout(LayoutKind.Sequential) Public Structure MIB TCPROW Public dwState As Integer '// state of the connection Public dwLocalAddr As Integer '// address on local computer Public dwLocalPort As Integer '// po... |
|
| How should I define the HTREEITEM Win32 API Struct (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hey all, I have been working on a custom treeview and am wanting to implement the TreeView GetDropHilite and TreeView SelectDropTarget VC Macros as functions within C# and/or VB. I am curious in how I would implement the following struct definition that is in the commctrl.h of the PlatformSDK. typedef struct TREEITEM *HTREEITEM; Would I just have to implement this is an IntPtr everywhere that is i... |
|
| Calling COM object - Simple Interop Help Needed (8 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm trying to make a MAPI call. IAddrBook::GetPAB. The unmanaged signature is: MAPIMETHOD(GetPAB) (THIS ULONG FAR * lpcbEntryID, LPENTRYID FAR * lppEntryID) IPURE; So, I'm trying to use a managed signature of: unsafe void GetPAB ( [Out] out uint lpcbEntryID, [Out] out IntPtr lppEntryID ); But, no matter what I do, I get an ArgumentException. Any help is greatly, greatly appreciated. |
|
| Problem with Excel Application Lifetime from VB.NET (4 replies) |
| microsoft.public.dotnet.framework.interop |
| Hey, I am calling an excel macro within a specific workbook from a vb.net application. When I call the Quit method of the excel application object, the excel window disappears, however the excel process is still visible in task manager until the vb.net application is closed. I created a sample vb.net application that creates a new excel instance and then calls Quit immediately afterwards and the s... |
|
| building a COM object to be used with ASP (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello, I am having difficulties getting even the most basic COM object built with C# and have it working with an ASP page using Server.CreateObject. I have looked through the samples and based my work on the interop sample #2. I have added the strong naming and created a key pair with sn, and successfully added the component to the Global Assembly Cache with GACUTIL. It looks like it is properly r... |
|
| Help attribute on function (2 replies) |
| microsoft.public.dotnet.framework.interop |
| When declaring an interface, is there a help attribute I can use so the type library contains a description of a function? Here is an example interface: [GuidAttribute("0F46F113 ACC3 4ce1 83EB 4DFA9A4B6684") ] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] public interface ISessionClientEvents { [SomeCoolHelpAttribute("Authorize the user")] void Authorize(string joiner); void Acce... |
|
| "It Just Works (IJW)" or "When Not to Use PInvoke" (4 replies) |
| microsoft.public.dotnet.framework.interop |
| I have seen the phrase "It Just Works (IJW)" in Managed C ,contexts, but I was not prepared to see it in "Managed Extensions for C Migration Guide". Can someone please explain to me the intriguing paragraph: "When Not to Use PInvoke Using PInvoke is not suitable for all C style functions in DLLs. For example, suppose there is a function MakeSpecial in mylib.dll declared as follows. char * MakeSpec... |
|
| Verry worrying: where's my GC?! (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi all, Again, apologies if this is a stupid question. I'm creating an instance of a .NET wrapped COM object (Word8). The GC is not killing it when my program ends. I can see WinWord.exe in TaskMan after my application ends. I've tried setting my reference to the COM object to nothing, and calling Finalize and Dispose on it explicitly. Something is seriously wrong here surely? What's going on? Hel... |
|
| Consuming a 3rd party DLL function with a ** as a param (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Excuse me if I seem a little uninformed, I'm new to .NET. I'm trying to consume a DLL function that looks like this in its C header declaration: long SessionAlloc( SESSION** session, const char* server, long port, const char* connection, const char* userName, const char* userPassword); where SESSION is a struct with just one long as a member: struct SESSION { long unused; } I am trying to wrap it ... |
|
| tweaking the il (3 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm trying to modify my il so because tlbimp isn't doing the right thing when it comes to populating a passed in c style array. I thought I figured out the il modification need but when I try to run my app I get the following error message: An unhandled exception of type 'System.MissingMethodException' occurred in Unknown Module. Additional information: Method not found: Void esriCoreNet.IPolygon2... |
|
| What is the C# equiv for Shell()? (4 replies) |
| microsoft.public.dotnet.framework.interop |
| Hope this is the right group for this question but as the subject says: What is the C# equivalence for Shell to execute an external DOS command? TIA |
|
| .Net component call .Net Component(COM+) (2 replies) |
| microsoft.public.dotnet.framework.interop |
| hi, i have create a .Net component using c# and then i put it into the Component Service by calling Regsvcs.exe and then i have another c# program which call the that COM component.However, an Unhandle exception has thrown: [An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll Additional information: The server process could not be started because t... |
|
| COM Interop + Threading problem! Please help (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi guys, I am having a curious problem. I started on sample to study the behavior of .NET Threading with COM Interop. Basically, I do the following: 1. Main exe launches 5 threads each of which listen to MSMQ for incoming messages 2. When a message arrives, this "Q Listener" thread launches another thread. The threadproc has the following code CODE Thread.CurrentThread.ApartmentState ApartmentStat... |
|
| Interface/Member conversion (6 replies) |
| microsoft.public.dotnet.framework.interop |
| I have the following interface that I would like to write a custom wrapper for in C#. Can someone help me out. I can't find an example. This is all I have so far: namespace Test { [Guid("6DDED3B4 1F7C 11D4 9F7F 00C04F6BC8E8"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IGeometryEnvironment { } } Original IDL: interface IGeometryEnvironment : IUnknown { [ propput, helpcon... |
|
| is it possible to build a COM object to run in ASP with C#? (10 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello, Is it possible to write a COM object that is targetted to be run within a standard ASP page using .NET C#? I can write COM objects that can be accessed within a WSH file, but I have not been successful in getting it to work within an ASP page using Server.CreateObject(). I need to know if this is possible or if someone has actually got this to work. Thanks, Shan McArthur |
|
| Listing of applications (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello all, Does anyone know of a way to get a listing of running applications and processes on a computer through a c sharp program? A program I wrote needs to see if a certain program is already running when it fires up. Thanks. Timmy |
|
| Calling C++ code from C# (6 replies) |
| microsoft.public.dotnet.framework.interop |
| ..NET is supposed to make the mixing of languages easy because a lot of us have a great deal of existing code. For the life of me I can't figure out how to call my existing C code from the nice C# GUI I have created using Winforms. I've build my C code into a dll, but can't seem to hook up to it. Does anyone out there have an example or some good documentation that shows how this is done. |
|
| Getting intrinsic IIS Server,Request,and Response objects from C# component (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I am porting my business logic into DLLs called by ASP with Server.CreateObject() and want to know how I can get the intrinsic IIS objects from C#. I initially thought that I could do this in the OnStartPage() method with the ScriptingContext, however, further reading in MSDN shows me that I should be using ObjectContext instead. In VB6, I would just use GetObjectContext() and then look at the col... |
|
| Object pooling: COM+ activation error (6 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi all, I'm calling a .Net object configured for object pooling and I get the following error when calling the object for the 2nd time in a row (not the first!): "COM activation failed because the activation could not be completed in the specified amount of time." What did I configure wrongly? Thanks for helping me out! |
|
| How to StructLayout a struct with an enum? (4 replies) |
| microsoft.public.dotnet.framework.interop |
| [StructLayout(LayoutKind.Sequential)] public class EXPOSURE MODE { public MyEnum Param; } [DllImport("MyDll", ExactSpelling true)] public static extern void SetExposure(MyEnum program mode, EXPOSURE MODE Mode); In MyDll.dll, program mode is passed correctly, however, Mode.Param is garbage. How should I layout a struct that contains an enum? Ashok Thirumurthi |
|
| Maximize Process Window (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello all, I have written a program that uses a Process object to fire up another application. The application i am running starts with a splash screen and then goes to the main window. I set the Process.StartInfo.WindowStyle property to Maximized but it seems to only affect the splash screen. I was wondering if anyone knows of a way to get the the window that comes up after the splash screen to m... |
|
| passing c# arrays to c dll (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I am trying to pass a c# array of structures to a c dll. Anyone know how to accomplish this? I am using this function [DllImportAttribute("GDI32.DLL")] public static extern bool Polygon( IntPtr hdc, IntPtr lpPoints, int nCount); and have an array of POINT structs [StructLayout(LayoutKind.Sequential)] public struct POINT { public long x; public long y; } thanks, cjl |
|