Re: [DOTNET] Setting properties

2002-05-17 Thread Peter Stephens
Simon Robinson spake: > > Hi guys > > I have a class with two integer properties - call them A and B. > There is a condition that the value of B should always be greater than A, > otherwise the class won't function correctly. I'd like the error to be > detected and an exception thrown when client

Re: [DOTNET] Class that inherits from AxWebBrowser can't be placed in Toolbox

2002-05-16 Thread Peter Stephens
Try adding the attribute: [ToolboxItem(true)] to the class. -- Peter David A. spake: > > Hi everybody, > > Can anybody explain to me, why the following class can’t be placed on > the Toolbox? > > using System; > > namespace ExWebbrowserControlLibrary > { > /// > /// Zusammendfas

Re: [DOTNET] RCW for IFilter and LoadIFilter

2002-05-15 Thread Peter Stephens
You will have to be careful with the ppPropVariant pointer pointer. The documentation is a little contradictory. First the docs claim that ppPropVariant is a pointer to an output variable that receives a pointer to the PROPVARIANT. But then the docs go on to say in Notes to Callers: Allocate the

Re: [DOTNET] RCW for IFilter and LoadIFilter

2002-05-14 Thread Peter Stephens
> Erick Thompson spake: > > Peter, > > Thanks for your great suggestions. I eventually ended up using the last > method, the one that explicitly created the char array using AllocHGlobal. > Is this method going to impact performance at all, or is using > AllocHGlobal > actually going to speed thin

Re: [DOTNET] RCW for IFilter and LoadIFilter

2002-05-14 Thread Peter Stephens
>[PreserveSig] >int GetText( > [MarshalAs(UnmanagedType.U4)] > out UInt32 pcwcBuffer, > [MarshalAs(UnmanagedType.LPWStr)] > out string awcBuffer >); Just looking at the docs

Re: [DOTNET] Using IFilter interface from C#

2002-05-13 Thread Peter Stephens
ut together code to let me use IFilter > via LoadIFilter. Do I need to write RCW method signatures for all the > methods of an interface, or only the ones I am interested > in/going to call? > > Thanks, > Erick > > - Original Message - > From: "Peter Stephens&qu

Re: [DOTNET] New online examples of WebBrowser customizing

2002-05-13 Thread Peter Stephens
Thanks for the nice sample. Did you know that the BeforeNavigate2 event does not fire? This is due to a COM interop bug (see kb article: Q311298). You can overcome this by also implementing the DWebBrowserEvents (in addition to the DWebBrowserEvents2) sink on the activex web browser control. See

Re: [DOTNET] Using IFilter interface from C#

2002-05-09 Thread Peter Stephens
> Erick Thompson spake: > > How would I go about using the IFilter[1] interface from C#? From what I > gather, it's not an automation interface (== not a COM object?), > so I'm not > sure where to start. > > Thanks, > Erick > > [1] > http://msdn.microsoft.com/library/default.asp?url=/library/en-us

Re: [DOTNET] Disabling Refresh with the WebBrowser Ax Control

2002-05-06 Thread Peter Stephens
Hi Ted, Thank you for the book suggestion. I might read your book in the future, but currently do not have the time to read a whole book on the subject. For your information, instead of trying to disable the refresh function in MSHTML, I am writing my own private process Pluggable Protocol (URLM

[DOTNET] RFC: COM "Smart Pointer" for .NET

2002-05-06 Thread Peter Stephens
Hi Netters, I am doing a bit of work with COM interface references and am slowly but surely learning the ins and outs of interop. One thing that bothers me about COM interop is that most COM servers expect deterministic finalization. COM objects that are only expected to be used for a short peri

[DOTNET] Disabling Refresh with the WebBrowser Ax Control

2002-05-04 Thread Peter Stephens
Hi Netters, I am hosting Internet Explorer using the WebBrowser ActiveX control. I made my own custom AxHost subclass and have setup by hand the IWebBrowser, IHTMLDocument2, DWebBrowserEvents2, and IHTMLElement interfaces. This all works and I can display web pages in my control with no problem.

Re: [DOTNET] try...finally vs. nested using statements WAS: From C# to VB.NET

2002-05-03 Thread Peter Stephens
WAS: > From C# to VB.NET > > > Yes but it doesn't protect the case when an exception is thrown in > cmd.Dispose(). In that case cn.Close() will not be called as Kirk said. > > Jim > > > -Original Message- > > From: Peter Stephens [mailto:[EMAIL PROTEC

[DOTNET] try...finally vs. nested using statements WAS: From C# to VB.NET

2002-05-03 Thread Peter Stephens
your first dispose call (as > if there is an exception, you'd still want to call cn.Close) > > Kirk > > -----Original Message- > From: Peter Stephens [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 2 May 2002 8:03 p.m. > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET]

Re: [DOTNET] From C# to VB.NET

2002-05-02 Thread Peter Stephens
Thank you Mattias, I had never considered that multiple using statements before the code block were valid. I certainly haven't seen it used like this before. Your second technique is also interesting except that it requires the overhead of the cast. My typical pattern is: SqlConnection cn = nul

Re: [DOTNET] From C# to VB.NET

2002-05-01 Thread Peter Stephens
I will often use the try ... finally pattern in C# if there is more than one type of resource to clean up. The using statement only supports one type at a time. -- Peter You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://di

Re: [DOTNET] dataset.GetChanges on deleted rows

2002-05-01 Thread Peter Stephens
> franklin gray spake: > > Has anybody gotten this to work right? I get an empty dataset. > The rows have been deleted, not removed. > > TempDS = Me.DS.GetChanges(DataRowState.Deleted) Are you serializing your DataSet (ie Remoting) before calling GetChanges()? There seemed to be a serialization

[DOTNET] Hosting the browser in a WinForms application

2002-05-01 Thread Peter Stephens
Hi Netters, I am interested in using the IE browser control in my WinForms application. I have never hosted the browser (even in other languages) and am not sure what the capabilities and caveats are. So far I have determined that I need to use the COM interop tools like so: aximp c:\windows\sy

Re: [DOTNET] Confirm string GetHashCode reflects string, not object

2002-04-27 Thread Peter Stephens
> Ian Griffiths spake: > MD5 is believed to > be a good hash algorithm, and it has a length of 128 bytes (i.e. > 1024 bits) Actually MD5 is 128 *bits*, that is 16 bytes... -- Peter You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor list

Re: [DOTNET] Problems creating a basic extended usercontrol

2002-04-20 Thread Peter Stephens
I have never tried to make an extended control using the user control first. I have made one by just creating a simple code file and setting up my own class. This code works fine: > [ToolboxItem(true)] public class VrTextBox : TextBox { private Boolean _selectOnEntry = true;

Re: [DOTNET] ANN: .NET Remoting open source projects & Call for action!

2002-04-18 Thread Peter Stephens
> Ingo Rammer spake: > > This mail is also a call for action! > If you already implemented channels or sinks or have some great > ideas about > doing so, please don't hesitate to contact me This is great! I am currently out of the remoting phase of my app and am under fairly tight deadline for co

Re: [DOTNET] Using System.Reflection to create Extensible Apps

2002-04-18 Thread Peter Stephens
Reflection works well for creating a modular program. I would recommend using strong types more liberally. I assume VB allows you to call methods on an Obj that do not exist and that it will use reflection to call those methods. It would be better to cast your object into a Form. Here is the C# sy

Re: [DOTNET] updating dataset and dataform

2002-04-15 Thread Peter Stephens
Why don't you just bind the controls on the panel to the dataset? You should be able to use the same currency manager so that when the current record is changed in the grid, the panel's controls will automatically refresh. When the user makes changes via the controls, the data will automatically b

Re: [DOTNET] Transactions and CommandBuilders

2002-04-14 Thread Peter Stephens
> Shawn Wildermuth spake: > > That may be true, but it doesn't make any sense. We're talking about > disconnected data. Why would you only want inherit a transaction from > the select? But the built in command builder (via the associated data adapter) requires a select statement to determine

Re: [DOTNET] Transactions and CommandBuilders

2002-04-14 Thread Peter Stephens
> Shawn Wildermuth spake: > > I just want to confirm this. CommandBuilders and transactions are > incompatible, right? Since the CommandBuilder generates and destroys > Command objects on the fly as needed, I assume there is no way to attach > a transaction to the commands. I want to update a d

[DOTNET] Braindead Winforms ComboBox

2002-04-12 Thread Peter Stephens
Is it my imagination or is the ComboBox seriously broken? Maybe it is just my "luck" that I am trying to use it in a way no one else is using it... Problem #1: When in DropDown mode (not DropDownList) even you can select and manipulate text with the keyboard (Shift+End to select, etc) the mouse i

Re: [DOTNET] explicit interface methods

2002-04-11 Thread Peter Stephens
There is no performance difference. The main advantage is that you do not dirty the public interfaces of your class. Also, if you have two interfaces that have the same method signature and you want two different implementations then you will have to use explicit implementation. Also note that yo

Re: [DOTNET] and databinding funkiness

2002-04-11 Thread Peter Stephens
There might be an issue with "\". You must escape a backslash. Try "\\" or @"\" -- Peter > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.

Re: [DOTNET] Cut, Copy Paste, etc. in the Edit menu?

2002-04-11 Thread Peter Stephens
gt; > Peter -- > > See http://discuss.develop.com/archives/wa.exe? > A2=ind0110c&L=dotnet&F=&S=&P=8043 > > This will work in an MDI WinForm. > > Bill > > On Thu, 11 Apr 2002 13:21:05 -0700, Peter Stephens [EMAIL PROTECTED]> wrote: > > >Unlike F

[DOTNET] Cut, Copy Paste, etc. in the Edit menu?

2002-04-11 Thread Peter Stephens
Unlike FoxPro or MFC there doesn't seem to be any automagic support for the standard edit commands in a main menu. The textbox does have a context menu, but there doesn't seem to be a way to associate that with a main menu or a merge menu (in MDI). I have an idea for a method that might work: --