microsoft.public.dotnet.framework.interop Archive - March 2003
Post a message to this list
Messages
Page: 12
Interop call DsBrowseInfo (2 replies)
microsoft.public.dotnet.framework.interop
Please provide an example of platform invoke to the following API. Please take the time to review my approach thus far in accomplishing this. The structure layout and type definitions I've provided will help cut right to the essential problem I'm having calling into this method: STDAPI (int) DsBrowseForContainerW(PDSBROWSEINFOW pInfo); typedef struct { DWORD cbStruct; // size of structure in bytes...
IE Browser control onblur/onfocus events in C# (3 replies)
microsoft.public.dotnet.framework.interop
I have a need to capture the onblur and onfocus events of my input boxes on an html form and perform custom external handling in my C# application. I have been able to successfully hook up a handler to the 'onclick' event, but the 'onblur' and 'onfocus' events are being more elusive. I've heard talk around these parts of some bugs in the webbrowser control interop, wondering if this is related and...
String to byte array (2 replies)
microsoft.public.dotnet.framework.interop
Hi, If I am using a PInvoke function (ReadFile/ Writefile) that is passed a string item of type LPCVOID, how is this declared in vb.net? Can I use a string, or must it be some kind of byte array? If so, how is this conversion done? Thanks
Print Preview in Word 2002 (3 replies)
microsoft.public.dotnet.framework.interop
Hi I'm trying to automate Word from a C# application. I know how to write a PrintPage event if I print preview a text document (Rich text) or preview an image. But how do I write a PrintPage event to handle a Word, Excel, Power Point document? /ettis
QueryInterface failed (2 replies)
microsoft.public.dotnet.framework.interop
I'm using the SQLDMO class library via interop in a simple WinForm app (so no asp.net). The following second line cause an exception saying "QueryInterface for interface SQLDMO.NameList failed" ApplicationClass sqlApp new SQLDMO.ApplicationClass(); sqlApp.ListAvailableSQLServers(); I even tried the following line: System.Threading.Thread.CurrentThread.ApartmentSta te System.Threading.ApartmentStat...
Disable menus and commandbars in Word XP with C# (2 replies)
microsoft.public.dotnet.framework.interop
I am able to automate the Open,Save, Close. I can create commandbars and add them, but I am unable to hide the current commandbars or menu items from C#. All of the examples I am finding are VB and that overloads the FindControl() I have tried object oGet "Standard"; wordApp.CommandBars.FindControl(Missing.Value,oGet ,Missing.Value,Missing.Value) I get null object. Any ideas would be helpful thank...
How do I add a series to an Excel chart from .NET interop? (5 replies)
microsoft.public.dotnet.framework.interop
I know how to do this with normal VBA, but I'm trying to call Excel from C# and .NET interop and I can't get a SeriesCollection collection object from a Chart object, I get this compile time error Method 'Microsoft.Office.Interop.Excel. Chart.SeriesCollection(object)' referenced without parentheses It appears I can only access a specific item in the collection but not the whole collection directly...
Interop of C# with a non-com dll question (7 replies, VIP)
microsoft.public.dotnet.framework.interop
I am a newby to C# so forgive me if this is a dumb question. I have been doing c for 10 years. I want to upgrade a large existing project from C to C#. My plan is to re write sections as I go (which will take a while as I am cleaning up the code as I go. So, I need to make my C# code call some of the entry points in the existing C DLL. For example, lets assume that my C DLL has a signature as foll...
Late Binding (2 replies)
microsoft.public.dotnet.framework.interop
How can we create object with Late Binding in Visual Basic DotNet. I know that createobject was used Previously for creating COM component. Can it be used to create Instances of DotNet Assembly, considering the Assembly is stored locally rather than in the Global Assembly Cache. Regards, Irfan
Data marshaling CreatePipe (Null reference exception) (2 replies)
microsoft.public.dotnet.framework.interop
Hi I am getting a system null reference exception (object not set to an instance of an object) error in the following code: I would also like to know if it is possible to create a stream object from the handles created by this function. Thanks StructLayout(LayoutKind.Sequential, CharSet: CharSet.Auto) Public Structure SECURITY ATTRIBUTES Public nLength As Integer Public lpSecurityDescriptor As Int...
InvalidCastException (2 replies)
microsoft.public.dotnet.framework.interop
Hi! Scenario: I am using a VB6 component hosted in Component Services, in my ASP.NET Application. I get this "[InvalidCastException: QueryInterface for interface xxx failed.]" I can access the same without any problom in a windows app. I even tried setting ASPCompat true in my aspx page. No effect. What else can be the problem ? Any help is much appreciated. Regards, Sandy
Safearray(double) OutOfMemoryException (2 replies)
microsoft.public.dotnet.framework.interop
I am trying to simply access a COM structure that contains a SafeArray of Doubles from .NET code and getting an OutOfMemoryException... Is this a known bug (http://support.microsoft.com/default.aspx?scid kb;EN US;324181) or am I doing something wrong? Workarounds? Here is my IDL struct SampleInfo { double dblValue; SAFEARRAY(double) dblArr; } SampleInfo; C Code snippet... STDMETHODIMP CDeal::get S...
COM Interop structures (MQSeries Calls) (2 replies)
microsoft.public.dotnet.framework.interop
I'm having troubles getting some calls to MQSeries to work in VB.NET. I can easly get it to work in VB6, but since I'm writing a Windows service, I'd rather not add another layer to the mix (unless I can't figure this out). Here's a sample of the vb6 code that works: Public Declare Sub MQOPEN Lib "MQIC32.DLL" Alias "MQOPENstd@24" (ByVal Hconn As Long, ObjDesc As MQOD, ByVal Options As Long, Hobj A...
struct containing array of struct (2 replies)
microsoft.public.dotnet.framework.interop
Any help is much appreciated. I'm Calling a C dll from C#. I'm having problems passing a struct that contains a struct array. In C# I have: [StructLayout(LayoutKind.Sequential)] public struct STRUCT 1 { public long lEType1; public long lEType2; public double dE; } [StructLayout(LayoutKind.Sequential)] public struct CP SI ADD DATA { [System.Runtime.InteropServices.MarshalAs (UnmanagedType.ByValArra...
Bug in the Shared Source Common Language Infrastructure 1.0 Release? (3 replies)
microsoft.public.dotnet.framework.interop
Hi, The Shared Source Common Language Infrastructure 1.0 Release includes the following statement: "Due to a limitation in the way delegates interact with platform invoke, C implemented APIs that use the cdecl calling convention and require callbacks are not supported in C#. This sample illustrates a way to resolve this issue. It uses a custom attribute to annotate the desired interop delegate dec...
VB.Net Usercontrol Hosted in Internet Explorer (3 replies)
microsoft.public.dotnet.framework.interop
Hi, Is there a way to host a VB.Net windows UserControl in IE? This UserControl only has one button and does not reference anything unique other than the basic system.windows.forms, etc. I can only get this to work if I change the project to use COM Interop and in HTML change the CLASSID property to use a GUID like in the old ActiveX days. I have tried various syntaxes and paths for the CLASSID pr...
Instantiate an ActiveX at run-time from it's Guid (2 replies)
microsoft.public.dotnet.framework.interop
Hello people, Starting with the Guid of an ActiveX, how can I dynamically create it and display it in a .NET form? Put in a different way, I need to display an ActiveX in a .NET form with only it's Guid known only at run time. I guess AxHost class is involved. Should I use AxImp.exe at run time to create the wrapper class or there is another way? Thanks
Dataset XML (2 replies)
microsoft.public.dotnet.framework.interop
I have got a DataSet that contains three tables Customer, Order and OrderDetails with all the relationship defined in the dataset. As we all know the XML view of the Dataset is not hierarchia (atlease by Default). How can i display the Hierarchial XML from the Dataset? Is this something to do with changing XML Schema Programmatically...? If yes then how can I do this either? can any one give me so...
DirectoryEntry __ComObject use. (2 replies)
microsoft.public.dotnet.framework.interop
I'm using the DirectoryEntry class to get information about AD objects. I am running into problems with interop in dealing with the accountExpires, lastLogon, lockoutTime, and msExchMailboxSecurityDescriptor properties on a user. How can I extract meaningful data from the properties. They are returned as objects of type System. ComObject. Obviously there should be some way to convert the accountEx...
RAPI CeRegQueryValueEx = 'System.NullReferenceException' (3 replies)
microsoft.public.dotnet.framework.interop
After working and searching for what seems like an unusual amount of time for such a simple task, I am at an end. I have tried multiple declarations of CeRegQueryValueEx, (including all of D Christensen's suggestions from his reply to another post) and still it will not do anything but throw the System.NullReferenceException exception. But, I am able to open, create and write to a key. What am I m...
COM optional out parameter (3 replies)
microsoft.public.dotnet.framework.interop
I have a case where I have a ASP client calling a .NET Serviced Componet that needs to return an ADODB.Recordset. I'm having some problems with the Command.Execute method and the parameters. I'm getting the following errors: Argument '1': cannot convert from 'out System.Reflection.Missing' to 'out object' Argument '2': cannot convert from 'ref System.Reflection.Missing' to 'ref object' Argument '3...
I am attempting to use MSHTML and SHDOCVW to ... (3 replies)
microsoft.public.dotnet.framework.interop
manipulate already running instances of IE. I do not wish to host the control but only to manipulate instances of it from the outside. The trouble I am having is iterating through the collection of Elements in the All collection. I am being accused (by vs.net) of late binding the object definition in the context of a for...next loop. I understand this but I am struggling to come up with a better s...
multidimensional array (2 replies)
microsoft.public.dotnet.framework.interop
Hi, I have to pass a matrix (multidimensional array) as IN (not by REF or OUT) parameter to a SDK function declared as: snippet void RunModel(double **ppX, int *pXsize) { //.. all check code here for(int x 0; x pXsize[0]; x ) { for(int y 0; y pXsize[1]; y ) printf("%d ", ppX[x][y]); printf("\n"); } } /snippet the managed code is as following: snippet [DllImport("MyLib.dll")] public static extern v...
variable length array in a struct (3 replies)
microsoft.public.dotnet.framework.interop
HI, I am attempting to implement IOleCommandTarget in a C# library. I can get the call to Exec wot work OK but I am having truouple with QueryStatus. I believe that the problem is in the last parameter wich is (in C) [out][in]OLECMDTEXT* pCmdText where OLECMDTEXT is defined as (again in C) typedef struct tagOLECMDTEXT { DWORD cmdtextf; ULONG cwActual; ULONG cwBuf; /* [size is] */ wchar t rgwz[1]; ...
Problem: COM object using events not completely released even though ReleaseComObjectCalled (3 replies)
microsoft.public.dotnet.framework.interop
I am using a simple COM object from a C# application. The COM object is running as an EXE. It issues events. In order to release it I call Marshal.Release and Marshal.ReleaseComObject. The problem is that the COM object is not deleted after I release the object. MYOBJLib.MyComObjClass m co; System.IntPtr m unk; void CallCOM() { m co new MYOBJLib.MyComObjClass(); System.IntPtr m unk Marshal.GetIUnk...
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