Re: [ADVANCED-DOTNET] Runtime Class Registration in VB.Net

2008-10-02 Thread Peter Ritchie
You should send this to the new list: [EMAIL PROTECTED] === This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com

Re: [ADVANCED-DOTNET] Has the list died?

2008-09-24 Thread Peter Ritchie
>btw, @Peter Ritchie: wouldn't that mitigate the whole point of getting rid of >the list on the develop domain? No, it still means offloading the management and storage of the list to another server and organization; but providing a courtesy to the list users by transferring to the

Re: [ADVANCED-DOTNET] Has the list died?

2008-09-24 Thread Peter Ritchie
How out of the question would it be to have a couple of records on the develop.com side redirect to this new address? === This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com

Re: [ADVANCED-DOTNET] Planning to keep the list alive

2008-09-15 Thread Peter Ritchie
I think the reason people use this list is because it isn't based on a web (HTML) interface. There's already numereous web-based sites that cover the topics discussed on this list. If a web-based site were acceptable to the subscribers of this list, they'd already be using one of the existing sit

Re: [ADVANCED-DOTNET] ncurses Library for .NET

2008-09-12 Thread Peter Ritchie
NCursesSharp is just an interop wrapper on top of a Windows ncurses library. If you're not comfortable adding a "portions copyright of " to your software, then that library may not be for you. -- Peter On Fri, 12 Sep 2008 10:35:52 -0500, Ron Young <[EMAIL PROTECTED]> wrote: >NCursesSharp: >http

Re: [ADVANCED-DOTNET] ncurses Library for .NET

2008-09-12 Thread Peter Ritchie
What particular part of ncurses are you looking for? Do you need mouse input, do you want simply colour and positioning, are you looking for windowing, etc.? I you're only looking for positioning and colour, do Console.SetCursorPosition(), Console.BackgroundColor, Console.ForegroundColor not do

Re: [ADVANCED-DOTNET] Retiring the ListServ

2008-09-09 Thread Peter Ritchie
Can you do that with Google groups? On Tue, 9 Sep 2008 08:28:23 -0700, Pardee, Roy <[EMAIL PROTECTED]> wrote: >My recommendation would be to require that new members have their first posts moderated. That should cut down on bots joining up, sending X number of spam messages, and then abandoning

Re: [ADVANCED-DOTNET] Converting doubles into integers without rounding errors

2008-08-25 Thread Peter Ritchie
As John has alluded to, what you're seeing is a difference in rounding between formatting a double value as text and multiplying by 100 and dropping the decimals. If you have specific rounding logic, perform it before you convert to int. If you want the same value that you'd see as formatted text

Re: [ADVANCED-DOTNET] Changing the dropdown text in a combobox...

2008-08-23 Thread Peter Ritchie
Sounds like what you're adding to a combobox is a mutable object (i.e. it state changes and as a result calling ToString() again will result in a different string). ComboBox is just a wrapper around the Windows combo box. The Windows combo box doesn't support objects, it's simply a collection of

Re: [ADVANCED-DOTNET] Web Proxy and Images C#

2008-08-21 Thread Peter Ritchie
The data can be in any format. "String format" is vague. Is that ASCII, Unicode, etc? HTTP, I believe, specifies that the header text must use ASCII codepoints. The "content" can be anything--specified by the Content- type header. === This list is hosted by Deve

Re: [ADVANCED-DOTNET] Web Proxy and Images C#

2008-08-21 Thread Peter Ritchie
The Content-type header in the response tells you what type of data is after the header. For an image it should be MIME type "image/gif". === This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://disc

Re: [ADVANCED-DOTNET] Web Proxy and Images C#

2008-08-21 Thread Peter Ritchie
By the way, you can watch the raw data going back and forth with free tools like WireShark. === This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com

Re: [ADVANCED-DOTNET] Web Proxy and Images C#

2008-08-21 Thread Peter Ritchie
The browser itself just requests a specific resource (an image file, in this case). The server just sends it back as raw data wrapped with an HTTP response header. You *could* do that sort of thing with a custom browser and server (i.e. encode image data in a specific way, like uuencode; but, I k

Re: [ADVANCED-DOTNET] Web Proxy and Images C#

2008-08-21 Thread Peter Ritchie
The browser may be caching the image... I would expect that a proxy would simply send back byte[]. Unless it's some sort of smart proxy, it should only know that data is going through it, not what type the data is. It could detect the type of the request and send data back in a specific way...

Re: [ADVANCED-DOTNET] Web Proxy and Images C#

2008-08-21 Thread Peter Ritchie
The image is a separate request. The browser requests a specific URL. If it's HTML, then it parses it and displays it. As it encounters referenced URLs, like http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com

Re: [ADVANCED-DOTNET] Web Proxy and Images C#

2008-08-21 Thread Peter Ritchie
Unless I've misunderstood your use of "proxy", your proxy should be getting the request to download the image after the request to download the HTML. It's not getting that? === This list is hosted by DevelopMentor® http://www.develop.com View archives and manage

Re: [ADVANCED-DOTNET] Webbrowser control and backspace key problem

2008-08-08 Thread Peter Ritchie
You'd run into this problem with a number of controls--many controls do something specific with certain keystrokes. I would recommend setting the focus away from the browser control while in on-screen keyboard mode. See the ActiveControl property on the form. On Fri, 8 Aug 2008 11:00:20 +0300,

Re: [ADVANCED-DOTNET] Setting a Constant Value in VB.Net

2008-08-07 Thread Peter Ritchie
On Thu, 7 Aug 2008 00:49:22 +0100, Stuart Dunkeld <[EMAIL PROTECTED]> wrote: > >How about: > >Const c1FaLen = Convert.ToString(c1FullAddr).Length ? As others have pointed out the compiler can't compile this, and it's simply another way of writing the orginal code that didn't compile. >Can I ask i

Re: [ADVANCED-DOTNET] Setting a Constant Value in VB.Net

2008-08-06 Thread Peter Ritchie
As you've guessed, there's no compile-time ability to get the length of a string (or to execute any member of any const at compile-time). ReadOnly members are the way to get around this problem. For example: Public Shared ReadOnly c1FullAddr As String = "1 Colonial Drive Parma Ohio 21321"

Re: [ADVANCED-DOTNET] The effects of ORM in architecture and domain driven design

2008-07-24 Thread Peter Ritchie
On Thu, 24 Jul 2008 17:55:24 +0200, Brady Kelly <[EMAIL PROTECTED]> wrote: >> Could this be because you are/were working in a data centric world? I >> regularly see changes in database structure that do not represent >> changes in my domain. An example of this might be selective >> denormalization

Re: [ADVANCED-DOTNET] The effects of ORM in architecture and domain driven design

2008-07-23 Thread Peter Ritchie
ave the same impact. > >From my own experience, the only change with an effect that can be >limited, to the DAL or even only the DB, is adding a non mandatory >field or one where a default value makes sense. > >So talking about tight/loose coupling in the context of ORM has some &g

Re: [ADVANCED-DOTNET] Mixing C code in a managed C++ project

2008-07-23 Thread Peter Ritchie
That's silly, the IDE should do that automatically. I've logged a bug on Connect: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx? FeedbackID=357508 === This list is hosted by DevelopMentor® http://www.develop.com View archives and manage yo

Re: [ADVANCED-DOTNET] The effects of ORM in architecture and domain driven design

2008-07-23 Thread Peter Ritchie
I don't consider it harsh; I think that at some level we're actually agreeing and that you've misunderstood what I've said. Read on... On Wed, 23 Jul 2008 19:10:46 +0200, Frans Bouma <[EMAIL PROTECTED]> wrote: >Of course there's coupling, they represent the same thing! Yes, they repres

Re: [ADVANCED-DOTNET] The effects of ORM in architecture and domain driven design

2008-07-23 Thread Peter Ritchie
What it sounds like to me is that you want to utilize agile software development techniques. One tenet of this is to keep coupling very low. This follows the basic OO principle or single responsibility (SRP). Said in another way: a class should have only one reason to change. If you're modeling

Re: [ADVANCED-DOTNET] The effects of ORM in architecture and domain driven design

2008-07-21 Thread Peter Ritchie
I would suggest using the Repository Pattern to keep the business logic of the entities separate from the persistence logic. Domain Driven Design by Eric Evans provides some excellent information for designing domains and their interaction with the rest of the system.

Re: [ADVANCED-DOTNET] MSIL Code Generation

2008-07-17 Thread Peter Ritchie
If you provide example code we can probably point out what's missing/needs- correction. I don't know off hand how you can write a valid assembly to disk without being able to read types with Reflector/ILDASM. Here's the most simple case of dynamnically creating an assembly: AssemblyName assembly

Re: [ADVANCED-DOTNET] Machine.config

2008-06-26 Thread Peter Ritchie
You can get to them via ConfigurationSettings.AppSettings. The configuration system flattens the application settings in machine.config and app.config when initializing. On Thu, 26 Jun 2008 16:31:57 +0100, Charles Gamble <[EMAIL PROTECTED]> wrote: >Hi, > > > >How can you read application setting

Re: [ADVANCED-DOTNET] Get OS to open a file using the default file association

2008-06-21 Thread Peter Ritchie
Hi Holly, this will do what you've described: Process process = new Process(); process.StartInfo.FileName = @"C:\spreadsheet.xls"; process.StartInfo.UseShellExecute = true; process.Start(); On Thu, 12 Jun 2008 16:47:51 +0100, Holly Styles <[EMAIL PROTECTED]> wrote: >Hi There, > >I'm wondering if

Re: [ADVANCED-DOTNET] Accent Insensitive CultureInfo (or at least DataTable.Select)

2008-06-04 Thread Peter Ritchie
As far as I've been able to tell, you can't create a CompareInfo that causes diacritics to be ignored on comparison (which means you can't create a CultureInfo to do the same). You can create something that will sort as if diacritics weren't there... As far as I can tell the only way to compare t

Re: [ADVANCED-DOTNET] Mailing list software without spam

2008-06-02 Thread Peter Ritchie
As has been said, if you could reliably send mass e-mails and get all of them through all spam filters you'd make millions. There's not a whole lot you can do but avoid SPAM keywords [1] and keep an eye on spammer black-lists to make sure your hosts aren't on them [2] [1] http://www.activewebhost

Re: [ADVANCED-DOTNET] Network Search

2008-05-22 Thread Peter Ritchie
Yes, if PHost isn't running or isn't listening continuously, the you'll have to pick an arbitrary length of time to listen. You might want to have a look at the DHCP protocol [1]. Parts of it's protocol sound much the same as you've described. [1] http://support.microsoft.com/kb/169289 On Thu,

Re: [ADVANCED-DOTNET] Network Search

2008-05-22 Thread Peter Ritchie
What John is suggesting is to open a socket to an unassignable IP address-- a broadcast address. This is a special address that specifies what subnet the broadcast is limited to. It's not an address that can be assigned to a NIC (e.g. by DHCP). There's an example of this here: http://www.java2s.

Re: [ADVANCED-DOTNET] Problem with System.Diagnostics.Process.Start() - acts as if it's blocking the thread.

2008-04-24 Thread Peter Ritchie
Does it make any difference if you set ProcessStartInfo.UseShellExecute to false? On Thu, 24 Apr 2008 10:23:23 -0500, Mike Andrews <[EMAIL PROTECTED]> wrote: >I'm having a particular problem that I need to resolve but can't seem to >find the answer. > >I have a Winform application that does vario

Re: [ADVANCED-DOTNET] Security questions

2008-04-22 Thread Peter Ritchie
On Tue, 22 Apr 2008 16:12:06 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >Hi,The SSL has nothing to do with the password encryption. We just need to make sure the communication is running over HTTPS.Can I use a salt with SHA-512? Sure, a salt is just extra bytes added to the creation of the has

Re: [ADVANCED-DOTNET] Security questions

2008-04-22 Thread Peter Ritchie
2:15 -0700, Greg Young <[EMAIL PROTECTED]> wrote: >My guess would be a good hash function + a salt ... + SSL for >transmission would pass ... > >On Tue, Apr 22, 2008 at 7:10 AM, Peter Ritchie ><[EMAIL PROTECTED]> wrote: >> SHA1 isn't an encryption, it's a

Re: [ADVANCED-DOTNET] Security questions

2008-04-22 Thread Peter Ritchie
SHA1 isn't an encryption, it's a hash. A hash is one-way, you can't rehydrate the original data from a hash. base64 isn't encryption, it's encoding- meaning anyone can decode it. If you really want to pass the audit, find out from them what hash algorithm will pass. Maybe SHA-512 will pass?

Re: [ADVANCED-DOTNET] Installing the .NET Framework from an MSI

2008-04-02 Thread Peter Ritchie
You're only licensed to redistribute dotnetfx.exe, there is no MSI. Short story: MSFT wants only one redistributable; to support targets that don't have MSI 3 installed it's not an MSI. See http://msdn2.microsoft.com/en-us/library/aa480242.aspx for details on redistribution outside of Visual Stud

Re: [ADVANCED-DOTNET] Inter-process communication

2008-04-01 Thread Peter Ritchie
I agree, and was just about to suggest named pipes. If you're using VS 2008, there are some new named pipe classes so you can avoid PInvoke if you want to use named pipes directly without using WCF. On Tue, 1 Apr 2008 21:07:28 +0200, brian zinn <[EMAIL PROTECTED]> wrote: >If you want to communic

Re: [ADVANCED-DOTNET] Inter-process communication

2008-04-01 Thread Peter Ritchie
On Tue, 1 Apr 2008 10:41:13 -0700, Clark, Michael (OFM) <[EMAIL PROTECTED]> wrote: >If I had a process running in the background (spawned by a web service >method, for instance) and wanted another process to be able to get to it >to find out what its status was, how would this be done? > >In the s

Re: [ADVANCED-DOTNET] Thread implementation issue

2008-03-28 Thread Peter Ritchie
>What about Thread.Interrupt? Isn't that for waking up a thread that's >currently sleeping? Thread.Interrupt is documented with "...If this thread is not currently blocked in a wait, sleep, or join state, it will be interrupted when it next begins to block.". You can use Thread.Interrupt but it i

Re: [ADVANCED-DOTNET] Thread implementation issue

2008-03-28 Thread Peter Ritchie
What does Blinker.Stop do? One thing you'll run into is the only thing you'll be able to do with this thread while it's blocked on Thread.Sleep is to terminate it abnormally. There is, of course, no way to do this in the framework (without using PInvoke). So, a couple of suggestions: don't use Th

Re: [ADVANCED-DOTNET] threads, sockets, db writing

2008-03-26 Thread Peter Ritchie
Sounds like you want some sort of job queue where each incoming packet received adds an work item to a queue. A background thread (or threads) could then wait for items in the queue and process them. === This list is hosted by DevelopMentor® http://www.develop.com

Re: [ADVANCED-DOTNET] Debugging .NET without admin privileges

2008-03-25 Thread Peter Ritchie
There's mention of a similar problem here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2698390&SiteID=1 The problem was the framework wasn't the RTM version. You might try asking on the Reference Source Server Discussion forum [1], Shawn Burke seems to be reading that forum. [1] http:/

Re: [ADVANCED-DOTNET] Debugging .NET without admin privileges

2008-03-25 Thread Peter Ritchie
Try also enabling "Print source server diagnostic messages to the Output window" (under "Enable source server support" in Tools/Options/Debug/General) to see if it outputs anything useful in this circumstance. === This list is hosted by DevelopMentor® http://www.de

Re: [ADVANCED-DOTNET] Debugging .NET without admin privileges

2008-03-25 Thread Peter Ritchie
Did you read the section of Shawn Burke's post titled "When I choose "Load Symbols" I get an Open File dialog asking for the PDB." (in the FAQ)? What DLL are you trying to load symbols for? On Tue, 25 Mar 2008 14:06:35 -0400, =?ISO-8859-1?Q?S=E9bastien_Lorion?= <[EMAIL PROTECTED]> wrote: >I foll

Re: [ADVANCED-DOTNET] Retrieving Font from Resource File

2008-03-17 Thread Peter Ritchie
I haven't tried it, but you could try using PrivateFontCollection.AddMemoryFont(). Based on signature, something like the following? // load of font resource and retrieval of it's length performed previous GCHandle gcHandle = GCHandle.Alloc(loadedFontResource, GCHandleType.Pinned); try { privat

Re: [ADVANCED-DOTNET] Collection initializer and Dictionary<>

2008-03-07 Thread Peter Ritchie
How about: private static Dictionary m_codestrings = new Dictionary() { { 1, "A" }, }; On Fri, 7 Mar 2008 12:01:17 -0500, David Nicholson <[EMAIL PROTECTED]> wrote: >Is there a way to use the C# 3.5 collec

Re: [ADVANCED-DOTNET] Trigger and multiple values in the inserted table

2008-02-12 Thread Peter Ritchie
On Tue, 12 Feb 2008 15:43:14 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >Hi all, >To cut a long strory short I have a trigger where I want to update some totals on another table. >THe thing is I have the following line: >SET @roleType = (SELECT cc.calltreecontactroleid FROM CallTreeContacts cc W

Re: [ADVANCED-DOTNET] Join/Merge multiple files together

2008-02-05 Thread Peter Ritchie
There's no documented function in Windows to do this, as the concept "append file x to file y". Thus, nothing in .NET to do this. You'd have to write something that modified the filesystem. In FAT it would be pretty easy, simply modify the file allocation table for the first file (replacing the

Re: [ADVANCED-DOTNET] Unwiedly unit test

2008-01-04 Thread Peter Ritchie
TDD has been around a while (a while in computer time...) and is really a formalization of unit-testing. It is something that needs to be taken into account and budgeted for, IMO. If you don't budget time for it then you can't track it and, as with anything else that isn't budgeted for, it's the

Re: [ADVANCED-DOTNET] Unwiedly unit test

2008-01-04 Thread Peter Ritchie
By the way, when I say "mock" I mean anything that's used as a substitute during testing, that could be mocks, fakes, stubs, etc. On Fri, 4 Jan 2008 17:22:50 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >That makes total sense. >I now see how I can do this in isolation. > >Mocking is the answer.

Re: [ADVANCED-DOTNET] Unwiedly unit test

2008-01-04 Thread Peter Ritchie
On Fri, 4 Jan 2008 16:35:28 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >It means I do not have to rely on SMTP being installed and configured on the machine running the tests. Okay, but then what does "Send" do? It's not testing sending of mail. If it's just there because that's part of the pr

Re: [ADVANCED-DOTNET] Unwiedly unit test

2008-01-04 Thread Peter Ritchie
On Fri, 4 Jan 2008 16:17:20 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >I have to create the plan each time. >I have to assign contacts to the plan. >They have to request sign off in order to be able to sign it off.I raise exceptions if any of the above is not the case if a sign off is requested

Re: [ADVANCED-DOTNET] Unwiedly unit test

2008-01-04 Thread Peter Ritchie
On Fri, 4 Jan 2008 16:03:37 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >I am but it is getting the structure into the state where I can test the sign off process. That should be part of the setup. But, you've got more than simply setup in there, for example, you're also testing invalid login.

Re: [ADVANCED-DOTNET] Unwiedly unit test

2008-01-04 Thread Peter Ritchie
Looks to me like you're doing much more than testing the sign off process. On Fri, 4 Jan 2008 15:50:57 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >Hi all, > >I am just looking for some guidance. > >I have the following monstrous unit test (see below) where I seem to be testing bout 10 different

Re: [ADVANCED-DOTNET] non authenticated security

2008-01-03 Thread Peter Ritchie
Not to mention the use case where a new user signing up types in an already in use PIN and is informed "That PIN is in use, please choose another"... ...assumes you only need a PIN to log in... On Thu, 3 Jan 2008 13:29:22 -0800, Greg Young <[EMAIL PROTECTED]> wrote: >Wow that sounds like a reall

Re: [ADVANCED-DOTNET] non authenticated security

2008-01-03 Thread Peter Ritchie
On Thu, 3 Jan 2008 16:39:33 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >I really do agree with you but the thing is the data from the feeds that I am importing via SSIS is not clean data.Sometimes all I have is an email address. I would have to comprimise the quality of the users data in order

Re: [ADVANCED-DOTNET] non authenticated security

2008-01-03 Thread Peter Ritchie
I would suggest storing only a hash of the PIN/password, but if you take server compromise out of the picture it doesn't make it any more secure. It's "secure" but it could be more secure. Some things that would make it more secure: mandate passwords of at least 8 characters and include three typ

Re: [ADVANCED-DOTNET] non authenticated security

2008-01-03 Thread Peter Ritchie
Is this PIN stored in a database somewhere, or do they have to re-enter it after it "expires"? On Thu, 3 Jan 2008 15:54:03 +, Paul Cowan <[EMAIL PROTECTED]> wrote: >Hi all,I am migrating an ASP app. to an ASP.NET and have spotted a potential security hole. >Most of the app. I am securing with

Re: [ADVANCED-DOTNET] Creating unmanaged DLL from .net

2008-01-03 Thread Peter Ritchie
Yes, there's no such thing as a managed entry point, they have to be native. Using Implicit Interop with C++ will allow you to create a mixed mode C++ DLL that can have native entry points that would then call managed code. Implicit Interop does all the PInvoke heaving lifting in the background.

Re: [ADVANCED-DOTNET] Nullable(Of String)

2007-12-06 Thread Peter Ritchie
On Fri, 7 Dec 2007 00:50:06 +1030, Mark Hurd <[EMAIL PROTECTED]> wrote: >Following on from the thread "another generic query", what is the >simplest way to implement Nullable(Of String) when that IS what you >want. > >E.g. You have a String property and setting it to any value, including >Nothing,

Re: [ADVANCED-DOTNET] generics and Mixins

2007-12-05 Thread Peter Ritchie
In general, an interface "inheriting" for any type isn't supported. An interface can only "implement" another interface. There's no way to constrain a type parameter to "interfaces". Then, of course, you can't use a type parameter as a base class/interface anyway...

Re: [ADVANCED-DOTNET] pathetic and infuriating problem....

2007-11-30 Thread Peter Ritchie
d. If you want to change languages while the form is open, Winforms doesn't support that. On Fri, 30 Nov 2007 12:57:03 -0500, Peter Ritchie <[EMAIL PROTECTED]> wrote: >Simply set the form's Localizable[sic] property to True and whenever you >change the Icon property it will o

Re: [ADVANCED-DOTNET] pathetic and infuriating problem....

2007-11-30 Thread Peter Ritchie
Simply set the form's Localizable[sic] property to True and whenever you change the Icon property it will only affect the selected Language. Changing Language will "copy" the values from the Default and you can override them for that particular language. === This li

Re: [ADVANCED-DOTNET] pathetic and infuriating problem....

2007-11-30 Thread Peter Ritchie
When you click on the Icon property you're setting it, so it asks what file to use. It doesn't support selecting an icon from resources (don't know why), if that's what you're asking. As far as I know you can only replace the existing icon in the resources; the Form designer always stores the for

Re: [ADVANCED-DOTNET] pathetic and infuriating problem....

2007-11-30 Thread Peter Ritchie
You shouldn't see any code setting the Icon property if you haven't specifically used the designer to add a non-default Icon. If you do have code this.Icon = ((System.Drawing.Icon)(resources.GetObject ("$this.Icon"))); then it was added to the resources. Double click on Form1.resx (where Form1 is

Re: [ADVANCED-DOTNET] Multiple UI versions....but not quite multilingual....

2007-11-29 Thread Peter Ritchie
On Mon, 26 Nov 2007 06:15:34 -0500, Mark Nicholls <[EMAIL PROTECTED]> wrote: >What do you mean by "keeping the text in the resources"? >How would you go about wrapping Properties.Resources class? In the Solution Explorer, Properties\Resources.resx lets you have any number of application-wide reso

Re: [ADVANCED-DOTNET] Multiple UI versions....but not quite multilingual....

2007-11-21 Thread Peter Ritchie
Yes, the built-in multilingual support in WinForms is dependant on culture names (like "en-US"). If you wanted to use the built-in functionality you'd have to create and install your own locales. I've seen people use dictionaries, as Paul mentioned. I've also seen people use database lookups, wr

Re: [ADVANCED-DOTNET] Custom WebControls and CAS

2007-11-16 Thread Peter Ritchie
I think it's pretty common in shared hosting environments that ASP.NET is not running with Full Trust. GoDaddy.com, for example; I believe doesn't let it's user's sites run with Full Trust. I don't know what its policy settings are with regard to AspNetHostingPermission though... AspNetHostingPe

Re: [ADVANCED-DOTNET] calling c++ dll from C#....

2007-11-16 Thread Peter Ritchie
As has been pointed out, the only way to make native classes available to managed code is to write managed adapters (you'll likely have to change attributes or behaviour slightly, so they're usually more than just "wrappers"). In C++/CLI, you can simply write managed classes and instantiate and us

Re: [ADVANCED-DOTNET] Visual Studio 2005 & 2008

2007-11-16 Thread Peter Ritchie
Yes, installing 2008 and 2005 side-by-side is supported. Aaron Stebner mentions that here: http://blogs.msdn.com/astebner/archive/2007/06/22/3464822.aspx. I believe more detail about it is in the installation notes; but I can't find them online separately. If you're thinking about installing the

Re: [ADVANCED-DOTNET] Marshalling of COM dates

2007-11-05 Thread Peter Ritchie
I've written a custom marshaler for DateTime, but I can't seem to get it to be used with a COM object. Custom marshaling seems straightforward with simple PInvokes; but it seems to be ignored with COM interfaces. i.e. the custom marshaler works fine when I PInvoke a method whose parameter is attri

Re: [ADVANCED-DOTNET] Marshalling of COM dates

2007-11-05 Thread Peter Ritchie
ged interfaces for the COM interfaces--which means not using tlbimp or not simply adding the COM DLL/EXE as a reference in your project. But, I haven't done any custom marshaling, so I'd have to look into a bit further. > > /P > > - Original Message - > From: "P

Re: [ADVANCED-DOTNET] Marshalling of COM dates

2007-11-03 Thread Peter Ritchie
I think you'll have to declare your own managed interface for your native interfaces if you want to use custom marshaling (i.e. not use tlbimp) But, before going that route, how are the "COM dates" declared in the IDL? I've round-tripped dates through a native COM object without losing precision.

Re: [ADVANCED-DOTNET] Working with threads in VS2005

2007-10-24 Thread Peter Ritchie
If you're looking for one thread to wait for the other two to complete, the fork/join pattern would work: Thread thread1 = new Thread(new ThreadStart(ThreadEntry)); Thread thread2 = new Thread(new ThreadStart(ThreadEntry)); thread1.Start(); thread2.Start(); thread1.Join(); thread2.Join(); //curren

Re: [ADVANCED-DOTNET] PluginManager - Using Loaded Types (Take 2)

2007-10-17 Thread Peter Ritchie
As soon as you reference a type from an assembly you'll load that assembly into the main AppDomain and it will be unloadable and in-use (i.e. not updatable). So, you must always reference it indirectly. This is usually done with an interface defined in a third assembly. The types in your plugin

Re: [ADVANCED-DOTNET] System.Environment.SetEnvironmentVariable Question

2007-10-10 Thread Peter Ritchie
When you use the SetEnvironmentVariable(String, String, EnvironmentVariableTarget) overload, it stores the environment variable in the user's hive or the machines have when using EnvironmentVariableTagert.User and EnvironmentVariableTarget.Machine respectively. Using EnvironmentVariableTarget.User

Re: [ADVANCED-DOTNET] Nested sql server transaction in Ado.Net transaction

2007-09-18 Thread Peter Ritchie
I didn't quite follow your question; but it's not necessary for an ADO.NET method to fail in order to use Rollback, any method/code can fail to use Rollback (it doesn't even need to be an exception...). Your syntax just needs to be changed to use the SqlTransaction class: SqlTransaction trans = d

Re: [ADVANCED-DOTNET] Correct handling of AppDomains

2007-09-12 Thread Peter Ritchie
Where are the interfaces defined that you're using? Are they in a third assembly? On Thu, 13 Sep 2007 08:37:47 +1200, Dean Cleaver <[EMAIL PROTECTED]> wrote: >Hi, > >I'm writing an automation module that is designed to fire various jobs >(created as assemblies implementing a given interface). I'

Re: [ADVANCED-DOTNET] code stream versions

2007-09-05 Thread Peter Ritchie
I would use patterns like Façade, Mediator or Dependency Injection and design methodologies like interface-driven-design to attempt to abstract customer-specific functionality into decoupled classes or even assemblies. One solution is to rebuild your solution into a specific binary per customer.

Re: [ADVANCED-DOTNET] Passing a method as a parameter

2007-09-01 Thread Peter Ritchie
Yes, in safe managed code it's with a delegate. You need to keep the object pointer and the method pointer pair together, which is what a delegate does for you. You'll have to declare the === This list is hosted by DevelopMentor® http://www.develop.com View arch

Re: [ADVANCED-DOTNET] Warning number for obsolete

2007-08-24 Thread Peter Ritchie
I always thought the error code should be in the error list... On Fri, 24 Aug 2007 10:07:35 -0700, Mont Rothstein <[EMAIL PROTECTED]> wrote: >Thanks, I was looking at the Error List and didn't think to check the >Output. === This list is hosted by DevelopMentor®

Re: [ADVANCED-DOTNET] http request streaming

2007-08-17 Thread Peter Ritchie
Sounds like an agitator to me. SOAP and web services? I think the two have been used together occasionally. If you were going the listening to a port route, you'll have to create your own server, implementing HTTP if that's the protocol you want to use-- not very productive, IMHO. The benefit o

Re: [ADVANCED-DOTNET] Canceling an asynchronous method call

2007-08-15 Thread Peter Ritchie
How are you implementing BeginWebService? By default Visual Studio generates *Async methods to execute web service methods asynchronously, which is then "ended" via the call to the callback. An asynchronous call can be canceled via the CancelAsync method. -- Peter On Wed, 15 Aug 2007 09:48:55 -

Re: [ADVANCED-DOTNET] compiler considerations

2007-08-07 Thread Peter Ritchie
It's only try/finally blocks with empty finally blocks that get optimized to no try/finally at all. e.g. int i = 1; try { i = 2; i = 3; } finally { Debug.WriteLine(i); } Console.WriteLine(i); With DEBUG defined, the above code won't be optimized. With DEBUG not defined, the C# compiler wi

Re: [ADVANCED-DOTNET] compiler considerations

2007-08-07 Thread Peter Ritchie
Usually when people talk about compiler optimizations they mean the JIT. CSC does precious little optimization. (http://msdn.microsoft.com/msdnmag/issues/05/01/COptimizations/default.aspx ?side=true#a) === This list is hosted by DevelopMentor® http://www.develop.co

Re: [ADVANCED-DOTNET] Inheritance issues with the toolstrip control

2007-08-01 Thread Peter Ritchie
Ah, okay, from the designer. As far as I know the designer doesn't support changing properties from the base class unless they're properties of the base class. If you make the ToolStrip a virtual property of the base class the derived class can edit it in the Designer; but only as a property, yo

Re: [ADVANCED-DOTNET] Inheritance issues with the toolstrip control

2007-08-01 Thread Peter Ritchie
What are you making protected? The Modifier property of the ToolStrip control on your UserControl? I assume you mean "protected instead of private". When UserControls work, I don't have a problem doing that. What do you mean by "won't let me make any changes", compile errors or runtime errors?

Re: [ADVANCED-DOTNET] Strange issue with Thread.CurrentPrincipal and BackgroundWorker / Threads

2007-07-24 Thread Peter Ritchie
That may work; but the problem with that is you're circumventing the ControlPrincipal permission on the CurrentPrincipal property, essentially introducing the possibility that code denied that permission can still change the thread's current principal. On Tue, 24 Jul 2007 14:56:47 +0200, Ryan Hea

Re: [ADVANCED-DOTNET] Strange issue with Thread.CurrentPrincipal and BackgroundWorker / Threads

2007-07-24 Thread Peter Ritchie
Have you applied the July 10th security fix? My original tests were performed before I applied that fix to my computer and now I'm seeing different behaviour. Before the fix I was noticing that I couldn't get a change to the thread's CurrentPrinciple during any event to "stick" past the event. W

Re: [ADVANCED-DOTNET] Strange issue with Thread.CurrentPrincipal and BackgroundWorker / Threads

2007-07-24 Thread Peter Ritchie
I was involved with that particular thread. What I had found was that setting the thread's principle was simply ignored when processing a winform event, at least the several I tried. Or, at least appears to be ignored. I figured something was restoring the state of the thread after each event han

Re: [ADVANCED-DOTNET] Question about the right way to use BackGroundWorker

2007-07-20 Thread Peter Ritchie
If you need to update the UI based on work being done in the BackgroundWorker's DoWork event handler, I recommend using the BackgroundWorker.ReportProgress method and handling the BackgroundWorker.ProgressChanged event. The ProgressChanged event is guaranteed to run on the UI thread (if the Backgr

Re: [ADVANCED-DOTNET] Question about the right way to use BackGroundWorker

2007-07-19 Thread Peter Ritchie
You can't. The default behaviour of BackgroundWorker is the raise the progress and completed events on the thread that created BackgroundWorker. If you block the thread until DoSomething returns the Completed and Progress event's will never get the thread need to raise them. You'd be deadlocked.

Re: [ADVANCED-DOTNET] Question about the right way to use BackGroundWorker

2007-07-19 Thread Peter Ritchie
In Arvinder's question, he's asking about the BackgroundWorker class. In order to use Join, you'd have to have a thread object. Ignoring the fact that the DoWork handler would have to get it's Thread object to the main UI, the framework uses a thread-pool thread for the DoWork event handler to ge

Re: [ADVANCED-DOTNET] Firewall and .NET 3

2007-07-18 Thread Peter Ritchie
The .NET 3.0 download page details how to download the full redistributable. Is that not what you want? === This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com

Re: [ADVANCED-DOTNET] C# Singleton; foot in mouth

2007-07-10 Thread Peter Ritchie
Of course another thread (that isn't blocked waiting to lock on the same object as the lock block )can see provider_, since no thread is blocked from accessing the Provider property like a static constructor is. The concern with that and the double-check lock is that the first if statement (if (pr

Re: [ADVANCED-DOTNET] C# Singleton; foot in mouth

2007-07-09 Thread Peter Ritchie
Yes, a processor may be doing more than caching, so "flushing cached writes" may be a bit simplistic in terms of what happens when Thread.MemoryBarrier is called. But, it only deals with ensuring what the processor may be doing, not with what the compiler is doing (or has done) with registers. i.

Re: [ADVANCED-DOTNET] C# Singleton; foot in mouth

2007-07-09 Thread Peter Ritchie
Which can be made moot by declaring appropriate members "volatile". I doubt the hyper-volatility Microsoft JITs would not add the memory barrier at the exit of the constructor. But, it would be nice to know what's it IS doing... On Mon, 9 Jul 2007 10:57:27 -0700, Greg Young <[EMAIL PROTECTED]> w

Re: [ADVANCED-DOTNET] C# Singleton; foot in mouth

2007-07-09 Thread Peter Ritchie
The Monitor.Exit generated by the lock statement has an implicit memory barrier that will flush the CPU write cache at the end of the lock block. Adding a MemoryBarrier after the assignment to "instance" only guarantees that cached writes up to that point are flushed to RAM. The only thing visibl

Re: [ADVANCED-DOTNET] Accessing files over HTTPS -> for Peter Ritchie

2007-07-09 Thread Peter Ritchie
Hi Eddie, I haven't done it; but (if you want to use WebClient) I believe you'll have to specialize WebClient and override the GetWebRequest method. If you've got an http[s] URL, the default should create an HttpWebRequest object (you'll have to cast from the WebRequest return from the base, i.e.

  1   2   3   4   >