Re: [ADVANCED-DOTNET] Understanding Events

2005-02-15 Thread Shawn A. Van Ness
In code review meetings, people often look at me funny when I come down so strongly against classes subscribing to their own events -- in lieu of simply overriding a corresponding virtual method. Let this be a lesson to you kids out there: more moving parts = more broken code. Thanks for the

Re: [ADVANCED-DOTNET] Understanding Events

2005-02-14 Thread Shawn A. Van Ness
[Editor's note: I just glanced at the code... forgive me if I'm missing something more subtle.] Event subscriptions are reachable references. The Form2 instances are subscribing to an event, but never unsubscribing... the event source is statically reachable. Some of us call this the lapsed

Re: [ADVANCED-DOTNET] Understanding Events

2005-02-14 Thread Shawn A. Van Ness
/blog -Original Message- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Shawn A. Van Ness Sent: Monday, February 14, 2005 3:20 PM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] Understanding Events [Editor's note

Re: [ADVANCED-DOTNET] How to change .net framework target

2005-02-09 Thread Shawn A. Van Ness
I'm not sure about targeting both 1.0 and 1.1 from VS.Net 2003 We do this in my shop... we use VS2k3, but we do our official builds w/ NAnt.exe -t:net-1.0, in at least two scenarios: (1) we build component SDKs, and we want the widest possible customer base, and (2) we make little powertoy

Re: [ADVANCED-DOTNET] How do I determine if an instance of a smart client is already up?

2005-02-01 Thread Shawn A. Van Ness
You need SecurityPermission.UnmanagedCode to acquire a named Mutex. This is sortof an unavoidable fact of life: otherwise, malicious controls could potentially interfere with other apps, by acquiring their Mutex(es). As hacky as it sounds, creating and/or locking a file in Isolated Storage might

Re: [ADVANCED-DOTNET] Determing time when a assembly was built

2005-01-28 Thread Shawn A. Van Ness
Fernando, that is the most obscure .NET development trick I've ever seen. You are either a genius, or a madman. -S === 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] Determing time when a assembly was built

2005-01-25 Thread Shawn A. Van Ness
Just use the 1.0.* syntax for the AssemblyVersion attribute -- decoding the low-order 32 bits is pretty easy. Here's a small JScript.NET program I wrote to do it... -S // // DecodeVer.js // import System; // Parse command line. var arg1:String = Environment.GetCommandLineArgs()[1]; var

Re: [ADVANCED-DOTNET] Determing time when a assembly was built

2005-01-25 Thread Shawn A. Van Ness
of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Shawn A. Van Ness Sent: 25 January 2005 17:25 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] Determing time when a assembly was built Don't you just love it when you get answers explaining exactly how

Re: [ADVANCED-DOTNET] Questioning FxCop: GC.KeepAlive(this)?

2005-01-17 Thread Shawn A. Van Ness
Thanks Jeroen! -S === This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com

[ADVANCED-DOTNET] Interop: Correct signature for IEnumXXXX::Next() methods?

2005-01-13 Thread Shawn A. Van Ness
I'm attempting a managed implementation of a COM interface, which enumerates structures... (The interface is ISyncMgrEnumItems, defined in MobSync.idl, for anyone who wants to play along.) Here's the relevant snippet of IDL: HRESULT Next( [in] ULONG celt, [out, size_is(celt),

Re: [ADVANCED-DOTNET] The down-level build blues...

2004-12-23 Thread Shawn A. Van Ness
/obsolete resources), easily localized, and run down-level without a hitch. http://www.windojitsu.com/blog/resxsucks.html Thanks again, everyone... Happy Holidays! -S On Wed, 1 Dec 2004 16:12:36 -0800, Shawn A. Van Ness [EMAIL PROTECTED] wrote: The vs.net project converter seems to do

Re: [ADVANCED-DOTNET] COM interoperability, coclass's, AssemblyVersion.

2004-12-13 Thread Shawn A. Van Ness
What is the advantage of having autogenerated CLSID's, my observation is that they causes trouble when unregistering assemblies used with COM interop. Of course that causes trouble -- if your CLSID changes with every build, your COM clients will have a hard time keeping up! Here's the deal...

Re: [ADVANCED-DOTNET] Relative X-Path

2004-12-08 Thread Shawn A. Van Ness
It's sortof like specifying absolute vs relative paths to files... don't lead off with the leading slash -- that means absolute, not relative! XmlNodeList MarketNodes = policyNode.SelectNodes(policy-criterion); or XmlNodeList MarketNodes = policyNode.SelectNodes(./policy-criterion); -S

Re: [ADVANCED-DOTNET] QA Process - Automating a Production Mirror

2004-12-08 Thread Shawn A. Van Ness
Sounds like Virtual Server will get you what you need...? http://www.microsoft.com/windowsserversystem/virtualserver/default.mspx -S === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be interested in: Essential .NET:

Re: [ADVANCED-DOTNET] QA Process - Automating a Production Mirror

2004-12-08 Thread Shawn A. Van Ness
... g -S On Wed, 8 Dec 2004 23:07:27 -0800, Shawn A. Van Ness [EMAIL PROTECTED] wrote: Sounds like Virtual Server will get you what you need...? http://www.microsoft.com/windowsserversystem/virtualserver/default.mspx -S === This list is hosted by DevelopMentor

Re: [ADVANCED-DOTNET] Regsvr32 replacement

2004-12-07 Thread Shawn A. Van Ness
Hi Alex, I'm not an MVP, but I wrote a little regsvr32 replacement, many moons ago... http://www.windojitsu.com/tech/reggie.html HTH... Anyone got any problems with regasm they want fixed? g -S On Tue, 7 Dec 2004 08:37:23 -0600, Alex Niblett [EMAIL PROTECTED] wrote: I remember seeing a

Re: [ADVANCED-DOTNET] Best way in VS.Net build to run the assebly linker utility to create publisher policy assembly

2004-12-02 Thread Shawn A. Van Ness
What's wrong with an ordinary VS2003 post-build step? Some tips: 1) use the $(DevEnvDir) parameter to avoid hardcoding a path to vsvars32.bat; 2) use the 'call' command to reference that batch file -- recognizing that everything you type into that post-build event window is going to get

Re: [ADVANCED-DOTNET] The down-level build blues...

2004-12-01 Thread Shawn A. Van Ness
Thanks for all the extra data points, guys. I'm seeing blog entries like this, which strongly imply MSBuild won't target v1.1 (let alone v1.0) out of the box... http://blogs.msdn.com/jomo_fisher/archive/2004/10/01/236879.aspx But even Robert McLaws' extension of this work doesn't get into the

Re: [ADVANCED-DOTNET] The down-level build blues...

2004-12-01 Thread Shawn A. Van Ness
Sure enough, as I've been racking my brain over this, a new build of NAnt (0.85 RC1) has been released. And the solution task doesn't crash on me the way it did in 0.84... I will give this a try, and report back when I do some clean-box testing on a machine with v1.0 only. Nope, it's just

Re: [ADVANCED-DOTNET] The down-level build blues...

2004-12-01 Thread Shawn A. Van Ness
The vs.net project converter seems to do that though. Perhaps you can use that one (I mentioned the url in my email). Yep, apparently it does! Thanks for that tip, Frans. IMHO this is the scariest google search I've ever seen. (Click at your own risk... ;-)

[ADVANCED-DOTNET] The down-level build blues...

2004-11-30 Thread Shawn A. Van Ness
Visual Studio .NET doesn't support the ability to build against any version of the framework other than the one it simul-shipped with. (Don't talk to me about the supported runtimes project property -- that option doesn't exist at all for library assemblies -- it's just an app.config hack, and

Re: [ADVANCED-DOTNET] The down-level build blues...

2004-11-30 Thread Shawn A. Van Ness
Sure enough, as I've been racking my brain over this, a new build of NAnt (0.85 RC1) has been released. And the solution task doesn't crash on me the way it did in 0.84... I will give this a try, and report back when I do some clean-box testing on a machine with v1.0 only. -S On Tue, 30 Nov

Re: [ADVANCED-DOTNET] Methods Calls on value types

2004-11-26 Thread Shawn A. Van Ness
question with patience Happy thakns giving, everyone Regards, Girish Jain From: Shawn A. Van Ness [EMAIL PROTECTED] Reply-To: Unmoderated discussion of advanced .NET topics. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Methods Calls on value types Date: Thu, 25 Nov

Re: [ADVANCED-DOTNET] Methods Calls on value types

2004-11-25 Thread Shawn A. Van Ness
forgot the very basic thing - to ask my specific question. My question was (It may sound dumb!) : Why the value type instance was not boxed in the supplied code ? Regards, Girish Jain - Original Message - From: Shawn A. Van Ness [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent

Re: [ADVANCED-DOTNET] Methods Calls on value types

2004-11-23 Thread Shawn A. Van Ness
IL_0002: ldloca.s V_0 // Load local variable address on to the stack Sounds like you understand, just fine. The CPU pushes the address of the valuetype onto the stack, before making the function call. That's a pointer, on the stack, *to* something else on the stack (but

Re: [ADVANCED-DOTNET] Library interface for unsigned types VB.NET

2004-11-22 Thread Shawn A. Van Ness
I do not use VB and somewhat missed the fact that it does not directly support unsigned types Although you may have painted yourself into a corner with your current project (if you've already shipped it) adding the [CLSCompliant(true)] attribute to your library assemblies, in the future, will

Re: [ADVANCED-DOTNET] Library interface for unsigned types VB.NET

2004-11-22 Thread Shawn A. Van Ness
D'oh! Sorry, I missed that this was MC++. Too bad, that language probably needs the guidance of CLSCompliant(true) more than any other... -S On Mon, 22 Nov 2004 12:47:26 +0100, Marek Malowidzki [EMAIL PROTECTED] wrote: I do not use VB and somewhat missed the fact that it does not

Re: [ADVANCED-DOTNET] Library interface for unsigned types VB.NET

2004-11-22 Thread Shawn A. Van Ness
uint a = 10; uint b = 11; uint c = a - b; // whoops You must switch c to a signed int, to get the right result. In this example its easy to see, but IRL coding the above might not be that I don't get it. On my system, both int and uint produce c == 0x. There are no separate

Re: [ADVANCED-DOTNET] XML public property and constructor serialization issues.

2004-11-18 Thread Shawn A. Van Ness
I advise people to give up bending their business object models to work with XmlSerializer. The constraints are pretty heavy... http://www.windojitsu.com/blog/zenandtheartofxmlserializer.html In addition to the need for public default ctors and public visibility on all serializable fields,

Re: [ADVANCED-DOTNET] Depending on what your definition of is is...

2004-10-28 Thread Shawn A. Van Ness
D'oh! Good catch, Marek. -S === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be interested in: Essential .NET: building applications and components with C# November 29 - December 3, in Los Angeles

Re: [ADVANCED-DOTNET] Depending on what your definition of is is...

2004-10-27 Thread Shawn A. Van Ness
if (parameters[0].ParameterType == typeof(System.Xml.XmlNode)) -S On Wed, 27 Oct 2004 15:34:11 -0400, Jekke Bladt [EMAIL PROTECTED] wrote: I've been thinking along those lines. If that's the case, how would I check for whether or not the Type returned represents XmlNode? --Jekke

Re: [ADVANCED-DOTNET] OT: UI design question

2004-10-27 Thread Shawn A. Van Ness
This post is indeed OT, but worst of all, I can't even tell if it's a web or winforms question... g If the latter -- consider authoring a custom control with better usability than what clusters of stock controls can offer. If the former -- well, this is why everyone hates using HTML-based app

Re: [ADVANCED-DOTNET] Getting XML out of a memory stream.

2004-10-26 Thread Shawn A. Van Ness
If the XML is very large, converting it to a string (by way of a UTF8 byte array) will involve a couple of large memcpy operations -- or worse. In the general case, I think it would be better to rewind the MemoryStream and use XmlTextReader... -S On Tue, 26 Oct 2004 12:08:03 -0600, Steve

Re: [ADVANCED-DOTNET] Unmanaged DLL authentication

2004-10-19 Thread Shawn A. Van Ness
Authenticode? -S === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be interested in: Essential .NET: building applications and components with CSharp August 30 - September 3, in Los Angeles

Re: [ADVANCED-DOTNET] VB6 Interop

2004-10-15 Thread Shawn A. Van Ness
Why not simply build your VB6 control w/ binary compat? This is not a .NET problem -- it's what folks had to do to make VB6 controls work with ordinary COM clients. -S === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be

Re: [ADVANCED-DOTNET] Strategy for large canvas app (a la Visio)?

2004-09-15 Thread Shawn A. Van Ness
Hi Larry, Firstly: there's a fairly active Tablet dev newsgroup [1] where you might want to cross-post this question. But I think you'll find that most of us there will agree w/ people here, in that you want one big canvas. *Especially* if your aim is to attach InkCollector or InkOverlay

Re: [ADVANCED-DOTNET] .NET-.NET interprocess methods (COM?)

2004-09-10 Thread Shawn A. Van Ness
Last year, I undertook a tour of various IPC methods available to .NET apps, in this article: http://www.wd-mag.com/documents/win0312a/ The short of it is this: the TCP remoting channel is just awful for IPC. The problem is not the massive overhead, but the huge security hole it would open in

Re: [ADVANCED-DOTNET] .NET vs Windows SP versioning?

2004-08-23 Thread Shawn A. Van Ness
Wow, thanks for the responses everyone. (Especially Jekke, for the line about decaf.. rotfl!) I'm glad to know I'm not the only one who's a bit confused... g I can add a little info to this thread, myself: I installed SP2 from the ISO cd image, but I already had the v1.0sp2 and v1.1 CLRs on all

Re: [ADVANCED-DOTNET] .NET vs Windows SP versioning?

2004-08-23 Thread Shawn A. Van Ness
Who comprises your target installation base? I do a lot of research dev for Tablet PC. The improvements to the Tablet PC experience w/ SP2 are *huge*, definitely not the kind of thing you expect of a SP, more like a major rev (or two or three). It would not be out of the question to require

[ADVANCED-DOTNET] .NET vs Windows SP versioning?

2004-08-22 Thread Shawn A. Van Ness
Two simple questions for which I should know the answer, but don't: Does XP SP2 include the .NET framework? If so, what version(s)? Does it include any bits from the upcoming .NET service packs [1]? [1] http://msdn.microsoft.com/netframework/downloads/updates/sptechpreview/ I've heard varying

Re: [ADVANCED-DOTNET] ILASM support lib

2004-08-05 Thread Shawn A. Van Ness
Reflection.Emit is not perfect, but it's close. It's used to implement the JScript .NET compiler, if I understand correctly. http://msdn.microsoft.com/library/en- us/cpref/html/frlrfsystemreflectionemit.asp http://www.windevnet.com/documents/win0208c/ Advice: search the archives here, and in

Re: [ADVANCED-DOTNET] How to use an XML file as an embedded resource

2004-08-05 Thread Shawn A. Van Ness
http://msdn.microsoft.com/library/en- us/cpref/html/frlrfsystemreflectionassemblyclassgetmanifestresourcestreamtop ic1.asp === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be interested in: Essential .NET: building

[ADVANCED-DOTNET] Ping, please ignore...

2004-08-04 Thread Shawn A. Van Ness
Is this list dead? No post in over a week? -S === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be interested in: Error in line 15 of ADVANCED-DOTNET.MAILTPL: unknown formatting command - .NET Architecture and Design:

Re: [ADVANCED-DOTNET] Threading, UI, and web service problem [UPD ATE]

2004-07-21 Thread Shawn A. Van Ness
Seriously, keep us posted. If you do indeed find that some innocuous part of the framework is indeed pumping messages, unbeknownst to the community... well, that's invaluable information. Some tips to investigate this: 1) See if you can get a stack trace from the exception, to pinpoint the

Re: [ADVANCED-DOTNET] Debugging compiled CodeDom code

2004-07-14 Thread Shawn A. Van Ness
I am also interested in this -- it's been a while since I tried, but I remember having the same problem when I developed my X-Code .NET template compiler (using JScriptCodeProvider, not CSharp, but hey)... I never got a good debugging experience w/ CompilerParameters.GenerateInMemory set to true.

Re: [ADVANCED-DOTNET] How to change Assembly Version programmatically.

2004-07-13 Thread Shawn A. Van Ness
I don't like the idea of writing special-case tools to perform such basic codegen. In this old blog article, I show how I use an X-Code .NET template to emit an AssemblyVersion.cs file based on the current datetime. (Scroll down, past the rant about version-incrementing. :)

Re: [ADVANCED-DOTNET] Another twist to dll hell

2004-05-22 Thread Shawn A. Van Ness
A. Van Ness wrote: My advice to component vendors of the world: build your dll assemblies against the earliest version of the runtime you care to support. Exactly! I have a 1.0 component written in MC++ and I do this too (even though this is very painful, because the MC++ 1.0 compiler is so

Re: [ADVANCED-DOTNET] Large structures

2004-05-22 Thread Shawn A. Van Ness
Right, Srihari. If you go back and read the thread from the top (it's very long, now, you can be forgiven :) you'll see this has been our driving assumption -- that the JIT compiler would have to do some static analysis on the call-tree, to ensure that the struct's members are accessed in a

Re: [ADVANCED-DOTNET] Another twist to dll hell

2004-05-21 Thread Shawn A. Van Ness
I'm really surprised more folks haven't run into this. My advice to component vendors of the world: build your dll assemblies against the earliest version of the runtime you care to support. Nevermind that VS2k3 does not readily support this -- back-install the v1.0 Fx SDK, and build from the

Re: [ADVANCED-DOTNET] Visibility of an array type and the element type

2004-05-16 Thread Shawn A. Van Ness
- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Shawn A. Van Ness Sent: Sunday, May 16, 2004 06:40 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Visibility of an array type and the element type At run-time, there is no such type

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Shawn A. Van Ness
This seems like a big waste of time Arlie, are you concerned more about the time (ie, the memcpy operation) or excess growth of the stack (eg, in recursive scenarios)? Or both? I don't have the managed dx sdk handy -- is their Matrix really a valuetype? In System.Drawing.Drawing2D, it's a

Re: [ADVANCED-DOTNET] Visibility of an array type and the element type

2004-05-15 Thread Shawn A. Van Ness
At run-time, there is no such type as SomeClass[]. There is only System.Array -- and that type is, indeed, public. System.Array is a special type, in that it has what they call element type -- meaning that it's a type composed of (or referring to) some other type (in this case, SomeClass). Make

Re: [ADVANCED-DOTNET] Compiled Regular Expressions

2004-05-01 Thread Shawn A. Van Ness
them together into one assembly. I'm uninformed about how system.web.regularexpressions.dll is created. Eric -Original Message- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Shawn A. Van Ness Sent: Thursday, April 29, 2004 9:49 PM To: [EMAIL

Re: [ADVANCED-DOTNET] Compiled Regular Expressions

2004-04-29 Thread Shawn A. Van Ness
Eric, Do you know if MS has any plans to release a standalone regex compiler tool, in any upcoming SDK -- to allow us to precompile regexes that we know will be commonly used in our app...? (Clearly, some such tool was used to create System.Web.RegularExpressions.dll. :) But AFAICT none of the

Re: [ADVANCED-DOTNET] Using a common form for web and windows-based application.

2004-04-20 Thread Shawn A. Van Ness
Or vice versa, host a .NET UserControl in the HTML... (I mention only for the sake of completeness -- and because I just accidentally replied to the cross-post on dotnet-winforms... please don't do that, Vince.) http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx Just how great

Re: [ADVANCED-DOTNET] Exceptions in Constructors

2004-04-09 Thread Shawn A. Van Ness
Can't something like this VB.NET code guarantee that there is no exception raised in a Finally block: Kinda... but you don't want to silently swallow those exceptions, though. You might be masking a serious problem -- and you'd never know about it! The argument we're beating around is this:

Re: [ADVANCED-DOTNET] Exceptions in Constructors

2004-04-05 Thread Shawn A. Van Ness
Wow, great point, John! -S On Sun, 4 Apr 2004 22:53:36 +1000, John Elliot [EMAIL PROTECTED] wrote: Since you can't propagate two exceptions at the same time, Ironically .NET does offer us a way to propagate multiple exceptions -- the InnerException property gives each exception the potential,

Re: [ADVANCED-DOTNET] Exceptions in Constructors

2004-04-02 Thread Shawn A. Van Ness
Huh? Isn't that the idea, Adam -- that 'a' remains null? It would be awful if 'a' came away from that in some not-null, ambiguous, partially-constructed state. Right? (That was the problem with C++, which the original poster alluded to.) At the IL level, the instantiation of A (newobj) and

Re: [ADVANCED-DOTNET] Serialization Question

2004-04-02 Thread Shawn A. Van Ness
Have you tried to [XmlIgnore] the actual DateTime member, and serialize a string rep instead? This is what a lot of us do anyway, in order to control the formatting... I believe null string fields aren't serialized, so it'd be good for that too.

Re: [ADVANCED-DOTNET] Exceptions in Constructors

2004-04-02 Thread Shawn A. Van Ness
Interesting point Rick, I haven't heard anybody bring this issue up before. This is turning into a great thread, in general. Two questions/comments: (i.e. it does not terminate the finalizer thread, future finalizations still happen). I'm not sure this is true for StackOverflowException. I

Re: [ADVANCED-DOTNET] Exceptions in Constructors

2004-04-01 Thread Shawn A. Van Ness
Exceptions in unmanaged C++ were totally broken, for several reasons... They are far less broken, in .NET... yes, by all means, throw! But don't go overboard with them. Throw statements are still rather expensive, performance-wise. Cheers, -Shawn http://www.windojitsu.com/ -Original

Re: [ADVANCED-DOTNET] Multiple Ports and Remoting

2004-03-23 Thread Shawn A. Van Ness
Is it only for that process? Yes, of course. Else, how else would your computer know what to do with an incoming TCP/IP connection request for port 8080? Query all the processes running on the machine to see which are interested? Pick one at random to handle it? No, of course only one

Re: [ADVANCED-DOTNET] Programming With Sockets

2004-03-03 Thread Shawn A. Van Ness
.NET makes this easier than it's ever been... search for NetworkStream, TcpClient, and/or TcpListener. Plenty of examples. Is there something specific we can help you with? -S === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-29 Thread Shawn A. Van Ness
Hi John, I think either you're over-analyzing this, or the problem is in fact much bigger than MVC. :) Let's forget about MVC for a moment, and consider a much more common scenario: WM_PAINT. Do the View objects know how to render themselves, without asking anything of the Document? Probably

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-27 Thread Shawn A. Van Ness
of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Shawn A. Van Ness Sent: Tuesday, 24 February 2004 7:20 PM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) Jade, I feel your pain. But I think if you really followed it through -- as you say, starting from

Re: [ADVANCED-DOTNET] C++ native threads and .NET messaging

2004-02-25 Thread Shawn A. Van Ness
Sure, I don't see why not -- just smuggle the winform thread id to your unmanaged api somehow, and install a message filter (Application.AddMessageFilter) on your winforms ui thread, to receive the postbacks... no big deal. (Disclaimer: I've never actually tried this; maybe there's some catch in

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-24 Thread Shawn A. Van Ness
?) Or are we stuck with what I would regard as a system that requires the programmer to write (and - ugh - think about) non-business logic plumbing code... Jade Burton -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Shawn A. Van

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-21 Thread Shawn A. Van Ness
Call Application.Run (or even Application.DoEvents) do establish a message queue for your secondary thread. A better answer: You should not be performing any long-blocking operations on your main UI thread. This rule goes right up there alongside thread that creates the window services the

Re: [ADVANCED-DOTNET] What happened to stream CopyTo?

2004-02-19 Thread Shawn A. Van Ness
= src; pump.OutboundStream = dst; pump.Start(); if (wait) pump.DoneSignal.WaitOne(); return; } } -Original Message- From: Shawn A. Van Ness [mailto:[EMAIL PROTECTED] Sent: Thursday, February

Re: [ADVANCED-DOTNET] Calling managed C++ code from an unmanaged MFC app

2004-02-13 Thread Shawn A. Van Ness
Beats me, Pete -- I'm just an idea man. Try it out, and let us know how you fare... But if you're worried about its undocumented nature, go ahead and write the eextra few lines of code to call CorBindToRuntimeEx, AppDomain.CreateInstance, etc. Same thing, pretty much -- no COM registry lookups.

Re: [ADVANCED-DOTNET] Calling managed C++ code from an unmanaged MFC app

2004-02-09 Thread Shawn A. Van Ness
I don't know what your immediate problem might be -- even trivial MC++ build problems make my head swim -- but have you considered skipping the middleman (COM Interop) and simply hosting the CLR in your MFC app, yourself? It's far, far easier than it sounds. Like, less than a dozen lines of

Re: [ADVANCED-DOTNET] Remoting an object that inherits from class

2004-01-29 Thread Shawn A. Van Ness
Does this thread enlighten? -S http://discuss.develop.com/archives/wa.exe?A2=ind0401DL=DOTNET- WINFORMSP=R2314 On Wed, 28 Jan 2004 06:37:02 -0500, Bill Bassler [EMAIL PROTECTED] wrote: What are the high-level steps/requirements to remote an object that already inherits from another class?

Re: [ADVANCED-DOTNET] Registry cleaning in the .NET era

2004-01-17 Thread Shawn A. Van Ness
I used to micromanage my registry, back when it was consuming valueable space in the paged pool... as of XP, the registry is mapped in chunks, just like any other file (or database, for that matter). http://support.microsoft.com/default.aspx?scid=292726 These days, I don't notice regclean-esque

Re: [ADVANCED-DOTNET] security (data filtering)

2004-01-17 Thread Shawn A. Van Ness
.NET has a pretty straightforward api for role-based security, complete with somewhat AOPish declarative security checks (by attaching attributes to classes or methods). [PrincipalPermission(SecurityAction.Demand, Role = Manager)] public string GetSecretInfo() { return The brown fox

Re: [ADVANCED-DOTNET] Remoting WaitHandle objects

2004-01-13 Thread Shawn A. Van Ness
Are you guys sure? WaitHandle is a MarshalByRefObject. Won't the long-running server's attempt to check the state of the event -- via occassional calls to WaitHandle.WaitOne(0) -- effectively be callbacks to the client appdomain? -S === This list is hosted by

Re: [ADVANCED-DOTNET] Best way to share an interface definition amoung components tier

2004-01-10 Thread Shawn A. Van Ness
I'll just add that I think a lot of folks *are* doing this... you just don't see much of this practice in the world of sample code, magazine articles, etc, because it's just too much extra typing, or extra complexity distracting from the topic at hand, perhaps. You do see it, from time to time,

Re: [ADVANCED-DOTNET] get word docs from sql server

2003-12-17 Thread Shawn A. Van Ness
Is this a SQL question, or an ASP question? If the latter, then I'd say this is a bit of a FAQ. Search for something like this, on dotnet-web: Response.AddHeader(Content-Disposition,attachment;filename=myfile.doc); But perhaps I'm misunderstanding what SQL problems you're having...? Cheers,

Re: [ADVANCED-DOTNET] Transfering large data via remoting

2003-12-03 Thread Shawn A. Van Ness
' -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:ADVANCED- [EMAIL PROTECTED] On Behalf Of Shawn A. Van Ness Sent: 28 November 2003 20:56 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Transfering large data via remoting It's interesting to consider why

Re: [ADVANCED-DOTNET] Transfering large data via remoting

2003-11-29 Thread Shawn A. Van Ness
It's interesting to consider why fragmenting would make your system faster -- I haven't tried it; I'll take your word for it. At the end of the day, the same amount of bits are transmitted in either case (actually, fragmenting will have to transfer more). Could it be all the large-block heap

Re: [ADVANCED-DOTNET] How to comunicate from .NET with an older C++ library?

2003-11-18 Thread Shawn A. Van Ness
I never touched COM+ with any length of pole... the sheer complexity scared me off. I don't know if that gives me any more credibility than Don, but I'll pick up his slack and be openly derisive of Remoting too. ;-) 1) There is no safe, robust out-the-box remoting channel appropriate for IPC.

Re: [ADVANCED-DOTNET] How to comunicate from .NET with an older C++ library?

2003-11-18 Thread Shawn A. Van Ness
Hi Stoyan, This thread is (was? ;) about IPC. Most of the features you and Kamen are longing for in Indigo aren't quite as relevant for simple IPC... My advice to the original poster stands: grab a shared-source wrapper for shared memory, and use that to marshal data back and forth between

Re: [ADVANCED-DOTNET] How to comunicate from .NET with an older C++ library?

2003-11-17 Thread Shawn A. Van Ness
Hi Burkhard, Is my assumption I need a seperate process for the C++ library to inhibit a potential crash of my .NET client correct? Yes. If yes: I'm not sure wether mail slots are the right decision regarding stability and performance. Mailslots are not a good option to consider; most

Re: [ADVANCED-DOTNET] Security Question: SSPI to validate user?

2003-11-03 Thread Shawn A. Van Ness
What does this have to do with .NET? I don't mean to be mean, but... Go to www.google.com, enter logonuser sspi validate credentials and click the I'm Feeling Lucky button. You'll find an MSKB article with full C code for doing this, complete with support for downlevel OSes' variances in

Re: [ADVANCED-DOTNET] Unanswered - Mail Merging within an application - best approach?

2003-10-07 Thread Shawn A. Van Ness
If you're averse to XSLT (hard to debug, interop-challenged, unreasonably difficult to implement procedural logic, etc) you should check out some of the ASP-style codegen/template languages out there... like Eric Smith's CodeSmith tool, or my X-Code .NET tool. Both freeware.

[ADVANCED-DOTNET] Bug in SaveFileDialog.OverwritePrompt?

2003-07-14 Thread Shawn A. Van Ness
. Crazier things have happened... you never know. -S - Original Message - From: Shawn A. Van Ness [EMAIL PROTECTED] Sent: Friday, July 04, 2003 06:39 Subject: Bug in SaveFileDialog.OverwritePrompt? .NET v1.1... When SaveFileDialog.OverwritePrompt is set to true (the default

Re: [ADVANCED-DOTNET] Mensa workout: constructing magic-value IntPtr arguments for p/invoke on IA64

2003-04-06 Thread Shawn A. Van Ness
on IA64. -S On Thu, 3 Apr 2003 10:59:30 +0200, Jeroen Frijters [EMAIL PROTECTED] wrote: Shawn A. Van Ness wrote: Another question. Aren't these KEYS provided to you as enum? I'm needing to p/invoke the actual Win32 functions -- not using the Microsoft.Win32.RegistryKey stuff. I seriously doubt

Re: [ADVANCED-DOTNET] Mensa workout: constructing magic-value IntPtr arguments for p/invoke on IA64

2003-04-02 Thread Shawn A. Van Ness
Thanks Mattias -- you make a pretty strong case for option C, but I'm just not sure I'll feel 100% comfortable until somebody actually calls RegOpenKey on an IA64 machine, for me. ;) -S On Wed, 2 Apr 2003 20:59:56 +0200, Mattias =?iso-8859-1?Q?Sj=F6gren?= [EMAIL PROTECTED] wrote: Shawn,

Re: [ADVANCED-DOTNET] Mensa workout: constructing magic-value IntPtr arguments for p/invoke on IA64

2003-04-02 Thread Shawn A. Van Ness
an assumption...a reasonable one, I think. So, those are my thoughts. -akshay -Original Message- From: Shawn A. Van Ness [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 3:31 PM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Mensa workout: constructing magic-value IntPtr arguments

[ADVANCED-DOTNET] VS.NET: Adding controls to the Toolbox, programmatically

2003-03-18 Thread Shawn A. Van Ness
I'm trying to write some custom setup-code to add a few usercontrols to the Toolbox. Using the automation interface (the EnvDTE stuff), I can create a new ToolboxTab ok, and I can add text items, but I can't seem to figure out the magic combination of parameters to add a .NET usercontrol.

Re: [ADVANCED-DOTNET] Remoting: What is everybody doing for simple, robust, secure, efficient IPC?

2003-01-24 Thread Shawn A. Van Ness
is the example you might be looking for [1]... HTH scott [1]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwi nforms/html/reaworapps1.asp -Original Message- From: Shawn A. Van Ness [mailto:[EMAIL PROTECTED]] Sent: Monday, January 20, 2003 2:12 PM To: [EMAIL PROTECTED

Re: [ADVANCED-DOTNET] Remoting: What is everybody doing for simple, robust, secure, efficient IPC?

2003-01-20 Thread Shawn A. Van Ness
I feel perhaps I'm not making my #1 complaint clear: if I open up a *well-known* TCP port, even if it's just on the loopback adapter or whatever, my app will break under Terminal Services (eg: Remote Desktop, and Fast User Switching). I'd like for my app to not crash or choke, just because my

Re: [ADVANCED-DOTNET] Remoting: What is everybody doing for simple, robust, secure, efficient IPC?

2003-01-19 Thread Shawn A. Van Ness
Maybe... but I'd prefer a true local-only solution, so that I don't have to endure the security liability of listening on a network endpoint. I can't believe .NET is leading so many folks to use TCP for what would be interprocess comm purposes... scares the heck out of me, quite frankly. -S

Re: [ADVANCED-DOTNET] Remoting: What is everybody doing for simple, robust, secure, efficient IPC?

2003-01-17 Thread Shawn A. Van Ness
? In the early days of the .NET betas more than one person wrapped the win32 API to provide managed access. Regards Richard Blewett DevelopMentor -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED]] On Behalf Of Shawn A. Van Ness Sent: 16 January

Re: [ADVANCED-DOTNET] Performance: castclass vs. isinst?

2003-01-11 Thread Shawn A. Van Ness
- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED]] On Behalf Of Shawn A. Van Ness Sent: Thursday, January 09, 2003 22:29 To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Performance: castclass vs. isinst? Which is faster? For arrays, do both castclass and isinst

[ADVANCED-DOTNET] Performance: castclass vs. isinst?

2003-01-10 Thread Shawn A. Van Ness
Which is faster? For arrays, do both castclass and isinst have to walk the list of elements, checking each one? I find I never know when to write string[] foo = (string[])arraylist.ToArray(typeof(string)); // castclass vs string[] foo = arraylist.ToArray(typeof(string)) as

Re: [ADVANCED-DOTNET] Copying files when building projects

2002-12-19 Thread Shawn A. Van Ness
The sample project accompanying my NDoc article [1] includes a VC++ makefile project which copies some files around, post-build, in order to feed NDoc. [1] http://www.oreillynet.com/cs/user/view/cs_msg/12137 I'm sure you can figure out the VC++ makefile trick yourself, Ben. But if you want a

Re: [ADVANCED-DOTNET] AppDomain.DoCallback(CrossAppDomainDelegate) bug?

2002-12-17 Thread Shawn A. Van Ness
-Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED]]On Behalf Of Shawn A. Van Ness Sent: Sunday, December 15, 2002 12:59 AM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] AppDomain.DoCallback(CrossAppDomainDelegate) bug? v1.0.3705

[ADVANCED-DOTNET] AppDomain.DoCallback(CrossAppDomainDelegate) bug?

2002-12-15 Thread Shawn A. Van Ness
v1.0.3705... I just tried sending a delegate, bound to a serializable/mbv instance, to AppDomain.DoCallback. I was surprised to find that my object was only transmitted [in] to the secondary appdomain, not [in,out]. Is there no way to return any info from AppDomain.DoCallback (w/o having Foo

[ADVANCED-DOTNET] IEExec vs. AppDomain.ExecuteAssembly

2002-12-11 Thread Shawn A. Van Ness
What, if anything, does IEExec.exe do differently than this? static void Main( string[] args) { AppDomain.CurrentDomain.ExecuteAssembly(args[0]); } I played around w/ various CAS and IE zone-settings for a few minutes, and got pretty much identical results. Am I missing

Re: [ADVANCED-DOTNET] IEExec vs. AppDomain.ExecuteAssembly

2002-12-11 Thread Shawn A. Van Ness
Using Anakrino on ieexec.exe reveals this: Thanks Frederic (but I know how to read the ILDASM output just fine :). What does it all mean? Is this ~1000 lines goo all for the sake of hooking up DLL controls w/in IE? For the EXE case (which is what I'm currently interested in -- sorry I

  1   2   >