microsoft.public.dotnet.framework.interop Archive - September 2004
Post a message to this list
Messages
Page: 1234
DllMain...? (7 replies)
microsoft.public.dotnet.framework.interop
Hello, Does anyone know how to implement DllMain whith C#? Thanks in advance.
Word Development Mixed Office Environment (14 replies, VIP)
microsoft.public.dotnet.framework.interop
Hi! I'm trying to develop some MS Word automation from within a VB.NET WinForm application. My user base has either Office XP or Office 2003 installed. I currently have Office 2003 installed. Two questions: 1. Is it possible for me to develop against the COM V10 without installing Office XP? (Can 2003 and XP be installed side by side?) 2. If I develop against the Office XP COM V10, will my Office ...
NativeWindow bug? (4 replies, VIP)
microsoft.public.dotnet.framework.interop
I am subclassing a window with a class that is derived from NativeWindow. I need to be able to hook and unhook freely from the window being subclassed, but I'm having problems. For testing, I created a bare bones class, TestNative, derived from NativeWindow that does absolutely nothing except call AssignHandle in the constructor. The constructor takes a Form reference as the only parameter, and ca...
VC++60 and C# interoperation (2 replies)
microsoft.public.dotnet.framework.interop
Simple question We have huge application written in VC 6.0. We are planning to develop some new parts with C# and WebServices. Question is.. Is it possible to use C# components from VC 60 application? If it is some reference or example would be nice. Thanls in advance:) Greetings from Finland Markku Heikkilä PS: Overtime we will eventually move all code to Dot.net. But now it is simply impossible....
Int* to long? (2 replies)
microsoft.public.dotnet.framework.interop
Can anyone tell me why my function: public int pingPhone() { return 0; } comes across in the tlb as: HRESULT stdcall pingPhone([out, retval] long* pRetVal); I need it to be: HRESULT stdcall pingPhone([out, retval] int* pRetVal); Any ideas? MICHAEL CARR
C# dcom component (2 replies)
microsoft.public.dotnet.framework.interop
I have created a C# library, and it registers with COM just fine, I have created another app that calls it using COM and it appears to work. My only problem is that I have to use DCOM to call this library. I have checked dcomconfig and my component is not there, not as a guid and not by name. What do I have to do to add my component to DCOM? what registry keys do I have to add? I have added a few ...
Shell Namespace, ShObjIdl.idl, OLE-Wrapper (2 replies)
microsoft.public.dotnet.framework.interop
Hi, I have to deal with the Shell Namespace should be very easy, because the API is implemented via COM Interfaces : )) In my old C code I ask for a IShellFolder calling ::SHGetDesktopFolder(...) and from then I work only with the Shell COM Interfaces. OK, I can call SHGetDesktopFolder via InteropServices, but how can I generate a wrapper for the whole Shell COM Interfaces (as described in ShObjId...
COM Interop Events bugs (2 replies)
microsoft.public.dotnet.framework.interop
Timothy O'Hear posted ages ago (March 2002, message exNSgYQyBHA.2676@tkmsftngp04 ) about a bug whereby VB6 produces the following error when an event is fired from managed code but not caught: "Run time error 80020006 Unknown name error". I'd like to confirm this. Instantiating a managed object in VB6 with the WithEvents keyword requires that an event handler exist for every event that gets fired ...
Problem with a COM+ Application (2 replies, VIP)
microsoft.public.dotnet.framework.interop
Thanks in advance to those person who'll try to answer me. I have a problem with a COM dll that I must use for a Web Application written in ASP.NET and C#. My server is IIS 6 on Windows Server 2003. I tried to register the DLL with regsvr32, and I added it to the reference of the project in Visual Studio choosing it from the COM tab, but when I instantiate the class: myClass c new myClass(); I rec...
how to convert c#-bytearray to c++-char* ? (2 replies)
microsoft.public.dotnet.framework.interop
hy everybody, I'm accessing a function of a managed c dll within my c# application. Therefore I encountered following troubles: In my c# app I have got a byte[] array, which should somehow be mapped to a char* in my managed c function. Here is the prototype: managed c class library project void MyFunction(char* buffer) { buffer "Hello from managed c !"; } in c# I'm using this function like this: c...
COM Interop events leak (2 replies)
microsoft.public.dotnet.framework.interop
This is probably old news, but I believe that the COM interop is leaking. I have a C COM server class (in process) that creates a thread, initialises COM for the thread, and then repeatedly calls an event method that has no parameters or return value. On the .NET side, in C#, the event handler does something trivial with it, or does nothing at all. The result is a constantly increasing process pag...
How to use shelllink interface in c#? (3 replies)
microsoft.public.dotnet.framework.interop
I want to get the target and argument of a shell link in a C# project, so that I need to use the shelllink interface but I do not know how to do. I added the shell32.dll into the reference and tried the ShellLinkObjectClass of Shell32 namespace. But a failure was reported about that the COM class was not registered. Do I need more steps or I should try some other solution? Could anyone give me som...
pass short as short* to COM object in C# (5 replies)
microsoft.public.dotnet.framework.interop
Hello, I have a 3rd party ActiveX control that I'm using in C# / Visual Studio. I added the ActiveX control to the toolbox and dropped it onto a form and for the most part it works great.. until I need to get data from the control using the method GetImageDataCrop. Visual Studio wrapped the method as ActiveXObject.GetImageDataCrop(ref short buffer, ref int bufferSize,int offsetx,int offsety, int h...
get the type of property from com object (3 replies)
microsoft.public.dotnet.framework.interop
Is there any way to receive the type of a Property of a com object, with reflection. What i know now is how to receive the value. And what i need is the Type of the property. However, and i do not know how, the Intellisense know exectly the types of the members / properties of com object. So, it can be done.
Applying MarshalAs attributes to Inteerface Properties in VB.NET (3 replies, VIP)
microsoft.public.dotnet.framework.interop
I'm tearing my hair out. I'm writing .NET objects to be consumed from unmanaged code as COM objects. I've defined the interfaces separately from the implementation classes and marked the resulting classes ClassInterface(ClassInterfaceType.None). Everything was going along smoothly until I needed to marshal a property as Currency: Option Strict On Option Explicit On Imports System Imports System.Re...
regasm exports private unmanaged classes? (2 replies)
microsoft.public.dotnet.framework.interop
Greetings I'm using VC .NET to create a class library. The class library contains managed classes that wrap legacy unmanaged classes by the same name. I use regasm to register the DLL for COM interop. If I don't include any managed classes in the library, the context help in VB6 lists every single unmanaged class in the class library (even though those classes are not declared with the public keyw...
changing word order when importing mixed RTL/LTR-text from excel (2 replies, VIP)
microsoft.public.dotnet.framework.interop
hi, in our C#/.NET 1.1 app we're trying to import multilingual text data from excel sheets. Worksheet worksheet (Worksheet)excel.ActiveSheet; Range range worksheet.get Range("A2", Missing.Value); string test (string)range.Value2; this works great except for cells containing mixed RightToLeft and LeftToRight ordered texts e.g. Hebrew and English. in those cases the word order of range.Value2's cont...
InteropServices: Marshal.PtrToStructure (unsafe code) (3 replies)
microsoft.public.dotnet.framework.interop
Hi there, I'm interfacing with a C dll which returns a structure. It's structure is as follows. C: struct DataStr { UINT data[ 16 ]; }; I mapped it in C# as follows: [ StructLayout( LayoutKind.Sequential, Pack 4 ) ] public struct DataStr { [ MarshalAs( UnmanagedType.ByValArray, ArraySubType UnmanagedType.U4, SizeConst 16 ) ] public uint[] data; } The function in the C dll to retrieve the data (as ...
Excel SaveAs to a Text file (2 replies)
microsoft.public.dotnet.framework.interop
Do you have an example on how to save an Excel file as a text document? Thanks, Nancy.
Getting Add-Ins to load at startup (3 replies)
microsoft.public.dotnet.framework.interop
I managed to create a sample Add in for Excel with a toolbar. This was painful requiring me to try all kinds of tricks until finally adding Office.dll to the Global Assembly Cache in my setup project did the trick (I discovered this by catching all Exceptions in the debugger and figuring out the rest from the online discussions). Now I've added a bunch of my own code and the thing just wont load (...
COM Add-in toolbar click events only fire once if window is initialized (2 replies)
microsoft.public.dotnet.framework.interop
This is a very bizare problem. So, I have a C# COM Add in for Excel which creates a toolbar, then pops up meaningful windows when you click the toolbar buttons. Everything works fine the first time. After that, my event handlers do not get called when I click the toolbar handlers. I've isolated the problem down to initializing a dialog window (never actually showing the window). Explicitely, the V...
Marshal char str, DllImport (3 replies, VIP)
microsoft.public.dotnet.framework.interop
The C DLL has the following declaration: ExternC int4 STDCALL func( char * ); // array of 32 byte strings I can call it from C code using [this works!]: char str[32] "My String"; int4 result func( str ); Now, I need to do this in C#. I tried something like this, but it won't compile ("Specified unmanaged type is only valid on fields."): [ DllImport( "capi.dll", EntryPoint "func" ) ] public static ...
COM Interoperability with Windows SERVICE (2 replies, VIP)
microsoft.public.dotnet.framework.interop
Hi, I have an COM Component ,which is responsible for taking the Data from DB , Generating the Excel and sending the Generated Excel File by mail to the user. Note :The COM is registered on the system. The COM is created in VB. Now I m trying to access the COM From the Windows service. It creates the COM Callable Wrapper and I can access all the COM Objects in the service. But now when the service...
Invoke C#-Function calls in aspx pages (9 replies)
microsoft.public.dotnet.framework.interop
hello ng i know, probably i am not the first asking about this, but i am really dependent on it. i have an asp.net application (aspx/jscript with c# codebehind) and i am searching for a possibility to invoke c# funtioncalls in the jscript code. as i know there is a possible way by using XmlHttp, but isn't there any other better way? there any links leading to good samples, components, sources impl...
Event not received in COM (2 replies)
microsoft.public.dotnet.framework.interop
Thanks to Christian Fröschlin suggestions I solved the problem I've posted few days ago, so now I have a .NET application which expose an event through an interface of type InterfaceIsIDispatch, When I use my control in a VBA application I can see the event just declaring my object with WithEvent clause, but also if I can use it's methods and it's properties the event is never received while I thi...
Ad
Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification