Re: [ADVANCED-DOTNET] Accessing objects from a managed service

2004-04-29 Thread Andrew Hopper
Hi, Allen! Like the other fellow who replied to this, I'd use something like Remoting or (even better) the brand-spanking new WSE 2.0 SoapService. Unfortunately, WSE 2.0 has been in a RSN state for a couple of weeks so I don't know if we could use it for our stuff. If it does get released soon,

Re: [ADVANCED-DOTNET] Typed dataset: provide user-friendly column name

2004-03-26 Thread Andrew Hopper
Hello, Bar- You can add a typedName attribute to the column to change the displayed name, but it's really only meant to be used to provide a friendlier column name in the typed dataset. The name can't contain spaces, so it may not achieve what you want to do. If you still want to try it out, you

Re: [ADVANCED-DOTNET] COM Interop and freeing references

2004-03-24 Thread Andrew Hopper
This sounds like a job for System.Runtime.InteropServices.Marshal.ReleaseComObject! I'd recommend you use a try...finally pattern to ensure the COM objects always get released. Hope this helps! -Andy Hopper http://www.dotnetified.com - Original Message - From: Pandha Permjeet, Slough

Re: [ADVANCED-DOTNET] Java's dynamic proxy in .NET?

2004-03-22 Thread Andrew Hopper
Hi, Marek- Unfortunately, RealProxy is jst beyond your grasp - the docs state that applying the Proxy attribute to MarshalByRefObject is unsupported and SoapHttpClientProtocol inherits from MarshalByRefObject. I believe it's possible to accomplish it with a hack but it would anger the Gods of

Re: [ADVANCED-DOTNET] Web Services, Remoting and Coupling

2004-02-12 Thread Andrew Hopper
Quoth J. Merrill: I'm not going to assert that I've fully thought this through, but couldn't your shared assembly define an appropriate object class that has a constructor that accepts XML? (It might also have a SetState method that resets the state completely from XML, so you don't have to

Re: [ADVANCED-DOTNET] Web Services, Remoting and Coupling

2004-02-11 Thread Andrew Hopper
(Copied in part from my blog at http://www.dotnetified.com) NOTE: Let me preface this by saying that I want to believe. I really do want to learn the so-called right way to do things, but I do reserve the right to point out the emperor has no clothes if I feel it hampers my productivity... It

Re: [ADVANCED-DOTNET] Paged result sets using ADO.NET and SQL Server

2004-01-22 Thread Andrew Hopper
Here's my approach - basically, I lay it all on the SQL query optimizer. I've found it to be 5x faster than the fill a temp table along with an IDENTITY column, then select from the temp table approach on reasonably large ( 10,000 rows) tables. The temp table approach is faster when the result set

[ADVANCED-DOTNET] Client-side caching using a SOAP Extension?

2003-10-24 Thread Andrew Hopper
I just got asked an interesting question for which I have not been able to find an answer. Is it possible to write a SOAP extension that eliminates the round-trip to the server without having to modify the wsdl.exe-generated code? I know you can do this with custom Remoting channels and/or

Re: [ADVANCED-DOTNET] SoapExtensionImporter and asynchronous invocation

2003-10-20 Thread Andrew Hopper
Many thanks, Alex! Must've been a bug in the extension I was writing - I just did a from-scratch test project and it's working exactly as you described. -Andy - Original Message - From: Alex DeJarnatt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 17, 2003 8:06 PM Subject:

[ADVANCED-DOTNET] SoapExtensionImporter and asynchronous invocation

2003-10-17 Thread Andrew Hopper
I am attempting to write an importer for a SOAP extension so that my users can just use WSDL.exe or VS.NET's 'Add Web Reference' feature and have the necessary client-side SOAP extension attributes generated for them when the tool generates the client-side proxy. I've implemented the ImportMethod

Re: [ADVANCED-DOTNET] Querying across tables in a dataset

2003-07-01 Thread Andrew Hopper
See Microsoft KB Article 326080: HOW TO: Implement a DataSet JOIN helper class in Visual C# .NET -Andy Hopper - Original Message - From: D.J. Stachniak [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 3:51 PM Subject: [ADVANCED-DOTNET] Querying across tables in a

Re: [ADVANCED-DOTNET] Encapsulation and Serialization

2003-06-01 Thread Andrew Hopper
Well, if you are really committed to XML serialization, you can implement IXmlSerializable. Big flashing, honking warning though - it is undocumented and unsupported by Microsoft, so you could have the rug pulled out from underneath you in dotnetfx 2.0 (possible, but since DataSets use it, I'd be

Re: [ADVANCED-DOTNET] Service and Description attribute

2003-02-03 Thread Andrew Hopper
It's on its way. For any others who want to get at the source, I ask that you please hang on - I'm finishing up a new article for CodeProject that will have the source as well as a description of what the heck I'm doing. -Andy - Original Message - From: Marcel Gnoth [EMAIL PROTECTED] To:

Re: [ADVANCED-DOTNET] Service and Description attribute

2003-01-31 Thread Andrew Hopper
I wrote that article a while ago - I have since written a better implementation that uses P/Invoke to talk to the SCM rather than going behind its back and mucking around in the registry. Let me know if you would like to browse the source. -Andy Hopper - Original Message - From: Paulo

Re: [ADVANCED-DOTNET] Salt in PasswordDeriveBytes

2003-01-09 Thread Andrew Hopper
Gosh, that's being a bit harsh. He already admitted that it's not as secure as a random salt. While it's true that using a derived salt is not as secure as a random salt, it is definitely more secure than using no salt at all. With this approach, it is required that A) the black hat know your salt

Re: [ADVANCED-DOTNET] STAThread, COM interop and ASP.net

2002-12-02 Thread Andrew Hopper
Have you considered using the Microsoft.mshtml assembly instead? It provides all of the DOM functionality of the WebBrowser control without any of the threading issues (at least, none that I'm aware of...) Look in the Platform SDK for the MSHTML reference. -Andy Hopper - Original Message

Re: [ADVANCED-DOTNET] Complex (for me anyway) Marshalling

2002-10-24 Thread Andrew Hopper
Yeah, I figured you had a fairly good reason to build your own, but I had to ask. My personal opinion is that projects like this ought be written in managed C++ (it's much easier to play with pointers in C++) and use the MC++ library as a gateway between the managed and unmanaged worlds. That

Re: [ADVANCED-DOTNET] Complex (for me anyway) Marshalling

2002-10-23 Thread Andrew Hopper
I'll ask the obligatory why can't you use the objects in the System.DirectoryServices namespace? here. Now that we've gotten that out of the way... Passing structures that contain pointers to structures or arrays of structures between managed and unmanaged code generally requires either a custom

Re: [ADVANCED-DOTNET] FW: Interop: Handling OUT parameter of array, gets error Can not use SizeParamIndex for byref array parameters.??

2002-10-20 Thread Andrew Hopper
That is correct. The marshaler is going to trust you and the code you are calling to have allocated (and when the call is completed, to deallocate) whatever memory the call requires. All it knows is that you are telling it to pass the address of an array of IntPtr to the unmanaged code. It will

Re: [ADVANCED-DOTNET] FW: Interop: Handling OUT parameter of array, gets error Can not use SizeParamIndex for byref array parameters.??

2002-10-19 Thread Andrew Hopper
Thomas- If the value of size changed something went terribly wrong, and I wouldn't expect any code past the Next() call to work. I'd first try removing the int return value - without the PreserveSig attribute, the runtime will think the method has a fourth [out, retval] parameter. I'd also

Re: [ADVANCED-DOTNET] FW: Interop: Handling OUT parameter of array, gets error Can not use SizeParamIndex for byref array parameters.??

2002-10-14 Thread Andrew Hopper
Hello, Thomas- From what I understand, using the SizeParamIndex to marshal arrays only works for marshaling data from managed code into COM and will not work for out parameters. Due to this, I'm afraid you won't be able to use the default marshaling provided by the framework. However, you should

Re: [ADVANCED-DOTNET] FW: Interop: Handling OUT parameter of array, gets error Can not use SizeParamIndex for byref array parameters.??

2002-10-14 Thread Andrew Hopper
That might work using the approach that Mattias suggested (using SizeParamIndex and the first parameter instead of the third), but I simply don't know if the marshaler would behave properly. It certainly couldn't hurt to try. If it doesn't work, I'm fairly sure the approach I recommended will.

Re: [ADVANCED-DOTNET] Redeclaring COM interface return type - ??

2002-10-09 Thread Andrew Hopper
Correct. Simply remove the PreserveSigAttribute, and the HRESULT will automatically be checked. An exception will be thrown when a failure HRESULT is returned. This is incredibly convenient, but there are occasionally methods that return S_FALSE instead of S_OK to indicate a safe failure, in

Re: [ADVANCED-DOTNET] Redeclaring COM interface return type - ??

2002-10-09 Thread Andrew Hopper
- Original Message - From: Thomas Tomiczek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 09, 2002 12:56 PM Subject: Re: [ADVANCED-DOTNET] Redeclaring COM interface return type - ?? snip *** OK, so the trick is that was used to compile this has already the retval

[ADVANCED-DOTNET] Request for comments: My approach for supporting distributed transactions via .NET remoting

2002-09-05 Thread Andrew Hopper
I believe I have developed a workable solution for supporting distributed transactions over .NET remoting. The purpose behind this post was to make sure I didn't inadvertently duplicate someone else's work or take a wicked-bad wrong approach. Note: To anyone who is going to remind us that