| Parameter passing from VB with "Option Base 1" problem. (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, all! I have some VB COM dll with definition "Option Base 1". When i pass some array into .NET wrapper a get error "Invalid procedure call or argument" Option Base 1 Dim obj as Object Dim param(2) as Variant param(1) "par1" param(2) 1 objWrapper.CallMethod(param) failed with "Invalid procedure call or argument" Using without "Option Base 1" of course does work fine! My VB COM really big object.... |
|
| COM object overriding ToString method (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Is there any way to explicitly override the ToString method from a COM object? I'm trying to populate a combo box with a bunch of COM object instances, and can't find any way to make the text of the combo box reflect the item unless I create yet another wrapper class in C# to override ToString. I have a method on the COM object that returns a string suitable for the ToString function. I've tried s... |
|
| Office PIA: Problem setting cell data with .NET and Excel (3 replies) |
| microsoft.public.dotnet.framework.interop |
| In a C# project I am using the Office Primary Interop Assemblies (PIA) to automate Excel 2002. However, I am not able to set the content of Excel cells using code that works under VB6: using Excel Microsoft.Office.Interop.Excel; ..... Excel.Range range (Excel.Range)wrkSheet.Cells[12, 8]; range.Text "mytext"; VB.NET 2002 complains that range.Text is a read only attribute, yet this is the **only** w... |
|
| Access from VB Form to VB.net form (3 replies) |
| microsoft.public.dotnet.framework.interop |
| We are converting our VB 6 applications to VB.net. As we evolve our application be need to integrate the .Net replacements to give the customer the elusion that they are using only one application. I am having a unique problem were I am trying to open a VB.net form from VB 6.0 code. The problem is as follows: From my VB 6.0 application, I call a method from my .Net Class and it opens a form. Howev... |
|
| Serial port communication using C# (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Dear friends, recently I was asked to write a C# program that communicates with RS 232 serial port.Just now i completed writing a simple console application that can write one byte and read one byte.Now I wanted to make it event driven i.e. I want create one "Read event" that can be triggered when there is any data written at the port.I'm using all the kernel32.dll functions like Createfile,ReadFi... |
|
| Passing an Hashtable from managed C++ to C# (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello everyone, i'm developing a managed c dll to wrap an existsing c dll that use callback. To resolve some calling conention problems i define my own callbacks and i wish to use clr types to make easier to use this wrapper. The problem is as follows: i define my own managed c callback as: typedef void (*MyCallback t) ( System::String*, System::Collections::Hashtable*); and setup a method to pass... |
|
| Help needed writing a COM object in C# (3 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, I want to write a COM object in C# that will be called from a VB6 application. I want to be able to catch events raised by the COM object as well as call methods on it. Let me say up front that I have never programmed with VB or COM before and I am sure that this is my major stumbling block. I have read much in MSDN (and this group) on using .NET with COM interop but nothing that answers my qu... |
|
| CreateGraphics (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi All The Following Code Dows Not Work MemoryStream MS new MemoryStream(BitmapBytes, false); m Bitmap (Bitmap) Image.FromStream(MS); if(m Bitmap! null) Point P new Point(AutoScrollPosition.X, AutoScrollPosition.Y); CreateGraphics().DrawImage (m Bitmap,P); Any help is welcome Thanks in advance RathnaRaj |
|
| BC30145 - 'Interop.MSDASC' does not have a strong name (4 replies) |
| microsoft.public.dotnet.framework.interop |
| How can I resolve this BC30145 compile/link error when referencing MS DataLinks via COM? I need to use the OLE DB SERVICE component for the DataLinks dialog box. I can't find a .NET facility for this, can you confirm none exists? Actually I need to support both an OLE DB connection string, plus also the newer type needed for SQL Data Adapters. In VB6 thus far, we have been hacking the one returned... |
|
| Passing a structure with an embedded array of a structure (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have to call a function within a dll with following definition (.h , .bas). // .h ///////////////////////////////////////////////// typedef struct iodbmr { short datano s ; /* start macro number */ short dummy ; /* dummy */ short datano e ; /* end macro number */ struct { long mcr val ; /* macro variable */ short dec val ; /* decimal point */ } data[5] ; } IODBMR ; /* In case that the number of ... |
|
| COM interop marshalling not working? (9 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi, This is related to my previous posting. considering the following interface between COM (WMI) and the C# dll that implements it... // declaration... [ ComImport, InterfaceType (ComInterfaceType.InterfaceIsIUnknown), Guid("dc12a681 737f 11cf 884d 00aa004b2e24") ] public interface IWbemClassObject { . . . [PreserveSig()] int Put ( [MarshalAs(UnmanagedType.LPWStr)] string wszName, int lFlags, ref... |
|
| using managed C++ wrapper loading unmanaged DLL's (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm trying to write managed C wrappers for a large soon to be (hopefully) legacy C system. These wrappers are to be consumed by C# and VB.NET clients. My initial managed C client is able to use these wrappers quite easily. However, the C# client gets an error: "An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module." When I choose "Break", it says "There is no ... |
|
| .net client and com+ doesn't work on distributed environment (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I created an application comprised of a .net c# client and a vb6 com server component. The application works fine on the same machine but once i distribute the client to another machine it doesn't seem to find the com component. The client refers to a RCW of the com component. Do I need to put the RCW in the GAC as a strong signed assembly? Any ideas? |
|
| Presenting a managed collection to an unmanaged method. (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a couple of classes, a Profile, and a TwoDPoint. public class Profile : CollectionBase { // Some code to strongly type the collection to work with TwoDPoints } [StructLayout( LayoutKind Explicit )] public class TwoDPoint { [FieldOffset( 0 )] public double X 0.0; [FieldOffset( 8 )] public double Y 0.0; } What I need to be able to do, is pass a profile object into an unmanaged method that is ... |
|
| COM Interop Exception (4 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello We uase a third party ActiveX component that changes with monotonous regularity. When the component is updated to a customer's machine (by the 3rd party), it breaks our .NET code. Is their a way to create a COM wrapper on the customer's machine that works correctly with our previously installed assembly? Thus far, I have tried... tblimp TheirCOM.exe /out:Interop.TheirCOM.dll but this gives m... |
|
| PInvoke - Problem while marshalling Array Of Structures ('System.ExecutionEngineException') (2 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello, Can we marshall an array of structures while using PInvoke interop call from VB.Net to unmanaged "C" Code. If we can what is the proper way? If not what are the alternatives? Following is the description of the problem Iam facing. The "C" Code Method declaration is int rec proc(struct ezgpatblk *ezgpat,struct inpatblk *inpat, struct dxblk *dx, struct inopblk *inop, struct inpgrpblk *inpgrp)... |
|
| Catching DHTML events in Web Browser Control (3 replies) |
| microsoft.public.dotnet.framework.interop |
| I want to trap events raised by HTMLDocument being viewed in a Web Browser Control hosted in C# form application. I am trying to set up a generic Click event handler at HTML Document level to trap click event on any element of the document. I do get click events for any element from HTML page, but Text Input Tags and HTML selectors in a page stop working. I can no more set a focus on text input ta... |
|
| Null delimited multi-strings w/StringBuilder? (4 replies) |
| microsoft.public.dotnet.framework.interop |
| What's the best method for reclaiming null terminated lists of strings? I've got a number of functions that return null delimited lists that are terminated with a double null. I'd like to use StringBuilder, but it doesn't seem to favor 1 null in the string. Here's an example.. [DllImport("winscard.dll", CharSet CharSet.Auto)] public static extern int SCardStatus(IntPtr hCard, [Out, MarshalAs(Unman... |
|
| ReadInt32 - Can someone explain this ? (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Apparently I don't understand how these functions work. It would seem these two sequences of commands, executed in the debugger, would produce the same output. Can someone explain? Best regards Lee ? hex( Marshal.ReadInt32( New IntPtr( ptr ),8 ) ) "0" ? hex( Marshal.ReadInt32( New IntPtr( ptr ),7 ) ) "0" ? hex( Marshal.ReadInt32( New IntPtr( ptr ),6 ) ) "15" ? hex( Marshal.ReadInt32( New IntPtr( p... |
|
| Custom Marshalling (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Hi ! I've got an ActiveX Control which implements the follwoing Memberfunction (in C ): HRESULT SetData(VARIANT *pData); // pData ist not defined as retval in the ODL File The Variant must contain an SAFEARRAY containing bytes, one dimensional (VT ARRAY | VT UI1) As I import the Control into my .NET Project the IDE generates an wrapper for this method: void SetData(ref object); I tried to use this... |
|
| Problem calling C++ dll with nested structs (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I'm having a slight problem marshalling nested structs for a call to a C dll. The dll expects the a struct "MyInputType" as a parameter. This struct contains an array of "MyPaymentType" structs. In C they are defined as follows struct MyPaymentType { double amount; tm paymentDate; short frequency; short repetition; }; struct MyInputType { short type; double amount; tm outDate; tm inDate; MyPayment... |
|
| TraceRegisterEx interop (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I created a C# console application and would like to use the TraceRegisterEx/TraceDeregister() APIs (Windows 2000 only). In a unmanaged C program, the TraceRegisterEx() API will create the necessary registry entries in HKLM/Software/Microsoft/Tracing and the first trace ID returned is 0. But in C#, nothing happens in the registry and the trace ID returned is 2. Why aren't the registry entries crea... |
|
| How do I register my dll in GAC which can be accessed by all my Applications (5 replies) |
| microsoft.public.dotnet.framework.interop |
| Hello Sir/Madam I have created a dll using the Class library in .Net (Using vb.net). After that I have associated it with a strong name by creating a .snk file using sn.exe then i have added this to my vb.net application using the following tag in assembly.vb file in my application Assembly: AssemblyKeyFileAttribute("sharedDll.snk") and the version info as Assembly: AssemblyVersion("1.0.1099.0") a... |
|
| Interprocess Communication between VB6 and .NET (2 replies) |
| microsoft.public.dotnet.framework.interop |
| I have two applications, one is a legacy VB 6 APP which is slowly being replaced and another is a .NET application. I need to have the two apps communicate in that a user action in the VB6 app needs to cause the .NET app to become active and a change in the UI to take place. The communication ideally would go both ways. I've thought about using Sockets but in .NET sockets aren't event based and th... |
|
| passing null string to unmanaged DLL (4 replies) |
| microsoft.public.dotnet.framework.interop |
| I have a DLL function defined as follows: private static extern int mtRL(int nReqNum, string sUserName, string sPassword, string sProdName, byte byVerHigh, byte byVerLow); When I call the function, sProdName will sometimes be null, but this causes it to throw an exception before it makes the call into the DLL. Can anyone tell me what is going on here and is there a way I can redefine the parameter... |
|