|
Hi,
I want to know whether it is possible to handle events raised by COM components in a windows service developed in .NET using VisualC#.NET . if it's possible, can someone explain me the way to do it? The component under question is an ATL component.
Thanking you in advance.
Thanks
Desai
|
|
|
|
|
Yes, it's possible even though there are several pieces to put together before you get anything working.
Subscribing for COM events using .NET is much like with standard C/C++ code : you request IConnectionPointContainer provided by the COM component, then enumerate all IConnectionPoint(s), sink those which are interesting, and your interface methods will be automatically called then.
For ready code snippets to play with, look up this site and the MSDN support KB with this keyword : UCOMIConnectionPointContainer. Here is an example[^].
|
|
|
|
|
hello
how would i write a game using .net to put on the internet
the sort of thing you could do using java applets
thanks
joe
|
|
|
|
|
|
Hi all,
I deployed a private assembly (non-signed) then later (signed) to a strong-named assembly using Assembly.Loadfrom with a URL. When I encounter Interop assemblies I was getting:
The assembly gets downloaded, but complains, WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
All my assemblies are signged and imported references to introps assemblies are wrapped with the key file. Everything checks out in the manifest, etc.
But the problem lies with IE. It seems to have cached the old assembly, and never re-loaded. So clearing my IE cache, fixed the problem.
This seems like a bug to me. Since the new strong name assembly should have replaced anything it was being compared to. Very strange.
Anyway -- if anyone has an comments or experience, I'd welcome it.
Ingram Leedy
You can't depend on your eyes when your imagination is out of focus.
--Mark TwainURL file:///C:/Program Files/ElephantBackup/Client/AxInterop.SHDocVw/AxInterop.SHDocVw.EXE.
LOG: Attempting download of new URL http://192.168.1.31/Client/AxInterop.SHDocVw.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Documents and Settings\Leedy\Local Settings\Temporary Internet Files\Content.IE5\P8KFPLGP\AxInterop.SHDocVw[1].DLL
LOG: Entering download cache setup phase.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Ingram Leedy
You can't depend on your eyes when your imagination is out of focus.
--Mark Twain
|
|
|
|
|
I have recently started looking at .NET.
I have managed to use custom Designers and CodeDOM in order to generate statements inside the InitialiseComponent().
A simple example was a root designer with three radio buttons to set the background colour property. When you clicked on a radio button it created the relevant code in InitialiseComponents(). What I now need to do is:
- Create private member variables in the selected class
- Create the code for Properties.
- Create the code for Events.
If I could do all there purely from a root designer it will cut the development time of the components in my project.
Anybody have any ideas
|
|
|
|
|
Hi!
We have finished writing our app in c#.
Its cool, and it holds a video control from
VSnet controls.
Now, we can'T afford InstallShield, and were not
gurus. Can someone kindly guides us through the steps
we must take to make a good install...
we need to install the NET framework unto the clients machines
that all have different flavors of windows. and next we need to install
our app.
We need help!
Please, give us a hand, and show us in detail how
we can deliver on time our app. Thanks!
Orlanda
Coding is a family business
|
|
|
|
|
|
I was recently using the .NET bitmap class to create a copy of a bitmap by using the constructor to pass in the original bitmap. When I did this with a square bitmap (ie 10x10) Things worked fine. However, when I passed in a non-square (10x12) bitmap the pixels were scrambled in odd ways.
It was simple enough to get around the problem, but I was just curious if this is a known bug in the framework, or is there simply something I am failing to consider when using this technique, (or am I having LSD flashbacks)?
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Stan Shannon wrote:
However, when I passed in a non-square (10x12) bitmap the pixels were scrambled in odd ways.
It was simple enough to get around the problem, but I was just curious if this is a known bug in the framework, or is there simply something I am failing to consider when using this technique, (or am I having LSD flashbacks)?
What is the problem and how did you get around it? I have never seen that happen, although the loaded JPEG was rather simple (just a background).
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
The problem was that the bitmap resulting from the this:
Bitmap bmp2 = Bitmap( bmp1 );
produced a scrambled pixel pattern if bmp1 was not a square bitmap. If is was square (i.e. 10x10) things were fine.
I got around it by simply processing the original bitmap and not using the above code. (I did not need to store the original but was just experimenting with the second bitmap). I did not attempt to clone the original so I don't know if that would have made a diference.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Web site: http://test.labdotnet.com/GenuineChannels/GenuineChannels.html
Genuine Channels implement bidirectional TCP channels (for .NET Remoting infrastructure) that solve the primary problem of native tcp channels and all sequential issues. Also they implement some features that help to build durable, viable and stable client-server solutions.
Brief explanation
Microsoft .NET Framework implementation of TCP channels allows using TCP channel only as a server or client connection. If you want to provide feedback from the server to client, server must connect to the client’s port. This scheme consumes two TCP sockets and is not workable if client is behind NAT or Masquerade server. Also, native implementation closes TCP connection after non-customized period of time.
Genuine Channels use the only connection from the client to the server. There is no problem if client is behind firewall, NAT or Masquerade server. Also, Genuine Channels implement some features to help building durable, viable and stable client-server solution.
Features
Only one TCP connection is used between client and server.
Fully compatible with .NET Remoting infrastructure.
Each connection has queue of messages being sent.
Constraints on the queue are possible. It greatly helps to force reconnection if current connection is too slow.
Automatic client reconnection to the server. Server and Clients does not lose messages during reconnection. It’s very useful if your server must talk to the client.
Full support of sync, async and one-way messages.
Adjustable timeout to wait for reply from the remote host.
Real async processing. You can have any number of threads at a server and at a client that will automatically use the same TCP connection.
Each exception has unique identifier that simplifies centralizing error processing or translating error messages to any language.
Automatic ping to check TCP connection if connection has not been used for (by default) 120 seconds.
Detailed logging system that receives all events and can save even the entire incoming and outcoming TCP streams as well as exceptions, stack traces and object’s guids. You can write your own logger and attach it to the system.
Dmitry Belikov.
|
|
|
|
|
Developing a network file backup application and need to
be able to see all machines on a network, select
drives/dirs/files for backup.... currently, I have an app
similar to Windows Explorer, with a treeview to look at
my own computer's data, with no problems... need to
add "My Network Places" to this (similar to Windows Explorer)
and be able to go out on
the network and get similar info for other
workstations.. plus I need to be able to create folders
and copy files to these PCs... I think I'm kinda close
with System.DirectoryServices and System.Management, but
can't seem to find what I'm looking for... any help or
suggestions would be much appreciated... thank you.
|
|
|
|
|
Is there someone who can tell me how to create the effect equivalent to Java's Flow Layout Maneger? In my concrete case, I would like to have a single column listview, where the elements are thumbnail images, similar to the standard UI presented by PowerPoint.
Thanks in advance
|
|
|
|
|
Is there a way to compile to native code rather to MSIL.
The problem with MSIL is its an open code, where everyone can just look at what you wrote, and beside that , native code will save the time of the compiling at run time, therefor it will be faster.
So is there a way to tell VS.NET to compile the code to native?
Amir Harel
My boss always tell me: Why we always search for the generic solution for a specific problem...
|
|
|
|
|
To try to get ahead on speed look into using ngen.exe.
Not sure if it affords any safty from decomp though, just a speed increase.
The only thing that can protect the IL is an obfuscator.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
From what I have heard, you have an obfuscator part of the VS.NET 2003 package.
|
|
|
|
|
Can they span multiple assemblys (sp)? I am assuming that they can, but can’t seem to find anything that says definitively 'YES'. I will admit that it is late and I am probably not searching right on Goggle... but I just can't find it...
Also, Are there any recommendations for namespace hierarchies? I am considering:
[company_name]
[app_name]
[section_name1]
…..
[section_name2]
I assume that if I set the root namespace for each project to [company_name] then preced each class with the ‘namespace’ directive for [app_name] I can then nest the [section_name] namespaces inside of that.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
Ray Cassick wrote:
but can’t seem to find anything that says definitively 'YES'.
'YES'
This is used extensively throughout the framework, especially when you look at the assemblies that are meant to assist development (System.Design.dll).
Ray Cassick wrote:
I assume that if I set the root namespace for each project to [company_name] then preced each class with the ‘namespace’ directive for [app_name] I can then nest the [section_name] namespaces inside of that.
Pretty much
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
|
|
Has anyone here used it for any projects?
Log4net clickety[^]
I have been looking it over for a project and am looking for some other impartial views of it.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
|
I've not used NUnit yet, but I do plan on including it with the development of my University degree's final year project (a big distributed commercial web service -- see a post below for a basic overview).
Anyway, NUnit is just a way of building automated unit tests, with the aim of producing a suite of tests that you can run to prove that the code does what it's supposed to -- and that anything you add hasn't broken something old.
The way I'm looking at including it from the outset (you add attributes 'n stuff ) is around a kind of one-person eXtreme Programming. By using these tests I can ensure to a certain degree that the code is successful, and should give me some good info to put in the report with regards to testing.
The other thing about XP (as far as I've understood it) is that one of the aims is to build elements of a system as quickly as possible, once its functional you move on. So I can do tests for features, once the tests complete ok I can move on ... there isn't a great deal of design involved before the coding.
I have to say its quite bureaucratic (including all this NUnit testing support) but I'm hoping it'll be worthwhile in the long-run, and should be a good learning experience.
--
Paul
"If you can keep your head when all around you have lost theirs, then you probably haven't understood the seriousness of the situation."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Use NUnit (and NAnt which is awesome) for team development: daily builds and automated testing are essential whenever you're working with others on a project.
I didn't look into Log4net yet; i think it uses the pattern of Listeners which you can attach to a general logging system; just as you can do with the Trace classes in .NET
Gertjan Schuurmans
Amsterdam
The Netherlands
|
|
|
|