-
How to migarate COM+ (VB 6.0) componenet to VB.NET
Dear All
Kindly guide me how to shift or move existing COM+ components which are developed
using VB 6.0 to VB.Net.
What is the equillant COM/COM+/ActiveX in VB.NET.
Kindly guide me in this regards.
Muhammad Waqas
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
"Muhammad Waqas" <mwaqas@i2cinc.com> wrote in message
news:3b0e62fd$1@news.devx.com...
>
> Dear All
>
> Kindly guide me how to shift or move existing COM+ components which are
developed
> using VB 6.0 to VB.Net.
>
> What is the equillant COM/COM+/ActiveX in VB.NET.
>
> Kindly guide me in this regards.
Muhammad, if you just want to use your existing components in VB.NET then
you can - search for COM Interop in the docs. If you want to re-write them
as .NET components using VB.NET then you need to become familiar with VB.NET
and .NET as your existing code may not run in VB.NET without changes.
Kunle
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
"Muhammad Waqas" <mwaqas@i2cinc.com> wrote in message <news:3b0e62fd$1@news.devx.com>...
> Kindly guide me how to shift or move existing COM+ components which are developed
> using VB 6.0 to VB.Net.
If they have non-trivial Class_Terminate events, you must rewrite them
from scratch, because you cannot depend on object cleanup to occur at
all, let alone as soon as the last reference is removed. If your class
might ever be used by someone who might ever neglect to call a Close
method, you must convert to the Flyweight Church of Statelessness.
--
Joe Foster <mailto:jfoster@ricochet.net> Space Cooties! <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
"Joe "Nuke Me Xemu" Foster" <joe@bftsi0.UUCP> wrote in message
news:3b0ffb69@news.devx.com...
> "Muhammad Waqas" <mwaqas@i2cinc.com> wrote in message
<news:3b0e62fd$1@news.devx.com>...
>
> > Kindly guide me how to shift or move existing COM+ components which are
developed
> > using VB 6.0 to VB.Net.
>
> If they have non-trivial Class_Terminate events, you must rewrite them
> from scratch, because you cannot depend on object cleanup to occur at
> all, let alone as soon as the last reference is removed. If your class
> might ever be used by someone who might ever neglect to call a Close
> method, you must convert to the Flyweight Church of Statelessness.
IDisposable is introduced in Beta 2.
Kunle
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
"Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote in message <news:3b10a717$1@news.devx.com>...
> "Joe "Nuke Me Xemu" Foster" <joe@bftsi0.UUCP> wrote in message
> news:3b0ffb69@news.devx.com...
> > "Muhammad Waqas" <mwaqas@i2cinc.com> wrote in message
> <news:3b0e62fd$1@news.devx.com>...
> >
> > > Kindly guide me how to shift or move existing COM+ components which are
> developed
> > > using VB 6.0 to VB.Net.
> >
> > If they have non-trivial Class_Terminate events, you must rewrite them
> > from scratch, because you cannot depend on object cleanup to occur at
> > all, let alone as soon as the last reference is removed. If your class
> > might ever be used by someone who might ever neglect to call a Close
> > method, you must convert to the Flyweight Church of Statelessness.
>
> IDisposable is introduced in Beta 2.
When is the Dispose method automatically called, sometime before the
very stars burn out, or maybe not? What's the story on that magic
GC.RequestFinalizeOnShutdown property? Holy data corruption, Batman,
it's too bad COM classes won't know to invoke it when called via COM
Interop!
<http://msdn.microsoft.com/library/do...tdowntopic.htm>
--
Joe Foster <mailto:jfoster@ricochet.net> Space Cooties! <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
"Kunle Odutola" <kunle.odutola@<REMOVETHIS>okocha.freeserve.co.uk> wrote:
>
>"Muhammad Waqas" <mwaqas@i2cinc.com> wrote in message
>news:3b0e62fd$1@news.devx.com...
>>
>> Dear All
>>
>> Kindly guide me how to shift or move existing COM+ components which are
>developed
>> using VB 6.0 to VB.Net.
>>
>> What is the equillant COM/COM+/ActiveX in VB.NET.
>>
>> Kindly guide me in this regards.
>
>Muhammad, if you just want to use your existing components in VB.NET then
>you can - search for COM Interop in the docs. If you want to re-write them
>as .NET components using VB.NET then you need to become familiar with VB.NET
>and .NET as your existing code may not run in VB.NET without changes.
>
>Kunle
>
>
Hi Kunle
If I need to re-write the COM+ components for take the advantages for .NET
then why not I developed them in C#. Because business logic already developed
and it my personal understanding .NET basically design for C# and VC rest
of the languages just to satisfied the huge community of VB.
So for I have seen to develop a simple program in VB.NET not easy for a person
who has more than two years experience in VB.
What u suggest?
While we taking COM+ components there is no much difference between COM and
COM+.
What I understood is that, the services (e.g. MTS and etc), which were being
used to facilitate COM components in WIN2000 they bind them the part of OS
(Win DNA).
One thing confusing me, I read from somewhere that VS.NET will not support
COM architecture, they have given utilities to use exiting one as u have
mentioned.
The purpose of this whole discussion is that, what is the alternative of
COM architecture in VS.NET?
What is the future of COM+ components in this context? I mean is that the
services Microsoft had added in WIN2000 as the part of OS to facilitates
distributed application or components (MSMQ, MTS, DC MTS, QC and etc), what
r their usage/future in VS.NET?
Does Microsoft has planning to run both version of VS classic (6.0) and VS.NET?
Muhammad Waqas
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
> When is the Dispose method automatically called,
> sometime before the very stars burn out, or maybe not?
Joe: Please save the attitude for the .discussion group; this one's for
technical discussion, not editorializing. Thank you!
---
Phil Weber
DevX Newsgroup Admin
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
Muhammad,
I will try to answer your questions. Be patient if I misunderstood you.
MS in its never ending attempt to confuse us with acronyms means something
different with COM+ than it did with COM. COM generally referred to a
communications between components, and various supporting services such as
DCOM, MTS. COM+ refers to the supporting set of services, because the
inter-component architecture of COM is not used within the dotnet world. The
operating system now includes some of these services.
> If I need to re-write the COM+ components for take the advantages for .NET
> then why not I developed them in C#. Because business logic already
developed
> and it my personal understanding .NET basically design for C# and VC rest
> of the languages just to satisfied the huge community of VB.
> So for I have seen to develop a simple program in VB.NET not easy for a
person
> who has more than two years experience in VB.
If I understand you, you are saying that VB.Net is harder for someone with
experience in VB to learn than C#. I strongly disagree with that. The
differences between C# and VB.Net are clearly smaller than the differences
between C++ and VBclassic (they use the same base classes and IDE) but
VB.Net remains much more familiar, supports a variety of VB familiar things,
and avoids semicolons.
> One thing confusing me, I read from somewhere that VS.NET will not support
> COM architecture, they have given utilities to use exiting one as u have
> mentioned.
MS has provided very good interop within dotnet for dual directional
interaction with COM components you may already have developed.
> The purpose of this whole discussion is that, what is the alternative of
> COM architecture in VS.NET?
If you mean services, then COM+. If not, can you clarify your question.
--
Kathleen
(MS-MVP)
Reply in the newsgroup so everyone can benefit
--
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
Dear Kathleen
I’m very much thankful to your cooperation.
Could u like to guide me how I migrate (by practical example) COM+ component
that already developed in VB 6.0 and are running fine. The listing of code
at the end, this is very simple application. What is doing, connect to the
SQL Server’ s Pubs database (by ODBC). There is one public function that
returned the recordset to the client application. This application is running
fine both at desktop and WEB. I have tested.
What I want now to develop such same simple application using VB.NET.
Kindly let me know the steps so that I can developed the replica of this
application in VB.NET.
Listing of Code
Private cn As ADODB.Connection
Public Function GetData() As ADODB.Recordset
On Error GoTo ObjectNotCreated
Dim rs As ADODB.Recordset
' Query the DB
Set rs = New ADODB.Recordset
'rs.Open "SELECT * FROM authors ", cn, adOpenForwardOnly, adLockReadOnly
rs.Open "SELECT state, city, au_id, au_lname, au_fname, address, phone,
contract FROM authors order by state, city", cn, adOpenForwardOnly, adLockReadOnly
Set rs.ActiveConnection = Nothing
Set GetPattern = rs ' Return the recordset.
Exit Function
ObjectNotCreated:
MsgBox Err.Description, vbCritical, "Server(SQL Err)"
End Function
Private Sub Class_Initialize()
'a connection is established when class is intansciate
On Error GoTo ObjectNotCreated
Set cn = New ADODB.Connection
cn.CursorLocation = adUseClient
cn.Open "PROVIDER=MSDASQL;dsn=DSpubs;uid=;pwd=;" 'data source
Exit Sub
ObjectNotCreated:
MsgBox Err.Description, vbCritical, "Server (Initialized)"
End Sub
Private Sub Class_Terminate()
'connection is broken when class is terminated
Set cn = Nothing
End Sub
Muhammad Waqas
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
Muhammad,
K, there are two areas you will probably want to change here. One is the
error handling, and the other is ADO.Net. ADO.Net abandons cursors (thank
goodness) and uses a direct access. Allows you to think of your dataset
(replaces recordset) as a 2-D array where you can access any cell. I think
hte easiest way to get an initial handle on ADO.Net is to use the IDE tools
to creat hte connection and datacommand. Probably will want to use code in
the real world, but this will get you started.
--
Kathleen
(MS-MVP)
Reply in the newsgroup so everyone can benefit
--
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
Hi Muhammad,
> Hi Kunle
> If I need to re-write the COM+ components for take the advantages for .NET
> then why not I developed them in C#. Because business logic already
developed
> and it my personal understanding .NET basically design for C# and VC rest
> of the languages just to satisfied the huge community of VB.
> So for I have seen to develop a simple program in VB.NET not easy for a
person
> who has more than two years experience in VB.
I understand your query to be:
1) If you decide to re-write your COM+ components as native .NET components,
shouldn't you use C# rather than VB.NET?
Well, the choice of language that you should use for .NET development is
ultimately a personal one. If you are primarily a VB developer currently, my
advice would be to approach .NET development using VB.NET. There is a lot to
learn about the .NET platform, it's class libraries and it's support for
interoperability with the underlying Win32 platform. It is best to learn
that without having to learn a new language at the same time IMO. Of course
they are changes between VB6 and VB.NET to make the experience a memorable
one ;-). Nevertheless VB.NET represents the best upgrade path to .NET for VB
developers.
Once you are confortable with .NET and VB.NET, you can learn additional
languages as you please. I would advise learning languages that are very
different to what you already know if possible (e.g. if you know VB.NET,
then Prolog.NET or ML.NET is more different than C#). The notion that C# is
the language of .NET is slightly misplaced. C# is a productive, easy to use
language targetted as an upgrade path for C/C++/Java developers primarily.
It is a new language without backwards compatibility requirements and thus
has some features that MS was unable to add to it's exisitng languages. On
the upside, VB.NET has some features that C# doesn't have too.
> While we taking COM+ components there is no much difference between COM
and
> COM+.
COM and COM+ are related but different technologies. COM is essentially a
set of services for supporting component reuse at a binary level. By this I
mean COM essentially allows compiled binaries to expose a set of
functionality and consume functionality exposed by other binaries. Of course
the details are much more complex.
COM+ builds on top of the COM infrastructure with a set of runtime services
that allow your components to transparently adopt/inherit certain features
including role-based security, transaction support, resource & object
pooling, asyncronous activation (queued components) etc. It is best to think
of it as a mix of COM, the next version of MTS with built-in MSMQ interop.
> What I understood is that, the services (e.g. MTS and etc), which were
being
> used to facilitate COM components in WIN2000 they bind them the part of OS
> (Win DNA).
MTS extended the COM model in previous version of Windows. In Windows 2000,
COM+ includes MTS, COM/DCOM, MSQM interop etc.
> One thing confusing me, I read from somewhere that VS.NET will not support
> COM architecture, they have given utilities to use exiting one as u have
> mentioned.
Well, .NET suports interoperability with COM components. This means you can
use existing COM components from .NET applications and, you can use .NET
components from traditional Win32/COM applications.
> The purpose of this whole discussion is that, what is the alternative of
> COM architecture in VS.NET?
I am not sure what this questions means but if you wanted to know the .NET
equivalent of COM, then the CTS (and the rest of the CLR) is close I think.
> Does Microsoft has planning to run both version of VS classic (6.0) and
VS.NET?
I believe this scenario is supported - running VS6 alongside VS.NET - but I
can't remember definitely off the top off my head.
Kunle
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
Muhammad,
I missed this until Kunle quoted it, sorry.
> Does Microsoft has planning to run both version of VS classic (6.0) and
VS.NET?
Yes COM interop with VB6 components is a key piece in the upgrading picture.
MS knows this and is committed to VB6 interop.
There still maybe small problems. And there certainly may be problems
running the beta side by side. That is what betas are for, finding problems.
--
Kathleen
(MS-MVP)
Reply in the newsgroup so everyone can benefit
--
-
Re: How to migarate COM+ (VB 6.0) componenet to VB.NET
"Kathleen Dollard-Joeris" <joeris@nomailplease.org> wrote in message <news:3b150ced@news.devx.com>...
> Yes COM interop with VB6 components is a key piece in the upgrading picture.
> MS knows this and is committed to VB6 interop.
>
> There still maybe small problems. [snip]
Have any public classes which have non-trivial Class_Terminate events?
How about classes, public or private, with non-trivial destructors
which may be used as members in public classes? Can you make them all
Pure Stateless without breaking compatibility? If so, how's the perf
hit? Could NDF creep have been the impetus behind ADO.NET?
--
Joe Foster <mailto:jfoster@ricochet.net> On the cans? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks