| System.InvalidCastException: QueryInterface for interface xxx.yyy failed. (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I encountered some strange things here, when consuming COM component from within .NET component. Error message is as the subject. I don't get that error when using Windows Form. It only happens when I use Web Form. Please help me with this. It's been bugging me for days. I am using DotNet Framework SP1. Thanks |
|
| STAThread Attribute - conflicting MS Documentation and testing (5 replies) |
| microsoft.public.dotnet.framework.interop |
| All, I have found to places in the MS documentation on this attribute and it's usage. According to the article: http://msdn.microsoft.com/library/default.asp?url /library/en us/cpguide/htm l/cpconcomcomponentcompatibility.asp "STA components cannot be used from .NET Framework code modules (compiled ..NET assemblies); they can be used only from ASP.NET pages." I have easily created a VB 6 DLL and r... |
|
| Converting an ActiveX-EXE Project to .NET...? (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello, i used the VBUpgrade utility located in the %NETDIR%\VB7\VBUpgrade on an existing VB 6 project of type ActiveX EXEcutable, built it, registered it with the REGASM Utility. Somehow the local Active X Server which existed before disappeared in registry and each time I instantiate the new main class "Application" of the program from a Visual Basic Script I get a new instance of the class inste... |
|
| Problems with Flash MX (3 replies) |
| microsoft.public.dotnet.framework.interop |
| I had Macromedia Flash working within Windows Forms just fine until the new Flash MX came out. Now .NET tries to do the Interop but I get various errors. This happens using existing code and when I add Flash to a new project. Anyone know how to fix it? Thanks, Jeff Rhodes |
|
| Unmanaged forms' handles (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I am implementing a .NET windows that will be used by a COM app. I need to assign the Owner of the main .NET form to an unmanaged form, which I know its handle. How can I assign a .NET form's handle to a known one? Or, how can I obtain a IWin32Window interface from an unmanaged form? Thanks in advance, Diego Diaz |
|
| Excel process does not die (3 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a ASPX page that creates a Excel spreadsheet. Everything works fine except that the object will not die, it stays in memory as a process. The code works fine in a regular C# application. Is there something with aspnet wp that could be keeping it alive? Any ideas would be helpful. Thanks, Charles |
|
| pass byte from C++ to C# (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a C# COM object wich has a method with a byte[] as a parameter: method1(byte[] byteArray); My unmanaged C application should be able to co create my C# COM object and call method1, passing in a array of bytes. I need for the array to be unsafe; i.e. the IDL for the method would appear as HRESULT stdcall method1([in] unsigned char* byteArray); How should the method be written in C#? I have t... |
|
| C# and C++ Interop (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Is there anyway to use a c function that my friend wrote in a c# web app that I am making? |
|
| BUG: "Windowless ActiveX controls are not supported" encountered even when controls were not windowless (4 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi All, I got this bug and here are the steps to reproduce it: 1) Use VB6 to create a UserControl, make sure the Windowless field is set to FALSE. (Alternatives: You can use VC ATL/MFC to create a windowed ActiveX control, or just use an existing MS ActiveX control) 2) Use VB.NET to create another UserControl. Make this user control contain the ActiveX control created in Step 1. 3) Use VB.NET to c... |
|
| Accessing Collections (DataSet named collections specifically) (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a .NET component that's published via Interop. One of the methods returns a DataSet and I'm able to get at the data with something like this: o CREATEOBJECT("DotNetCom.DotNetComPublisher") loDs o.GetAuthorData("172 32 1176") loRow loDs.Tables.Item(0).Rows(0) ? loRow.Item(0) Is there any way I can get at the collection items by name? loDs.Tables.Item("Authors").Rows(0).Item("au id") would be... |
|
| How to integrate a C++ Dll into a C# .Net Project? (4 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi all, I'd like to know if it's possible and what are the consequences of integrating a C dll (simple one with a couple a classes, the use of MFC classes use of RASAPI32.dll that is dynamically linked to my dll) to a C# ..Net project... In fact we have started a project with some business C dll modules and now we want to integrate these objects to a .Net application but we don't know if we have t... |
|
| Question about interop C# -> C++ dll (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I read thank to some people here that I can import a C custom or API dll into a C# project... I have seen examples in the .Net framework but only with a simple custome dll exporting a C style class... Is it possible to Import in a C# project a VC 6 Dll exporting classes and functions designed with MFC? That means that some functions take MFC data types as parameters and classes contain functio... |
|
| CopyMemory for DirectX call in C#? (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello! I'm translating some DirectX samples to C# using InteropServices but I'm stuck at one crucial point with two (or maybe three) possible solutions. Choice 1 Use CopyMemory: I've got an object of type "Direct3DVertexBuffer" that has been initialized for me. I also have an array of data. I'd like to copy the data from the array into the object. In VB6 the code looks like: 'lPointer holds the po... |
|
| Trouble sending SMTP from VB .NET (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have written a small app in VB .NET to send an SMTP mail when a checked NT service stops. I built this app with .NET Pro on XP Pro. I've compiled it, and it runs great on XP but when I try to run the compiled app on a Win2k machine, it errors out sending mail. I've included the error here. The Win2k machines have the .NET Framework loaded. Anyone seen anything like this before or have any sugges... |
|
| An array of structs as IntPtr ... ? (6 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, good folks! I'm probably not good enough to properly describe my problem, but I'll try my best. I have a C COM object that I want to interact with from C#. One of the methods sends over an array of a struct. I've understood from other messages in this group that using an IntPtr is the thing to do. Say I have the following code: IntPtr ptr Marshal.AllocCoTaskMem(Marshal.SizeOf(carArray[0]) * (c... |
|
| Runtime can't find DLL (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I am in the process of porting my shell namespace extension to .NET and have a C# DLL which the Main namespace DLL uses, so something like this: Explorer.exe Namespace.DLL C#Util.DLL Interop.Outlook.DLL The namespace DLL is loaded fine by explorer however when I try to do things in the namespace that require the C# DLL I get an error "Assembly not found" I thought that putting the C# DLL in th... |
|
| Short Question: (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Is an IntPtr a pointer to a location on the heap ? If I have the IntPtr, can I manually iterate over the elements of a structure located from this point onwards in memory ? I need to pass structures to native c code so I am wondering how to Do this. The elements of the structures are WCHAR[] strings. Thanks, Chris |
|
| How to create System.IntPtr from array of structs? (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello! I've got an imported COM object that wants a parameter of type System.IntPtr. The data structure I'm passing is an array of structs. The struct looks something like: struct struct1 { public int i1; public int i2; } The array looks something like: public struct1[] tempStruct1 new struct1[10]; I've tried various unsafe{} blocks, but they all have syntax errors. I'm not really sure how to get ... |
|
| char * and .NET strings in structs (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a question that I hope someone here can answer. Were are working on a platform independent C dll and one of the structs in the header file looks like similar to this. struct CommonHeader { char * Name; char * Description; char * Version; }; We also currently have the VB.NET structure declared as follows StructLayout(LayoutKind.Sequential, CharSet: CharSet.Ansi) Public Structure CommonHeader... |
|
| Application Instance in .NET? (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi Guys, I was hoping someone knows how to get the application instance of a .NET Windows Form. I need it for interop with C libraries that need the application instance... Thanks in advance! Michael Michael Kennedy United Binary http://www.unitedbinary.com |
|
| marshaling interfaces (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Q. Is it possible to marshal an interface from C# to unamaged code (via Platform invoke) and have the unamaged code properly use it as a COM interface? If so, are there any documentation that describes this in detail? thanks a lot! norm. |
|
| COM+ Services / .NET (2 replies) |
| microsoft.public.dotnet.framework.interop |
| We created a C# application with a transactional class that makes use of the COM services. We tested the application successfully on a developer PC where SQL Server was installed on the same machine. However, if we deploy the application to a server that does the database connections to a separate SQL Server, the transactional process times out and we receive the following error message: Exception... |
|
| Calling GetCommState API from C# (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi All, I want to call GetCommState API from C# which is use DCB structure as a return value. But I always got runtime error : "An unhandled exception of type 'System.NullReferenceException' occurred in serialcomm.dll Additional information: Object reference not set to an instance of an object." bellow is DCB struct I created in my code : [StructLayout(LayoutKind.Sequential)] public struct DCB { p... |
|
| Is there any way to force a .NET class to release its reference to a COM object? (10 replies) |
| microsoft.public.dotnet.framework.interop |
| Without forcing a GC? I have a COM framework that dynamically adds other COM based plugins to itsef. When each plugin is initialized, it is initialized with an interface of an controller object inside the framework. The plugin then uses that controller interface to obtain interfaces to other components of the framework. One of the methods implemented by the plugins is a Terminate() function which ... |
|
| Calling InvokeMember from unmanaged C++ (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I'm trying to load an assembly into the CLR, instantiate a class, and then invoke one of its members. The class instantiates, but the call to InvokeMember has no effect. It doesn't matter if I pass in correct or incorrect method names, the call always returns S OK but never works. Any ideas ? A code snippet follows: AppDomain *pDomain NULL; Type *pType NULL; VARIANT pInstance; ObjectHandle *pH... |
|