microsoft.public.dotnet.framework.interop Archive - January 2003
Post a message to this list
Messages
Page: 12
Accessing .net public props from COM (beta 2 yes - rc1/rtm no) (4 replies)
microsoft.public.dotnet.framework.interop
Simple VBScript: set form CreateObject("MyCo.MyProj.MyForm") form.show wscript.echo form.autoscale wscript.echo form.controls.count This script worked fine with Beta 2, but in RC1, RTM/latest .Net, it fails on the controls.count line, because form.controls is returning nothing. Method calls work, accessing simple types (like boolean in autoscale) works, but calls to public objects don't seem to wo...
Ordering of method for managed COM component (3 replies)
microsoft.public.dotnet.framework.interop
Hi, I have a managed dll which I used as a COM component from a C/C application. The type I'm exporting as the following custom attributes set: ComVisible (True) on IA and A, ClassInterfaceAttribute(ClassInterfaceType.None) on the implementation class A, and I have specified a different GuidAttribute for both IA and A. Now in the IDL I get from oleview by analyzing the type library for the managed...
Excel process won't terminate in .NET (5 replies)
microsoft.public.dotnet.framework.interop
Hi, Im doing automation in excel and use it to generate a report. I can successfully generate the excel file. However, I have a problem terminating it. I already quit the app and set it to nothing but the excel process still shows up in task manager! I also found out in another newsgroup that I have to use Marshal object to release the COM object. I have already done this but with no luck. I was h...
optional variant in excel (2 replies)
microsoft.public.dotnet.framework.interop
I am trying to use excel from my app. The function xlApplication.Workbooks.Open(filename,...) has many optional variant parameters but c# sees them all as required. Is this expected? Alternately can someone show me their c# code to open an existing excel file. Thanks Adil Nowsherwan
Helpstring not set for Properties in TypeLib for C# COM interop DLL (2 replies)
microsoft.public.dotnet.framework.interop
I have a C# COM Interop DLL for use by a VB6 client and the helpstring in the type library is not being set eventhough I have the Description attribute set. This only is a problem for properties (helpstrings are set when I provide a description attribute on a method). Here is a snippet of the code [InterfaceType(ComInterfaceType.InterfaceIsDual),GuidAttribute(GUIDs.InterfaceId)] public interface S...
interopservices exception when trying to fire management event (5 replies)
microsoft.public.dotnet.framework.interop
Hi, I am trying to run the example given in the online help to fire a management event. I keep getting the following error everytime the BaseEvent.Fire() method is called. Am I missing a file? Any help with this is very much appreciated. An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in system.management.dll Additional information: COM object with CLSID {4CFC...
Interface method order (5 replies)
microsoft.public.dotnet.framework.interop
Hi... I need to import COM interfaces to C# (tlbimp doesnt do the trick). I have managed to import and sucesfully use most of them, but there is one that I cannot find the order that the methods were defined.. no idl file that contains it... The biggest problem is that this interface happens to have 13 14 methods, and trying every possible ordering would take a long time.. I know the full names, a...
Super Duper Focus Question (4 replies)
microsoft.public.dotnet.framework.interop
Take a look at the "on screen keyboard" under Accessories Accessibility. Now open IE and click on the address bar and then start typing an address from the on screen keyboard (OSK). Notice how the OSK does not appear to gain focus even though your are click on the the buttons on the OSK. IE retains focus. That is what Take a look at the "on screen keyboard" under Accessories Accessibility. Now ope...
VARIANT* com parameters problem for return type (2 replies)
microsoft.public.dotnet.framework.interop
Hello! I've got an historical MFC based ActiveX that has been recompiled with VC7. On it IDL( well, actually ODL : ) file, there is a method like this : void MyFunction([out]VARIANT* pArg); Which get translated in VC as : void MyControl::MyFunction(VARIANT* arg) { //nothing } and in the VB.NET client, the interop layer gives me : Function MyFonction(ByRef pArg As Object) Ok, fine and clear. Now, i...
Invalid cast to "ByRef myVar As System.UInt16" using an Array (2 replies)
microsoft.public.dotnet.framework.interop
I tried to call the following method of a VC 6 COM DLL from a Visual Basic.Net executable: Function GetData (ByVal dwSamplesRequested As VT UI4, pwSamples As VT UI2, pdwSamplesReceived As VT UI4, ByVal dwTimeOut As VT UI4) As GetDataResult I receive a System.InvalidCastException when making the function call using the following code. I suspect that I am not handling the variable pData correctly. A...
Stream to IStream* (2 replies)
microsoft.public.dotnet.framework.interop
I through you could pass an IStream* to a C# interface method argument declared as Stream...In the same way you can pass a BSTR to a method argument declared String and an IUnknown* to a method argument declared Object. Apparently I am mistaken. The method argument must be declared UCOMIStream and there doesn't seem to be a way to connect UCOMIStream to a Stream object or a StreamWriter object. Am...
Embedding Images message body using Outlook and CDO (2 replies)
microsoft.public.dotnet.framework.interop
Hi the code at http://www.slipstick.com/dev/code/htmlimg.htm by Neo works under vb6. But I need it to work under VB.NET. Under VB.Net I can get the code to compile with minor changes, Most important change is the use of explicitly refering to the MailItem Interface; Dim l Msg As Outlook. MailItem Can anyone suggest a solution? here is the code with changes Sub EmbeddedHTMLGraphicDemo() ' Outlook o...
Exposing managed class to ASP (2 replies)
microsoft.public.dotnet.framework.interop
Hi All, I am trying to expose a managed class to a simple ASP web application. My managed class looks like this: namespace DOTNETforCOM { [Guid("290EEF61 981B 4CCF A97A 583F3AA6E30B")] [ComVisible(true)] public interface IAdder { int Add(int lhs, int rhs); int Subtract(int lhs, int rhs); } [Guid("2E408539 04E0 4ADC 97F9 D973CD42F43C")] [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] p...
Method is missing when serviced component is registered. (3 replies)
microsoft.public.dotnet.framework.interop
Hello, I am attempting to learn about Serviced components. I coded the class below. I compiled this code. I also created a strong name key and specified it in the assembly file. I placed the dll in the GAC I also ran the Regsvcs utility on the dll in the \bin directory in my solution folder. The component appears in the Com explorer as expected but there is no InsertEmployee method available in VB...
COM Interfaces (2 replies)
microsoft.public.dotnet.framework.interop
Hi everybody. I have a problem and I hope that someone could help me. I have 2 classes: ComClass() Public Class A Public Field1 as string Public Property FirstProperty as String [...] End Property End Class ComClass() Public Class B Inherits A Public Field2 as string Public Property SecondProperty as String [...] End Property End Class Once built the assembly and registered with regasm I can see (...
MapInfo MapX and "strong name" - problem (2 replies)
microsoft.public.dotnet.framework.interop
Hi, i have added the trial version of MapInfo MapX OCX to a .NET Form and on compiling the solution i'll get the error "AxInterop.AxMapXLib does not have a strong name". I know the tool "tlbimp" but i have no idea how to use it with MapX. I worked with "MAPX50.dll" but every attempt produced another error. It seems the result DLL from tlbimp looses the AxMapXLib entries as the OCX won't compile an...
Help - How to get multidimension safearray through COM interface ? (3 replies)
microsoft.public.dotnet.framework.interop
Hi All ! Is there any chance to get the subj. ? P.S. COM object C# dll, client is a VC6 program. Thank you ! SGI
communication between native c++ thread in dll and c# (6 replies)
microsoft.public.dotnet.framework.interop
hi i have the following scenario here: i have a gui written in c#. the gui has to load a certain dll (written in native c ) and call one function in it which starts a thread. this thread runs during the whole time in the program. the problem now is the gui has to communicate with this thread. i need to send commands to the thread and the thread has to send results to the gui code. i already know h...
Can I get an array of .Net RCWs as an output from a COM method directly? (2 replies)
microsoft.public.dotnet.framework.interop
Suppose I have a COM method of signature HRESULT Next( [in] ULONG cPins, // place this many pins... [out, size is(cPins)] IPin ** ppPins, // ...in this array [out] ULONG * pcFetched // actual count passed ); Now if I create a .Net inerop assembly and want to use this method, can I call it like the following: int fetched; IPin[] pins new IPin[5]; obj.Next(5, out pins, out fetched); When I try somet...
COMException : server process could not be started (2 replies)
microsoft.public.dotnet.framework.interop
Hi, I'm trying to call some BizTalk Server sevices from C#. BizTalk has several COM Servers you can call. I'm doing that from an Windows Service, wich has the same Log On account as the BizTalk Server service. My service starts ok, but when I try to call a method from the BizTalk COM Server, I get the error System.Runtime.InteropServices.COMException (0x8000401A): The server process could not be s...
I am the browser king! (2 replies)
microsoft.public.dotnet.framework.interop
I'm proud of myself for figuring this one out, so I had to share with people that may appreciate it. I have an ActiveX WebBrowser control on a .NET Windows Form. Within the form, I'm loading template static HTML documents and want to work with the documents' object model from the windows form. The only reference I've found on google groups was to use something along these lines: MSHTML.HTMLDocumen...
IPropertyNotifySink as event source (7 replies)
microsoft.public.dotnet.framework.interop
Does anyone know how to implement IPropertyNotifySink event source elegantly ? I can make it work if I import an existing COM object that implements it but then I'm dependent on that object. I can also make it work if I omit the ComImport attribute in the interface definition but that doesn't sound correct either since the COM registration modifies the interface definiton in the registry (don't re...
change AxWebBrowser.Document, not just AxWebBrowser.Document.body.innerHTML (2 replies)
microsoft.public.dotnet.framework.interop
Hi, I'm using the AxWebBrowser control to show HTML in a Windows form (for reporting purposes). I'd like to load the HTML from a HTMLDocument class or even a string, not from a file. This work only partly, since I can only change the AxWebBrowser.Document.body contents (any HTML inside the BODY tag), not the HTML before (i.e. the HEADER tag containing JavaScript methods). The HTML before the BODY ...
PInvoke Returning a string causes memory leak (2 replies)
microsoft.public.dotnet.framework.interop
Let's say I have a function in my own unmanaged DLL declared like this. wchar t* NewString(); For whatever reason, NewString allocates a string buffer with "new", fills it up, and returns it. The caller then owns the memory. In C#, I have the following PInvoke wrapper. [DllImport("My.Dll", EntryPoint "NewString", ExactSpelling true, CharSet CharSet.Unicode) ] public extern string NewString(); The ...
using COM Auto-aggregated interfaces in .Net (2 replies)
microsoft.public.dotnet.framework.interop
It seems that .Net interop does not work correctly with coclasses that auto aggregate interfaces. Is this a known bug? Specifically, it appears that casting a coclass to the interface that is auto aggregated (and therefore only instantiated upon request) does not, in fact, instantiate the underlying object implenting the interface. The cast succeeds, but any subsequent method call or property assi...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com