microsoft.public.dotnet.framework.interop Archive - July 2002
Post a message to this list
Messages
Page: 1234
S_FALSE S_OK HRESULT in .NET (3 replies)
microsoft.public.dotnet.framework.interop
Hej Looking on various examples to implement interfaces gave me some confusions when I attempt to translate on of my implementation in VC6 into C#. HRESULT is used for COM procedure and to return mostly error that will raise an execption, in most cases. Question: Is is possible to transfer S OK or S FALSE to the calling thread of my implemented interface. The calling thread relies on the returning...
Defining Version Info for imported assemblies from Type Libs (4 replies)
microsoft.public.dotnet.framework.interop
Hi, I need to define version info (such as Copyright, Trademark, Company, Product, Description, etc.) for a set of Primary Interop Assemblies that I'm creating with TLBIMP.EXE. Unfortunately this tool doesn't allow to define this information, so, I tried to mimic its behavior by creating my own console app that calls TypeLibConverter.ConvertTypeLibToAssembly internally. By doing this, I found that...
Late Binding (3 replies)
microsoft.public.dotnet.framework.interop
how do you late bind a Remotable .NET object?
Interop performance VB6 DotNet (2 replies)
microsoft.public.dotnet.framework.interop
I've a dll developped in vb6 (dll mediatheque.dll) and I use it in a dotnet application. The performance are catastrophic 15 seconds with DotNet, less than 1 second with vb6. In this exemple, I call a function with an Object as parameter. Exemple : #####################################################" Dim vobj valid fam As New dll mediatheque.MF FAMEmprunt() Dim vobj valid vod As dll mediatheque....
C# DCOM Client Security Problem (3 replies)
microsoft.public.dotnet.framework.interop
hi, is there an equivalent function of the ::CoInitializeSecurity function ? My C# Client attaches an eventhandler for a event raised by a (D)COM Object at a remote server. On a Local Server there is no Problem. With a C Client and CoInitializeSecurity if works fine thank you in advance juergen seitz
Using a Windows.Forms.UserControl in VB6 ? (4 replies)
microsoft.public.dotnet.framework.interop
Is it possible to use a .NET 1.0 Windows.Forms.UserControl in a VB6 application (via ActiveX)? I got the information that this is not possible. Is that realy true? If yes, I don't understand the strategy of microsoft. Why should one choosing to develop new controls with the .NET framework, if nearly no one of potential customers would be able to use that control in there existing VB6 applications?...
Calling native C from managed C++ (2 replies)
microsoft.public.dotnet.framework.interop
I've found a lot of threads discussing the correct way to call unmanaged code from C#, but not a whole lot on calling it from managed C . I am specifically interested in whether it is necessary to account for the marshaling of char* parameters between the two. Say my native C prototype is as follows: int nativeCFunc(char *arg); I would like to call this routine from within a method of a managed C ...
MS Excel Automation Not Releasing (4 replies)
microsoft.public.dotnet.framework.interop
I am using a C# application to automate the creation of a spreadsheet. I call Application.Quit() and set the object to null but Excel.Exe is still running in my task manager. Anyone know how to make it go away. Thanks In Advance Jim Bish
How to implement the IShellFolder::GetAttributeOf in a shell extension using c# (2 replies)
microsoft.public.dotnet.framework.interop
Hello. I''m working on a shell extension in C# and I''m stuck on how to implement the IShellFolder::GetAttributeOf method. I am using subfolders so Explorer calls my EnumObjects...gets a IEnumIDList interface..calls the IEnumIDList::Next and I there return one PIDL for my only subfolder object. After that Explorer calls my IShellFolder::GetAttributesOf with the PIDL I created...so far so good. Now...
C# COM+ component leaking memory (3 replies)
microsoft.public.dotnet.framework.interop
Maybe you guys can help me with this memory leak. I've created a COM component in C# to wrap retrieving a message off a MSMQ and dropping the body of the message into the database. The COM component is being called from a multi threaded console application. Over the course of an hour, my application consumes all the available memory on my test server. I've tracked the leak down to where my applica...
Excel crashes when exiting and dotNET app tries to clean up (2 replies)
microsoft.public.dotnet.framework.interop
My app has an Excel COM object open and running. Thanks to information on this newsgroup I have managed to successfully pick up close events on the Excel instance within my app and put together some code to clean up references. After I tidy/close the reference to Excel within my app Excel crashes with the following error and a process for Excel remains in existance in the task manager list: Excel ...
COM Interop and MSMQ threading issue...I think (2 replies)
microsoft.public.dotnet.framework.interop
I have a problem making a call to a method on a COM component in response to a MessageQueue.ReceiveComplete event. The code exits at the point of the method call on the COM object only if called from the event delegate, stopping any further receive notifcations. I've had this problem previously with the MSComm.OCX and thus imagine that I need to configure the thread in which the delegate operates,...
Trying to 'Find' in Word from VB (3 replies)
microsoft.public.dotnet.framework.interop
Hoping someone can help me with this problem. When I call the following procedure from VB, I get an unhandled exception error at the line indicated. I have tried for ages to get this to work and its driving me nuts. I got most of the code by recording a word macro but I can't get it to work from VB. Any help would be greatly appreciated, Pete. Public Sub UpdateChecks() Dim strCoverFile Path2Templa...
How to call a Win32 function from .NetCF using VB successfully? (6 replies)
microsoft.public.dotnet.framework.interop
I'm try to invoke a Win32 function from .NetCF/SDE. The VB code does return 0, the C# return the expected handle. Here's the code from both applications. VB Example (.NetCF) System.Runtime.InteropServices.DllImport("coredll.dll", EntryPoint: "FindWindow") Public Shared Function FindWindow( ByVal lpClassName As String, ByVal lpWindowName As String ) As IntPtr End Function 'Does Not Work! Dim hfrmMa...
DCOM: access is denied (3 replies)
microsoft.public.dotnet.framework.interop
I am getting System.UnauthorizedAccessException while trying to create instance of DCOM object. Here is my code: Type dcomtype Type.GetTypeFromCLSID( (typeof(MYCOMWRAPPERLib.MyComObjectClass)).GUID, "my server", true); // Returns System. ComObject object dcomobj Activator.CreateInstance(dcomtype); // Throws the exeption Any help please.
Custom exceptions and EnterpriseServices (DCOM) (3 replies)
microsoft.public.dotnet.framework.interop
Is there anyway to alter the 'HRESULT to Type' mapping used with the DCOM protocol in EnterpriseServices ? I would like to throw custom exceptions from EnterpriseServices components without having them deserilized as COMExceptions. As all framework exceptions are deserialized correctly, there should be a map that decodes HRESULTs and recreates the correct exception. (where do they put the exceptio...
How to PInvoke on a void** (3 replies)
microsoft.public.dotnet.framework.interop
I think I've got my hands around most of PInvoke, but I still am not sure how to handle a struct member of type void** (or any other ** for that matter). Currently, I am marshaling it as a plain old IntPtr, but how can I call an unmanaged function with a void** and then how do I get the correct value for this param after the call returns (assuming the unmanaged function alloc'd a new ptr)? Thanks,...
How to handle user closing automated Excel object (4 replies)
microsoft.public.dotnet.framework.interop
My app. lets you export to Excel. It works beautifully except for a problem, and that is how to handle when a user closes the Excel workbook whilst the dotNET app is still running. A little background: the app keeps a global instance to an Excel workbook, so subsequent 'exports' export to the same workbook. If the user closes the workbook then I'd like to force my app to clear it's reference to th...
Trying to use legacy COM object...getting blown away (garbage collected?) (4 replies)
microsoft.public.dotnet.framework.interop
Greetings everyone... I have a problem here. I am getting this situation where in a plain vanilla CSharp app, where manually "Add Reference" to a legacy COM component, and #import that namespace, I can actually instantiate the COM object...no problem...but then I see this goofy situation where for some reason the system proceeds to blow it away! At first I thought it might be my COM component that...
SendMessage (3 replies)
microsoft.public.dotnet.framework.interop
I am having trouble on a call to SendMessage (line 113). the call fails. when i call Marshal.GetLastWin32Error() afterwards the error code is either 127 or 0. in a few rare instances the receiving program does receive the message, but the lparam and wparam it receives are 0x0 i am not sure why it is failing. i am attaching the cs file. any help would be appreciated as i am about to rewrite the pro...
Need to display Visio preview thumbnails from C# (3 replies)
microsoft.public.dotnet.framework.interop
(I apologize for the crosspost, but I really do think this question isn't easily answered in any one group.) I want to quickly preview Visio images in my C# application (the same previewing that Explorer does when you select thumbnail view). I have found four different approaches to doing this on the net. None of them work for me; three are totall broken and the fourth is too slow. I am requesting...
Marshalling nested structures and arrays (4 replies)
microsoft.public.dotnet.framework.interop
My program has a nested structure, when marshalling it to C dll, i get a error says: "Can not marshal field curve of type ConsoleApplication1.INFO: This type can not be marshaled as a structure field." In C: struct Hill { float S, Px, Py, E; }; struct Curve { Hill Factor[3]; }; struct SplitInkInfo { Curve curve[3]; }; And In C#: [StructLayout(LayoutKind.Sequential)] [Serializable] public class Hil...
converting a c++ struct to C# struct to pass to unmanaged code. (7 replies)
microsoft.public.dotnet.framework.interop
Hi, I have attempt to convert this C struct to a C# struct, so I can call unmanaged code. But I'm having problems with the array of structs, called HBAs, within the struct. Maybe someone could see the problem. When I run it. I get the following error: Can not marshal field HBAs of type NodeInfo: This type can not be marshaled as a structure field. If I substitute HBA for char it does not get the e...
COM+ contexts and confusing MS article... (4 replies)
microsoft.public.dotnet.framework.interop
Hi folks, I don't know if any of you have seen if yet, but there's a confunding paragraph in the MS article about managed COM components on gotdotnet http://www.gotdotnet.com/team/xmlentsvcs/espaper.aspx. My coworkers insist that the interpretation of this is that if a ServicedComponent A calls another non serviced class, say B, it's no longer safe to call ContextUtil() in B!!! Frankly enough, I c...
Marshaling a structure containing a aray of different structures (5 replies)
microsoft.public.dotnet.framework.interop
Hi, Im trying to marshal a structure that contains an array of another structure. As you can see the tNSPropertyList contains an array of tNSProperty structures. I have been able to make this work by copying all the array values to an allocated memory buffer, then passing the pointer to that memory in place of the array, but Im hoping someone out there knows of a more elegant solution. typedef str...
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