[ADVANCED-DOTNET] How to identify a COM DLL as being managed...

2003-12-03 Thread Andrew Cherry
I'm trying to plan a separate mechanism for extending an existing COM add-in architecture so that at run time a separate code branch can be taken if a desired COM object is managed rather than unmanaged. I know that mscoree.dll is listed for managed dlls, but is there any other way to determine

Re: [ADVANCED-DOTNET] C++ Dll Import Callback Function Question

2003-12-03 Thread Simon Fell
On Wed, 3 Dec 2003 15:51:28 -0600, Martin H. Henderson <[EMAIL PROTECTED]> wrote: >Ok, in an effort to discover WTF... I added a couple of void Callback >functions to my c++ dll and I can get one of the void call backs to actually >work in the c# application. However the wrong void callback is b

Re: [ADVANCED-DOTNET] Serializable and Construction

2003-12-03 Thread J. Merrill
At 02:53 PM 12/3/2003, Fabian Schmied wrote (in part) >> A related issue -- are you implementing "copy on write" semantics [snip] > >Unfortunately, I haven't implemented copy-on-write semantics in any project >so far, although I think it is a very powerful concept. However, I remember >there is a

Re: [ADVANCED-DOTNET] C++ Dll Import Callback Function Question

2003-12-03 Thread Martin H. Henderson
It was the calling convention that had the application acting bizzarre. After decorating the c++ callbacks with __stdcall the void callbacks worked as expected. Changing the c# delegate to use all IntPtr for the c++ char* callback worked as well. Now I am just down to figuring out how to correctl

Re: [ADVANCED-DOTNET] C++ Dll Import Callback Function Question

2003-12-03 Thread Martin H. Henderson
Ok, in an effort to discover WTF... I added a couple of void Callback functions to my c++ dll and I can get one of the void call backs to actually work in the c# application. However the wrong void callback is being called. What gives? Are the function pointers getting touched/changed by the GC

Re: [ADVANCED-DOTNET] C++ Dll Import Callback Function Question

2003-12-03 Thread Arlie Davis
> This interop stuff is not as easy as they claim it to be. No one said it's trivial. And you're trying to use one of the more abstruse cases -- invocation of managed delegates from unmanaged code. You still need to step through the assembly, to see exactly what is happening. The unmanaged C++

Re: [ADVANCED-DOTNET] Extending VS.NET2002 with Wizards - Web Services

2003-12-03 Thread Adam Friedman
What you're probably looking for is EnvDTE.Project.AddFromTemplate(templateProjectFile, targetUrl); Where targetUrl is http://server/ProjectVDir/ProjectFile.csproj -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Stren

Re: [ADVANCED-DOTNET] C++ Dll Import Callback Function Question

2003-12-03 Thread Martin H. Henderson
I get no exceptions, the callback is simply never called. FYI, this works fine from a c++ app so the DLL and the callback mechanism are fine. I just can't get it to work with c#. This interop stuff is not as easy as they claim it to be. // c++ dll exported prototype void fnCPPFunction( LPFN_CA

Re: [ADVANCED-DOTNET] Serializable and Construction

2003-12-03 Thread Fabian Schmied
> >Now, if I implement ISerializable, I can (have to) write the special > >deserialization constructor, in which I can also initialize the counter > >correctly. The problem is: now every class inheriting from the base class > >has to follow the ISerializable contract, it is not possible for a deriv

Re: [ADVANCED-DOTNET] Serializable and Construction

2003-12-03 Thread J. Merrill
At 03:09 AM 12/3/2003, Fabian Schmied wrote >I have a base class, ReferenceCountedObject [1], which provides means for >deterministic disposal of objects being reference counted. Basically, it >contains a member variable as a reference counter. This counter is >initialized with 1 (indicating that t

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

2003-12-03 Thread Shawn A. Van Ness
Wow, that must be the most verbose possible rewording of "shove the data back along the wire like any normal client-server app. TCP/IP does a pretty decent job of buffering, fragmenting, and reassembling data." More seriously, Andrew, I'm curious for your take on Levente's original claim that h

Re: [ADVANCED-DOTNET] C++ Dll Import Callback Function Question

2003-12-03 Thread Heath Ryan
Hi Martin, The function pointer should also have a stdcall 'annotation'. The WINAPI define from windows.h can be use for this. declare your function pointer like this typedef WINAPI bool (*LPFN_CALLBACK)( const char* sz1, char psz2[], unsigned long* pulsz2Length ); Not really sure about the p

Re: [ADVANCED-DOTNET] Serializable and Construction

2003-12-03 Thread Fabian Schmied
> It sounds like you should be able to get by with just implementing > IDeserializationCallback in the base class (and just sticking to > [Serializable] and *not* implementing ISerializable). Your implementation > of OnDeserialization would then just initialize the refcount field as needed > to fi

Re: [ADVANCED-DOTNET] C++ Dll Import Callback Function Question

2003-12-03 Thread Arlie Davis
1) Make sure you handle the calling convention correctly. As far as I know, .Net only supports using the __stdcall calling convention. So make sure that LPFN_CALLBACK is declared using __stdcall. Otherwise, if your C++ code is compiled with a different default calling convention, then when the u

[ADVANCED-DOTNET] C++ Dll Import Callback Function Question

2003-12-03 Thread Martin H. Henderson
I have a c++ dll that exports a function that takes a function pointer ( callback ) as a parameter. This function ( callback ) takes 2 char* variables as parameters. How do I prototype the c# delegate to successfully have the delegate function called from within the c++ dll? I am getting into th

[ADVANCED-DOTNET] re Enumerating network machines

2003-12-03 Thread SteveC
I think ADSI is your best bet, using the System.DirectoryServices classes, assuimg you are in a Win2K AD setup or equivalent. You only need an unprivileged member of the "domain users" group to query against AD (port 389 cleartext or 636 if you have a certificate structure); compare that to using

Re: [ADVANCED-DOTNET] thread exceptions terminate entire app

2003-12-03 Thread Keith Hill
I agree with Jade's assessment. The UnhandledExceptionEventArgs.IsTerminating property more or less describes the .NET strategy. From the docs: "Note This property returns true when an exception is received in, but not handled by, an application's main thread. This property also returns true i

Re: [ADVANCED-DOTNET] Serializable and Construction

2003-12-03 Thread Mike Woodring
It sounds like you should be able to get by with just implementing IDeserializationCallback in the base class (and just sticking to [Serializable] and *not* implementing ISerializable). Your implementation of OnDeserialization would then just initialize the refcount field as needed to fix it up.

Re: [ADVANCED-DOTNET] Simple .Net windows service won't authenticate

2003-12-03 Thread Rovshan Baghirov
I also had this problem It's funny, but I stopped getting this error with the release version I don't know why -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Rob H Sent: Wednesday, December 03, 2003 5:45 PM To: [EMAIL PROTECTED

Re: [ADVANCED-DOTNET] Simple .Net windows service won't authenticate

2003-12-03 Thread Chad M. Gross
Since the installer is considered a component, for some reason you are not required to escape the '\' character in strings. So if by accident you typed processInstaller.Username = "mydomian\username" (this compiles in a service project installer component), this would generate a similar error you

[ADVANCED-DOTNET] Simple .Net windows service won't authenticate

2003-12-03 Thread Rob H
Help... I've created the sample .Net windows service using C# that posts to the EventLog. The project (including installer) builds just fine but everytime I try to do the install and 'Invalid user or password' error occurs. I have NEVER been prompted for these credentials as suggested by the samp

[ADVANCED-DOTNET] Extending VS.NET2002 with Wizards - Web Services

2003-12-03 Thread Streno, Robert
Hi folks. We are in the process of trying out some of the extensibility features of VS.NET 2K2, particularly along the line of wizards. I've found a few resources on the net, and have had a decent amount of success programmatically creating a solution and the two requisite library assembly projec

[ADVANCED-DOTNET] Serializable and Construction

2003-12-03 Thread Fabian Schmied
I have a base class, ReferenceCountedObject [1], which provides means for deterministic disposal of objects being reference counted. Basically, it contains a member variable as a reference counter. This counter is initialized with 1 (indicating that there is one reference to the object after constr