473,387 Members | 3,781 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,387 software developers and data experts.

Exposing VB6 COM dll via WCF

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 webservice and using a COM component
is scalable. I have heard there are problems with this revolving around the
apartment threading models.

I know COM dll's are STA and a WCF service is MTA. Since there is no way to
force a WCF service to be STA, I am expecting all my webservice calls to
block as they are forced through the STA pipe. However, this is not
happening and I am wondering why. To test, I have a web method that takes a
boolean parameter. the web method calls some functions from the COM
component and then if the parameter is true, it pauses the current thread,
otherwise it doesn't. I have two clients that hit the service at the same
time and while one is paused the other is constantly hitting the service. I
am expecting the second client to block while first one is paused. Can
anyone tell me why this isn't happening? Do I need to pause or perform some
long running process from within the COM component to see the behavior I am
talking about?

The end goal is to make sure exposing portions of this COM dll will scale if
called from within a WCF service. I have read articles like the following
that make me very cautious of doing this:

http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

If this is indeed a problem, does anyone know a work around like the one
above for WCF to preserve at least some scalability.
Jan 15 '08 #1
4 2484
"chriscap" <ch******@discussions.microsoft.comwrote in message
news:A1**********************************@microsof t.com...
>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 webservice and using a COM
component
is scalable. I have heard there are problems with this revolving around
the
apartment threading models.

I know COM dll's are STA and a WCF service is MTA. Since there is no way
to
force a WCF service to be STA, I am expecting all my webservice calls to
block as they are forced through the STA pipe. However, this is not
happening and I am wondering why. To test, I have a web method that takes
a
boolean parameter. the web method calls some functions from the COM
component and then if the parameter is true, it pauses the current thread,
otherwise it doesn't. I have two clients that hit the service at the same
time and while one is paused the other is constantly hitting the service.
I
am expecting the second client to block while first one is paused. Can
anyone tell me why this isn't happening? Do I need to pause or perform
some
long running process from within the COM component to see the behavior I
am
talking about?

The end goal is to make sure exposing portions of this COM dll will scale
if
called from within a WCF service. I have read articles like the following
that make me very cautious of doing this:

http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

If this is indeed a problem, does anyone know a work around like the one
above for WCF to preserve at least some scalability.
Scalability may not be your greatest problem. Has this COM component ever
been tested in a multi-threaded environment (especially, on a multiple CPU
system)? If it hasn't been tested in such an environment, then it may not
work in that environment. I've seen heap corruption problems and such from
COM components that claimed to be thread safe and were not.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Jan 16 '08 #2
No it has not been tested in a multi-threaded environment. Can you recommend
any resources to help detect this? Can you explain why this would be an
issue?

"John Saunders [MVP]" wrote:
"chriscap" <ch******@discussions.microsoft.comwrote in message
news:A1**********************************@microsof t.com...
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 webservice and using a COM
component
is scalable. I have heard there are problems with this revolving around
the
apartment threading models.

I know COM dll's are STA and a WCF service is MTA. Since there is no way
to
force a WCF service to be STA, I am expecting all my webservice calls to
block as they are forced through the STA pipe. However, this is not
happening and I am wondering why. To test, I have a web method that takes
a
boolean parameter. the web method calls some functions from the COM
component and then if the parameter is true, it pauses the current thread,
otherwise it doesn't. I have two clients that hit the service at the same
time and while one is paused the other is constantly hitting the service.
I
am expecting the second client to block while first one is paused. Can
anyone tell me why this isn't happening? Do I need to pause or perform
some
long running process from within the COM component to see the behavior I
am
talking about?

The end goal is to make sure exposing portions of this COM dll will scale
if
called from within a WCF service. I have read articles like the following
that make me very cautious of doing this:

http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

If this is indeed a problem, does anyone know a work around like the one
above for WCF to preserve at least some scalability.

Scalability may not be your greatest problem. Has this COM component ever
been tested in a multi-threaded environment (especially, on a multiple CPU
system)? If it hasn't been tested in such an environment, then it may not
work in that environment. I've seen heap corruption problems and such from
COM components that claimed to be thread safe and were not.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Jan 16 '08 #3
To reiterate, this is a vb6 component. I've only heard of heap corruption
from c++ when manually allocating memory. Is this still an issue with vb6?
I can't seem to find much on the topic.

"John Saunders [MVP]" wrote:
"chriscap" <ch******@discussions.microsoft.comwrote in message
news:A1**********************************@microsof t.com...
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 webservice and using a COM
component
is scalable. I have heard there are problems with this revolving around
the
apartment threading models.

I know COM dll's are STA and a WCF service is MTA. Since there is no way
to
force a WCF service to be STA, I am expecting all my webservice calls to
block as they are forced through the STA pipe. However, this is not
happening and I am wondering why. To test, I have a web method that takes
a
boolean parameter. the web method calls some functions from the COM
component and then if the parameter is true, it pauses the current thread,
otherwise it doesn't. I have two clients that hit the service at the same
time and while one is paused the other is constantly hitting the service.
I
am expecting the second client to block while first one is paused. Can
anyone tell me why this isn't happening? Do I need to pause or perform
some
long running process from within the COM component to see the behavior I
am
talking about?

The end goal is to make sure exposing portions of this COM dll will scale
if
called from within a WCF service. I have read articles like the following
that make me very cautious of doing this:

http://msdn.microsoft.com/msdnmag/is...10/WickedCode/

If this is indeed a problem, does anyone know a work around like the one
above for WCF to preserve at least some scalability.

Scalability may not be your greatest problem. Has this COM component ever
been tested in a multi-threaded environment (especially, on a multiple CPU
system)? If it hasn't been tested in such an environment, then it may not
work in that environment. I've seen heap corruption problems and such from
COM components that claimed to be thread safe and were not.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Jan 16 '08 #4
"chriscap" <ch******@discussions.microsoft.comwrote in message
news:D3**********************************@microsof t.com...
To reiterate, this is a vb6 component. I've only heard of heap corruption
from c++ when manually allocating memory. Is this still an issue with
vb6?
I can't seem to find much on the topic.
Heap corruption was just an example of one issue I've encountered before.
It's one instance of the general problem: "if you don't test it, then don't
expect it to work".

Unless VB6 takes special precautions to permit code that was not written for
a multi-threaded environment to work in a multi-threaded environment, then I
wouldn't expect it to work. Instead, I'd expect you to receive a number of
strange crashes and other failures over the lifetime of the application.
They may or may not seem to be related to the COM component, but they
actually will be.

I would recommend that you find another strategy that doesn't involve the
expectation that your VB6 component "just happens to work".

Otherwise, Good Luck!
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Jan 17 '08 #5

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

Similar topics

4
by: Peter Hemmingsen | last post by:
Hi, I have a dotnet object (implemented in mc++ and used in c#) which have a property called "Info". The Info property is also a dotnet object (implemented in mc++). In the constructor of the...
7
by: J L | last post by:
I'm trying to expose only a limited set of method calls from a C# program to someone using my dll. The entire application is written in C# and my first attempt has been to try and write a COM...
3
by: FredC | last post by:
How do you make a program's properties and methods availale so that other programs can "connect" to them at design time and then use them at run time?
1
by: David Dvali | last post by:
I have some basic questions please. What is the best way of exposing some protected properly of base class as public properly?
3
by: bill | last post by:
I need to open a asp.net web form from a classic asp page, and pass a username and password to the asp.net page. The username and password exist as session variables in the classic asp...
8
by: Dave A | last post by:
I have a class called 'PrimaryKey' that represents the primary key of a table. PrimaryKeys can only be created and the class only implements .ToString(). The PrimaryKey class internally stores...
2
by: Neil Cerutti | last post by:
I'm using doctest for the first time, and boy is it cool. But I'm nervous about exposing library internals in the docstring. def glk_cancel_char_event(win): """ Cancel a pending request for...
4
by: =?Utf-8?B?QkogU2FmZGll?= | last post by:
We have a class that has a public property that is of type List<T>. FXCop generates a DoNotExposeGenericLists error, indicating "System.Collections.Generic.List<Tis a generic collection designed...
1
by: bantunks | last post by:
Hello, I am trying to figure out the advantages and disadvantages of exposing interfaces through Opaque data types in C. I have figured/found out the following two advantages 1. Higher level of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.