microsoft.public.dotnet.framework.interop Archive - July 2003
Post a message to this list
Messages
Page: 123
MS people: QueryInterface for interface Word._Application failed (2 replies)
microsoft.public.dotnet.framework.interop
Hello all! I wrote a program (it's attached with this message) which writes a Microsoft Word 97 document using Microsoft Word 8.0 Object Library via interop. However, an exception is raised when I run it on my machine (under Windows 2000): System.InvalidCastException: QueryInterface for interface Word. Application failed. at Word.ApplicationClass.get Documents() at WordApp.Module1.Main() in C:\Wor...
Help disposing an Interop Object (2 replies)
microsoft.public.dotnet.framework.interop
My application creates a reference to another application using an Interop. The only problem I have is that when the interface object referencing the Interop goes out of scope; it doesn't release the application. The side effect is that when the user closes the other application it still shows in the TaskManager processes, and the next time I try to create the interface object through the Interop ...
How to get the class of the COM? (4 replies)
microsoft.public.dotnet.framework.interop
Is there a way to get the class with its interfaces(methods) of a managed/unmanaged COM? If there is, any tutorial that teach this? thank you
COM interop (3 replies)
microsoft.public.dotnet.framework.interop
Background: We have an application written in VB. This application has several .dll that it uses. I am in the process of writing a new C# dll, which will be like a VB .ocx control, that is late bound, and instantiated by one of those VB dll's. Problem: I am not having any problem with accessing the classes inside of my dll, but I am having a problem trying to access a function on one of the forms ...
MSHTML Rendering Behaviors impossible in .NET (4 replies)
microsoft.public.dotnet.framework.interop
I was having a problem implementing IHTMLPainter in C# and saw that you had been trying to help someone else with the same problem a few months ago on: microsoft.public.windows.inetexplorer.ie5.programming.comp onents.webbrowser ctl Here is the link to the thread on google: http://groups.google.com/groups?threadm 13f4601c26f46% 24e2729870%2437ef2ecf%40TKMSFTNGXA13 I figured out why it is throwing ...
How do I pass a null value from an old ASP page to a C# component? (2 replies)
microsoft.public.dotnet.framework.interop
Hi All and thanks for reading: My C# function looks something like this: public void MyFunc(int dbId) { if (dbId null) {DoSomething();} else {DoSomethingElse();} } How do I pass a null to dbId from an old style ASP page? I've tried passing vbNull (becomes 1), Nothing (becomes 0) and Null (errors). I could use a value of 1 instead, or create an overloaded method without the parameter, but I don't r...
tlbimp.exe source code option (6 replies)
microsoft.public.dotnet.framework.interop
Hi! So I managed to compile the windows forms wrapper dll into my project using aximp with /source option so that I have one file less to distribute. Is there anything equivalent for tlbimp, that gets me source code instead of the com wrapper dll ?? thx dcw
Different behaviour depending on 'enable unmanaged debugging' switch (4 replies)
microsoft.public.dotnet.framework.interop
When debugging a .NET component that uses COM components via interop (just to complicate things further, the .NET component is instantiated by an unmanaged exe: If I debug with "enable unmanaged debugging" FALSE then obviously I cant step through the code of the COM components, but my program runs successfully (I am porting something to .NET and there are a lot of errors that get handled, showing ...
ActiveX Component Can't Create Object (5 replies)
microsoft.public.dotnet.framework.interop
I have a COM object that I've created in VB.Net. It implements an interface defined in another COM class that was created in VS6 some time ago. The other COM object that defines the interface is referenced in the VB.Net class. The VB.Net COM component works fine in all respects on the development system but can't be created on the target machine. Just for testing purposes, I'm attempting to create...
InvalidCastException when using Office (Excel) 97 objects in .NET (2 replies)
microsoft.public.dotnet.framework.interop
We select the Excel 97 object in References and when we do a: xlApp CreateObject("Excel.Application") a "System.InvalidCastException " error is thrown. There is MS Support article about changing security permissions and creating a interop dll that we followed, but still get an error. All the documentation I've found on office interop is office XP and we need to work with 97 at the moment. Any help...
calling SendMessageTimeout from C# (2 replies)
microsoft.public.dotnet.framework.interop
I am trying to propagate new environment variable to the system from c#, per the info at: http://support.microsoft.com/default.aspx?scid kb%3Ben us%3B104011 Here is my c# code: [DllImport("user32.dll", CharSet CharSet.Auto, SetLastError true)] [return:MarshalAs(UnmanagedType.Bool)] public static extern bool SendMessageTimeout( IntPtr hWnd, int Msg, int wParam, string lParam, int fuFlags, int uTime...
ActiveX Controls in C# (5 replies)
microsoft.public.dotnet.framework.interop
I am having trouble creating an activex control in C#. Here is the steps I took 1) Created a class 2) Create a key (sn k MyKey.snk 3) add that to my assemblyInfo.cs [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("MyKey.snk")] 4) Compiled (csc /target:library *.cs 5) Added to the assembly cache (gacutil i ) 6) Registered the component (regasm) But I am not able to access it in my w...
Interop with structures and arrays (3 replies)
microsoft.public.dotnet.framework.interop
Hallo Everyone, I am trying to access a structure that has an array of bytes. The only way that I could get work was to define the structure as Explicit. Does anyone know how to make this work for StructLayout(LayoutKind.Sequential, CharSet: CharSet.Unicode) Structure LVCom Array MarshalAs(UnmanagedType.??????) Dim ua8() As Byte Sub initialize ReDim ua8(10) End Sub End Structure Here is an example...
Null exception when calling my Pinvoke? (2 replies)
microsoft.public.dotnet.framework.interop
I keep getting a null exception (unreferenced object?) when calling my Pinvoke and its driving me nuts My code: [ DllImport( "JpegTranWrapper.dll", CallingConvention CallingConvention.Cdecl, CharSet CharSet.Ansi) ] public static extern int jpegtran main( int size, String[] stringArray); /// summary /// The main entry point for the application. /// /summary [STAThread] static void Main(string[] arg...
C#and Excel XP/2002 problem (2 replies)
microsoft.public.dotnet.framework.interop
The following code snippet gives me the error: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in MigratieWin.exe Additional information: Old format or invalid type library. .... Excel.Application oXl; Excel. Workbook oWb; Excel. Worksheet oSheet; Excel.Range oRng; try { // Start Excel and get Application object. oXl new Excel.Application(); oXl.Visible true; ...
omitted ComImport() Atrribute (6 replies)
microsoft.public.dotnet.framework.interop
Hi! Many C# implementations of COM interfaces lack the ComImport Attribute, while having the ComVisible Attribute. Isn't the interface registered if it doesn't have ComImport ?? It would overwrite the 'correct' settings in the registry. Or is the compiler smart enough not to overwrite those values while registering ?? thanks daniel
Problem with interop (2 replies)
microsoft.public.dotnet.framework.interop
Hi everyone, I am trying to convert the follwoing code from c to c# c code typedef short (WINAPI* PAC ADT SET FINGER STATUS)( short FingerStatus, (unsigned char)* Image, unsigned long RowNumber, unsigned long ColumnNumber, (unsigned char)* ContinueFlag); typedef short (WINAPI * PAC ADT SET MESSAGE)( int MessageID, (unsigned char)* ContinueFlag); typedef short (WINAPI * PAC ADT SET ADT STATUS)( uns...
interop.word problem with vb.net (2 replies)
microsoft.public.dotnet.framework.interop
I am opening word documents inside my vb.net program to get some statistics. I added the interop.word reference so I can create the Word application. That works OK. But when I try to add the file to the documents collection like this: Dim WordApp As New Word.ApplicationClass() Dim doc As New Word.Document() WordApp.Documents.Add(filename) I get this exception message on the Add method: "QueryInter...
.net and dlls (2 replies)
microsoft.public.dotnet.framework.interop
hi, i'm using .net and C# for my application. from a C# file i'm importing a dll ([DllImport) the problem is that after the dll runs it gets blocked. i can't modify or delete it. does this mean that i need to put it in a com component? is there any other way to solve the problem? Thanks, Ana
Wierd InvalidCastException getting array of VB6 Type (3 replies)
microsoft.public.dotnet.framework.interop
I am accessing a COM (VB6) DLL from .NET. A method returns an array of T where T is a VB6 'Type' defined in the DLL. Depending on what parameter is passed to the method, different bits of code create and return an array of the proper type. The COM interop dll created by VS.NET shows the return value as being of type System.Array. The array returned by passing one value of the param can be cast suc...
howto: Save "Embedded Object" from clipboard to file? (2 replies)
microsoft.public.dotnet.framework.interop
Hi Anybody knows how to save an "embedded object" from the clipboard to a file with the correct filename ( can it be extracted from the clipboard ??) And How do I do it vice versa... regards Morten
Return string from Fortran Dll back to C#. (5 replies)
microsoft.public.dotnet.framework.interop
Dear all: My C# program need a string returned from a Fortran Dll. The Fortran Dll is like this: SUBROUTINE REDO(s) !DEC$ ATTRIBUTES DLLEXPORT::REDO, C CHARACTER*(*) s !DEC$ ATTRIBUTES REFERENCE :: s s 'Let them talk, now!'C END And I use C# PInvoke to call it, the client code like this: public class BackString { [DllImport(@"BackString.dll", EntryPoint "REDO")] public static extern void REDO(stri...
COM Interop Problem (6 replies)
microsoft.public.dotnet.framework.interop
Dear all, Is there any other way to wrap my COM besides using tlbimp.exe or VS.NET? This is because I do not have VS.NET with me as well as tlbimp.exe. Please tell me if anybody know the answer. I need it urgently. thank you.
Marshaling VARIANTARG (3 replies)
microsoft.public.dotnet.framework.interop
Hi How do I have to define my MarshalAs Attribute if I have to marshal a VARIANTARG ?? thx dcw
Passing Array of Structures - Repost (3 replies)
microsoft.public.dotnet.framework.interop
I have the following managed code that acceses a DLL that passes an array of structures. Everything compiles and if I debug into the DLL it appears to load the data correctly but when it exits from the managed call to the DLL the variable comes back null. What am I doing wrong? The code is as follows: Managed .Net Code: [StructLayout(LayoutKind.Sequential)] public struct TBDRV COLUMN SPEC { int iC...
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