microsoft.public.dotnet.framework.interop
Up to: Discussion Lists

  • RSS Syndication
  • Post a new message to this list...
    Latest Discussions Archive
    Issue: Queued Component and Marshal.ReleaseComObject (9 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hi, We used .NET EnterpriseServices Queued components in our application to for certain asynchronous processes (code fragments was attached) However, we found out that the "Objects", "Activated" counts in the Component Services MMC are growing constantly. The application is running on Windows Server 2003 with .NET 1.1 framework. I found some discussion threads from google search http://groups.goog...
    Q230743 Set Duplex Printing for Word Automation (13 replies, VIP)
    microsoft.public.dotnet.framework.interop
    I need the VB.NET equivalent to this KB article.
    function import (10 replies)
    microsoft.public.dotnet.framework.interop
    Hello, This is a rephrasing of a previous question that I didn't get an answer to, maybe putting it differently will help. In Baf.dll there is a function prototype: BOOL CDECL LaunchRunner (LPCSTR szUserDisplay, BOOL* pbEnabled); How would this be defined in VB.Net or C# and how should I call it? I've tried everything I can think of and am getting null reference errors. I posted code in the previo...
    COM Interop and memory leaks (6 replies)
    microsoft.public.dotnet.framework.interop
    Good morning. I have a next problem: I wrote an asynchronous protocol handler in VB.NET. Another my program in VB.NET installs it as temporary handler, creates forms with WebBrowser control, and navigates to URI's handled by my handler. I encountered continuous memory leaks while navigating to pages. After investigation with SOS and memory profiler I discovered that instances of my protocol handle...
    Tiling and Cascading windows (6 replies)
    microsoft.public.dotnet.framework.interop
    Hi, I'm trying to add "Cascade" windows functionality in a C# SDI application, using the win32 API call: WORD CascadeWindows( HWND hwndParent, UINT wHow, const RECT *lpRect, UINT cKids, const HWND *lpKids ); I've being trying to use the API in the following way, however it is not cascading the four windows I am passing to it in the windowArray parameter, instead it cascades my version of Visual St...
    RegNotifyChangeKeyValue (4 replies)
    microsoft.public.dotnet.framework.interop
    I have written a C# wapper around RegNotifyChangeKeyValue to handle Registry change notifications. This works fine, except in Release builds, where I seem to get spurious notifications. I've probably done womething stupid any ideas? The code is based on an MSDN article (If I remember correctly) Many thanks Tony The declarations: public enum NotifyFilterFlags { REG NOTIFY CHANGE NAME 1, REG NOTIFY ...
    config file for DLL (6 replies, VIP)
    microsoft.public.dotnet.framework.interop
    I define a few constants in a C# DLL. I'd like to be able to store them externally instead of hard coding them in the DLL's source. Is there any kind of DLL level configuration file that I can read from my DLL? Thank you.
    Using VB.Net or C#, utilizing the clipboard object, how to copy an MS Excel graphic from the clipboard to an image control and obtain its source reference (8 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hello, Here is what I'm trying to do: Make sure both MS Excel and MS Word are running Create an Excel chart Save the Excel file Copy the Excel chart onto the clipboard using Ctrl C Go to Word and look under Edit Paste Special Note there is a source reference and an option to paste the chart as a metafile, etc. I would like to take this same information and make it available in a C# or VB.Net app F...
    struct layout of SHITEMID (3 replies)
    microsoft.public.dotnet.framework.interop
    Hi I'm trying to define the following C shell struct in C# (see shtypes.h or shtypes.idl): typedef struct SHITEMID { USHORT cb; BYTE abID[1]; } SHITEMID; where cb is the size of the whole struct (in bytes) including cb itself and abID can have a variable length. here is my definition (I fixed the abID size to 4 bytes 2 bytes data and 2 bytes for a recommended terminator '\0'): [StructLayout(Layout...
    Ints versus Shorts in C# Apollo Wrapper (5 replies, VIP)
    microsoft.public.dotnet.framework.interop
    I am working on project that involves numerous calls to a COM C program that declares numerous parameters and return types as 16 bit shorts. When we automatically generated a C# wrapper using tlibimp those short parameters show up as int16 declarations. When writing our C# wrapper, a colleague insists that we can use (ints) for these 16 bit values in all of our wrapper code ... I am somewhat skept...
    Best Approach (3 replies)
    microsoft.public.dotnet.framework.interop
    Instaed of throwing all of my problems one by one I decided to put down what I am trying to do and find out the best approach. There is a common custom Interface that several apps use (these are written in C ), we will call this interface ITestExec. There is another application that Proxy's this interface that is written in C . We will call this TestExecMarshall.dll. What I did was added a referen...
    How to port char to C#? (3 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hello All, I'm researching how to port this to C#: const char * viddecDebugNames[NVVIDDEC DEBUG LAST] { "TIMING", "TRACE", "MEMORY", "LOCKING", "ERROR", "CUSTOM1", "CUSTOM2", "CUSTOM3", "VIDDEC", "SPDEC", "MPGVDEC", "DVDSPDEC", "L21DEC", "DXVA" }; But I'm not finding much, any ideas? TIA for any help. T
    Problem calling c# com from c++ client? (6 replies)
    microsoft.public.dotnet.framework.interop
    Hi, I wrote a class library using c#, now I will use it in vc 6. I have registered my c# program as com and imported the .tlb file in vc6. Now I have some problems in using it: 1. How can I response events wroten c# in vc6. The event has custom parameters. For example: C# code: public delegate void MyCustomeEventHandler(object sender, MyCustomEventArgs e); public class MyClass { public event MyCus...
    Any news on the release Excel bug? (4 replies, VIP)
    microsoft.public.dotnet.framework.interop
    I'll just refer to http://groups.google.com/groups?hl en&lr &ie UTF 8&threadm 9DEB3050 8CBF 4E69 BC9B 9FD22E8AE536%40microsoft.com&rnum 3&prev /groups%3Fq%3Dexcel%2520quit%2520interop%2520process%2520asp.net%26num%3D20%26hl%3Den%26lr%3D%26ie%3DUTF 8%26sa%3DN%26tab%3Dwg and ask if the problem has got a solution yet.. I've got the following code in a class library, and it doesn't release Excel.exe w...
    VBA code in a VB.Net application (2 replies)
    microsoft.public.dotnet.framework.interop
    Hello We have a VB6 application that integrates an VBA IDE from which the final user can make modifications. We want to pass the application to VB.NET, and the first step, before rethinking the whole application, is to pass the conversion wizard and see how it goes. But we want to keep those client VBA modifications working with the least changes made to them. I've tried integrating VBA in a .NET ...
    OpenMutex fails with ERROR_ACCESS_DENIED (using VB.NET) (4 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Accepting the fact that .NET 1.x is lacking support for named events, and windows security manipulation, we end up using interop and the platform SDK, and functions like CreateMutex and OpenMutex. And it's with OpenMutex that I'm having a problem. In summary: I'm creating a mutex and then trying to 'open' it. I always get ERROR ACCESS DENIED which seems odd as the same process just created it mome...
    Error: System.Runtime.InteropServices.COMException (3 replies)
    microsoft.public.dotnet.framework.interop
    Hi, I have and COM object is running fine on C# Windows Application. However, it doesn't work on ASP.NET. Below is an error occurs when I call a method of COM object exactly the same in ASP.NET C#. "System.Runtime.InteropServices.COMException: Application configuration does not specify any online connection." Thank you. regards, Keem
    DLLImport Problem with LPCSTR and BOOL (3 replies)
    microsoft.public.dotnet.framework.interop
    Hi All, I am trying to use LaunchRunner in Baf.dll, it's defined like this: BOOL CDECL LaunchRunner (LPCSTR szUserDisplay, BOOL* pbEnabled); I'm trying to use it in a vb.net app but can't make it work. Here are some attempts I've made: 1) 'This one uses a pointer to a boolean and does no marshaling DllImport("Baf.dll") Public Shared Function LaunchRunner(ByVal szUserDisplay As String, ByVal pbEnab...
    excel object event handling (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hello, I need to handle an Excel.Workbook.BeforeClose event in my VB.NET application. When the framework attempts to bind the event with my handler, it throws a System.InvalidCastException with message "No such interface supported". I included the relevant declarations: Imports Excel .... Public Class TimeReportSheet .... Private WithEvents excelWorkBook As Workbook .... Public Sub Form(... Dim ex...
    .NET Interace fails for no interface (3 replies)
    microsoft.public.dotnet.framework.interop
    I have a c# component that I have created that has a single interface. I would like to be able to use in from a Visual C 6.0 program. C# component public class TestExec : ITestExec{ public TestExec() { } #region ITestExec Members public int initializeTestApp(object wrapper, string resFile, string chksum, string comPort) { // TODO: Add TestExec.initializeTestApp implementation return 0; } [Interfac...
    OLEAutomation Interop with object (8 replies, VIP)
    microsoft.public.dotnet.framework.interop
    There doesn't seem to be an obvious (to me anyway!) way to have an interface in .NET that passes an object [] such that it can be used by (say) VBScript. In other words, given a method: [ComVisible(true), GuidAttribute("66F12379 0C8F etc")] [ClassInterface(ClassInterfaceType.AutoDispatch)] [ProgId("blah.blah")] public class Class1: IMyInterface { .. public void Connect(object [] initializeData ) }...
    IDispatch Help (3 replies)
    microsoft.public.dotnet.framework.interop
    I am trying to implement an existing C Sink Interface (????). In the C# initializeTestApp, if I try to cast to WRAPPERLib.IWrapper it throw and exception. Currently the object that comes across is a {System. ComObject} how can I get this to be a pointer to WRAPPERLib.IWrapper in C#? Here is the C Code: IUnknownPtr pUnknown; hr m xWrapper.QueryInterface (IID IUnknown, (void**) &pUnknown); //first t...
    P/Invoke and Managed C++ (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hello, I am trying to call a C function from a dll. These function take a pointer to a structure as a parameter. This structure is allocated into the unmanged heap by the C function (it uses some malloc). I would like to know the best way to release this memory . For the moment I have created a new C function that release the memory and I call it from the managed code. For this to work I have to k...
    Application won't "unload" when terminated. (3 replies)
    microsoft.public.dotnet.framework.interop
    Hiya, I have a problem with my application. It hangs around in memory after exiting (and the debugger thinks its still running; I am unable to "break" or "stop" execution). The main loop below shows my "main" function. When the main form is closed, this function is exited, so the "hang" occurs in code outside of my control. I am using some COM objects (such as IShellFolder) during running of the a...
    C# unable to access property "exittime" on terminated process (4 replies)
    microsoft.public.dotnet.framework.interop
    I have the following code in a c# project of mine. public void SetProcess(Process NewProcess) { CurProcess NewProcess; CurProcess.WaitForExit(); MessageBox.Show(CurProcess.ExitTime.ToString()); } Everything goes well until the last line. The process waits to exit, then immediately after, I need to get the ExitTime. When I try to do this in the immediate window here are my results: ?CurProcess.Exit...
    C#: Problem with libary conversion (2 replies)
    microsoft.public.dotnet.framework.interop
    Hello, I try to write an application, that creates an active directory user with exchange email adress. To do this, i used the Howto from MSDN named:Create a Mailbox Enabled Recipient by Using C# .NET . In this Howto I'm using CDOEXM. As for that I have to use the cdoexm.dll in the Exchsrv\bin\ directory. I had some Problems with using this .dll and discussed it in another newsgroup, until the per...
    Can not return a com object from within c# (3 replies, VIP)
    microsoft.public.dotnet.framework.interop
    OPC (OLE for Process Control) is a protocol as an interface between applications and industry hardware drivers. It defines two main components (COM) registered in opcserver category : OpcServer & OpcGroup. I have written two coresponing classes as follows that implement the required Interfaces as defined by OPC. [Guid( "926EFA52 C020 4259 B879 203512901EAF" )] [ProgId("FAHM OPC Server 1")] [ComVis...
    Structure conversion calling c routine (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    #pragma pack(1) typedef struct init s { unsigned char ucKey[16]; // Initial authentication key unsigned char ucName[64]; // Local platform name / Server returned unsigned char ucOrganization[64]; // Local organization name / Server returned unsigned long ulPriority; // Importance level of session (1: low 10: high) / Granted returned unsigned long ulVersion; // Client protocol version / Server retu...
    Asp.net and outlook (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hi, i am having problems accessing outlook from asp.net. I create a C# console application which connect to outlook fine however when changing it to work with asp.net it just hangs can someone tell me what it wrong with it. Thanks Code try { Outlook.Application oApp new Outlook.Application(); Outlook.NameSpace oNS oApp.GetNamespace("mapi"); oNS.Logon(Missing.Value,Missing.Value,false,true); Outloo...
    Missing full screen displayed in an Excel File (2 replies)
    microsoft.public.dotnet.framework.interop
    I have used the following example from Microsoft to create this file. However when I double click on this file from the explore to open it, it is displayed with no default worksheet. In order to do this I have to click on View then Full Screen every time I want to open this excel. How can I make it displayed full screen automatically? Thanks Dim oExcel As Object Dim oBook As Object Dim oSheet As O...
    Callback issue again. (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hi Guys, This might have come up several times, but I still have problems with calling a managed object's member function from an unmanaged function. Here is what I was trying to do: unmanaged code typedef void (*CALLBACK FN)(); static CALLBACK FN mFn NULL; void SetCallbackFn(CALLBACK FN Fn) { mFn Fn; } void CallCallbackFn() { mFn(); } managed code public delegate void ManagedCallback(); public gc...
    Word Document Bookmarks (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hi, I am working on a project where I need to automate MS Word and create some Documents. I have no problems creating a word application or document object, but I do have a problem wtih the Bookmarks. I have the following code: object oMissing System.Reflection.Missing.Value; object oEndOfDoc "\\endofdoc"; object oTemplate "C:\\temp\\Invoice.dot"; object oBookMark "Name"; Word. Application oWord; ...
    Problem with Shell interop (2 replies)
    microsoft.public.dotnet.framework.interop
    Thanks if you can bring me some answer elements or a link to an answer I searched the web for 48h without result. Those remarks are directly based on the example given with the VS (2003) that you can find localy at: C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Technologies\Interop\Applications\ShellCmd 1 Interactions with the keyboard accelerator Windows E When the menu is l...
    How can .NET replace COM? (3 replies)
    microsoft.public.dotnet.framework.interop
    Hello! I would like to know, how .NET could replace COM? How is it possible? Imagine an application, which is a COM server, where a client could get informations or call functions (e.g. I would like to know the name of the current opened project in the application). The client has to reference the current running COM server (in VB you use GetObject). Then I get informations about the current runni...
    C# and Header Files (9 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hello, I would like to give a C# application access to constants defined in C/C header files. These constants are in header files and look like: #define MAX LEVEL 1000. These constants are used by many other applications, and I do not want to redefine them in my C# code. I think a managed c wrapper is probably the way to go. Can anyone point me to some code snips and/or articles that would get me ...
    Accessing C# component from COM (3 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hi, I am trying to make a C# component available to ASP through COM. I have gone through the whole process of creating a public Interface and assembly registration. Using VBScript in ASP I can write and read the component's properties but I cannot access any methods ?!? I get an error message stating the object is not created... Is there something extra I need to do to access methods ? Thanks ! Fr...
    Threading issues with COM Interop (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    I am using a third party COM componenet which is not thread safe in a .Net web application using Interop. When two threads (two requests) are trying to access the componenet it is giving an error and crashing. It works fine if the request is made only one at a time. How can I code around this problem so that only one thread operates on the COM object at one time. Any help will be greatly appreciat...
    VCC+ and .Net assemblies (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Has anyone used the COM interop to acess .Net asseblies from an unmanaged C application? For various reasons we have a legacy VS 6.0 C application that we would like to compile with VS .Net and without the /clr switch and using the COM interop use the XML features available in the .Net Framework. Since we are new to .Net we need a cookbook method to expose Ssytem.XML as COM object and then add it ...
    Click Event Being Called Twice (2 replies)
    microsoft.public.dotnet.framework.interop
    I am really struggling with something that is going on in an Excel menu add in that I have written ( Code snippets are below ) using Visual VB.net 2002. If a commandbar has the same caption as another commandbar elsewhere in the menu structure, it calls both Click events and subsequently inserts my custom text twice. Using the code below as an example, both DatesText(0) and CaseDataDates are set t...
    Portable Code Base for both Pocket PC's and Desktops (7 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hi, i am facing a peculiar problem with regards to Code Portability both on Pocket PC and Desktops. My company wants me to maintain the common code base for both the platforms. Is .NET suitable for that ( Is WinCE.NET and .NET same). Can we do it in SDK (pocket pc sdk and desktop SDK). I need inputs from all of you. Thanks a lot in advance. Regards Tarundeep Singh Kalra www dot tarunsadhana dot co...
    Excel & C# questions (3 replies)
    microsoft.public.dotnet.framework.interop
    I am creating a C# app to generate an Excel file and I have a couple of questions. First I can't get the Zoom option to work. I have an Excel sheet define as oSheet. This line : oSheet.PageSetup.Zoom 75; doesn't do anything. I get no errors but when I open my Excel file, the zoom is still set to 100 %. What is wrong. Also, Under PageSetup, I need to set the Scaling to 60% of Normal Size. I don't s...
    GetActiveObject in .NET? (2 replies)
    microsoft.public.dotnet.framework.interop
    Hello! I would like to get an active COM server instance using .NET. In Visual Basic you would use GetObject, in Delphi GetActiveOleObject. In .NET I have only found the CreateInstance function of Activator. But how can I GET an instance? Robert
    c# and Excel 2000/XP/2003 (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hi, I am making an application using C# and excel. I am not sure of the version of office installed on the clients machine. If i make application with excel from office 2000 will the application work with other versions of office? thanx in advance
    XP visual style problem (bug?) when COM dll used in C# (2 replies)
    microsoft.public.dotnet.framework.interop
    Hi all. I have a following problem. I wrote a ATL dll using VC 6.0, which is kinda interface to the database. In this dll, i got a selection dialog, which is whown to the user by calling method, called "SelectProject". I tested the dll in vb6 (and even Notes 6.0) and it works just fine. Now, in .NET (normal C# windows application), i imported this dll normally by adding the reference to the projec...
    newbie: confused about interop (4 replies)
    microsoft.public.dotnet.framework.interop
    Hi, I am just trying to find my way in interop and I just need a pointer as to what I should be doing. Reading the documentation tells me I need to use "tlbimp" to create an interop DLL. However, when I do "add reference" and select the COM tab, I can something fom the list (in this instance, "Microsoft Word 11 Object Library"), and I can just use the com object straight away. Am I using com inter...
    Bstr Type of COM DLL witten by C++ has problem. (2 replies)
    microsoft.public.dotnet.framework.interop
    Hi I can't send COM DLL's Bstr Type with c My Code is below(C#) //define Unmanaged Type [MarshalAs(UnmanagedType.BStr)] public String m Bstr; //an ellipsis //Call m Bstr "test"; Wrapper.VR CreateTextObj(m Bstr); this method receive BSTR type //a Result m Bstr "t" only 1st position of value sent. If calling method with BSTR type parameter, value is wrong, only 1st position of value sent. VR CreateT...
    Image Sanning in asp.net (2 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hi, i did the scanning application in VB using image scan & edit controls. But the same is not working in ASP. So i'm planning to do it in asp.net. if u have any solution please let me know. From: UmaMaheshwar Reddy Posted by a user from .NET 247 (http://www.dotnet247.com/) Id g49uGnH3EUuivHbhmPS/wA /Id
    How to add event handler in VBA? (2 replies)
    microsoft.public.dotnet.framework.interop
    Hi all, I have a library with some controls developed with VB.Net which I've used for a while, now I've added an event to signal some data is changed, but I can't find how to add event handler in the host application (VB6). I can see regasm has automatically added a method add eventname to my control, and a type eventname eventhandler is now defined in my VBA application, but I don't know the synt...
    unmanged VC++ application accessing .Net framework (3 replies)
    microsoft.public.dotnet.framework.interop
    I have a legacy application that is being updated and we would like to access and use the XML features available in the .Net framework. What is the best method to use to get at the .Net classes. The application needs to remain an unmanaged application due to the various 3rd party packages in use. Would writing a COM wrapper for the XML classes we need be the simplest way to go? Any examples availa...
    C# and Byte Stream (5 replies, VIP)
    microsoft.public.dotnet.framework.interop
    Hello, I have a socket connection to an unmanged application. Application messages arrive as a stream of bytes that get added to a byte array. The structures that define these messages are defined in a C/C header file. I would like to use managed C to expose a Message object to a C# application. For example: byte[] rawMsg Socket.Read( ); //Call Manged C constructor AppMessage appMsg new AppMessage...
    Visit the archive for messages from this site.
  • October 2001 (69 items)
  • November 2001 (22 items)
  • December 2001 (29 items)
  • January 2002 (42 items)
  • February 2002 (52 items)
  • March 2002 (89 items)
  • April 2002 (84 items)
  • May 2002 (54 items)
  • June 2002 (57 items)
  • July 2002 (98 items)
  • August 2002 (71 items)
  • October 2002 (95 items)
  • January 2003 (44 items)
  • February 2003 (78 items)
  • March 2003 (39 items)
  • July 2003 (69 items)
  • January 2004 (358 items)
  • February 2004 (143 items)
  • March 2004 (87 items)
  • April 2004 (199 items)
  • May 2004 (97 items)
  • June 2004 (90 items)
  • July 2004 (58 items)
  • August 2004 (211 items)
  • September 2004 (75 items)
    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