473,287 Members | 1,880 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Exposing Unmanaged C++ Windows Service code as a ASP.NET service.


I have a C++ COM based windows service which have more than 30k lines of code
and which is stablized over years. We need to take the advantage of the
..NET framework for this project, especially the GUI for this service and the
other
windows non gui .NET clients.

What's the best migaration pattern for us considering not to rewrite the
thousands of lines of code.

The question i have are the follows.

We would like to port this service code to a ASP.NET service and expose to
the
client. Doing this way we can take best advantage advantage of the Windows
Communication Foundation (WCF) functionalities which is comming with Windows
Vista.

What will be the best way to do this. Can i make the new ASP.NET service
talk directly to the windows unmanaged service, and then the GUI and the
clients talk to the ASP.NET instead of the windows unmanaged service.

In this approch the ASP.NET service can host all the new functionalities +
the type conversion from .NET to COM and vice versa.

Thanks,
Shyam

May 20 '06 #1
2 2223
You case is pretty interesting. First of all if your code is COM unmanged
code you can make it managed but creating wrapper class and then using Stubs
(proxy) in your code, this is beauty of .Net Interoperability. But the main
concern here is architecture. Microsoft Enterprise Architecture introduces
what we call Service Agents which works on Gateway Design Pattern. In this
case your unmanged COM service (which will become managed by
interoperability) will act as service interface and then you can create
Service Agent which will hide all communication and using details and this
service agent can be used anywhere either asp.net application or webservice
or winforms application.

Pls provide feedback whether this post is helpful to you.

"shyam" wrote:

I have a C++ COM based windows service which have more than 30k lines of code
and which is stablized over years. We need to take the advantage of the
.NET framework for this project, especially the GUI for this service and the
other
windows non gui .NET clients.

What's the best migaration pattern for us considering not to rewrite the
thousands of lines of code.

The question i have are the follows.

We would like to port this service code to a ASP.NET service and expose to
the
client. Doing this way we can take best advantage advantage of the Windows
Communication Foundation (WCF) functionalities which is comming with Windows
Vista.

What will be the best way to do this. Can i make the new ASP.NET service
talk directly to the windows unmanaged service, and then the GUI and the
clients talk to the ASP.NET instead of the windows unmanaged service.

In this approch the ASP.NET service can host all the new functionalities +
the type conversion from .NET to COM and vice versa.

Thanks,
Shyam

May 21 '06 #2
Hi Alatf,

Thanks for your valuable suggestions about the service agents, it was
really helpfull for me(as i never knew such a patten exist)

After reading about that in MSDN i think i need to extract out the conversion
mechanisms(interops) from .NET to COM and vice versa in a seprate component .

That leads to another question, is it a good design decision to put this
component
in a seprate ASP.NET webservice, and make the .NET clients talk to this
service(which in turn talks to the real c++ COM service).

Can i make use of SOAP protocols here for this kind of object accesing
mechanisms?.

Thanks,
Vineeth
"Altaf Al-Amin Najwani" wrote:
You case is pretty interesting. First of all if your code is COM unmanged
code you can make it managed but creating wrapper class and then using Stubs
(proxy) in your code, this is beauty of .Net Interoperability. But the main
concern here is architecture. Microsoft Enterprise Architecture introduces
what we call Service Agents which works on Gateway Design Pattern. In this
case your unmanged COM service (which will become managed by
interoperability) will act as service interface and then you can create
Service Agent which will hide all communication and using details and this
service agent can be used anywhere either asp.net application or webservice
or winforms application.

Pls provide feedback whether this post is helpful to you.

"shyam" wrote:

I have a C++ COM based windows service which have more than 30k lines of code
and which is stablized over years. We need to take the advantage of the
.NET framework for this project, especially the GUI for this service and the
other
windows non gui .NET clients.

What's the best migaration pattern for us considering not to rewrite the
thousands of lines of code.

The question i have are the follows.

We would like to port this service code to a ASP.NET service and expose to
the
client. Doing this way we can take best advantage advantage of the Windows
Communication Foundation (WCF) functionalities which is comming with Windows
Vista.

What will be the best way to do this. Can i make the new ASP.NET service
talk directly to the windows unmanaged service, and then the GUI and the
clients talk to the ASP.NET instead of the windows unmanaged service.

In this approch the ASP.NET service can host all the new functionalities +
the type conversion from .NET to COM and vice versa.

Thanks,
Shyam

May 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris | last post by:
Hi, Currently, I have a console application written in C# and an unmanaged legacy DLL written in VC++ 6.0. In the DLL's previous application, when an event occurs in the DLL, a windows message...
0
by: t_developer_plus | last post by:
Hi There I've been handed an XML Web Service that I am required to use. C# can build a CLIENT (consumer) of this Web service, apparently quite nicely, with the "Add Web Reference" feature. A...
1
by: David | last post by:
Hello. How can I expose some mehods from my Windows Servise application as Web Service and access thm from other application?
2
by: | last post by:
Everything seems to be moving to .NET and VC++ seems to be adding a lot of managed code support every new release. The questions: is unmanaged code in VC++ beeing phased out in favour of managed...
0
by: Vipul Patel | last post by:
Hi, There is a project requirement to create an installer for a windows service created in VC++ 7.0 unmanaged code. Can any one guide to a link or working sample as to where I can get the...
0
by: Shaun | last post by:
I have read several articles that tell me that a COM+ application can expose its components as web services, but can't get things to work for me. I have the following class (slightly modified...
3
by: Dean Mitchell | last post by:
Hi everyone, We have a c++ server application that we are writing a GUI client application for. To save our time and to avoid duplicating all the code and functionality that already exists in...
4
by: Alex | last post by:
Hi, everybody, I found some simple example of writing of a service application in managed C++. The only thing my service has to do is periodically to call some COM Server function written in...
4
by: =?Utf-8?B?Y2hyaXNjYXA=?= | last post by:
I tried searching the forums for this already and didn't find anything. I want to expose functionality from a vb6 COM component via a WCF service. I am trying to evaluate if exposing this...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.