Not getting any response, I decided to explain the situation more.
I have a class which make it easy for me to write to and read from ports easily. In the factory function of this class i take a RCommServ object and a TCommPort object which were opened and configured before. For Example:
In the InitilizeL() method I always get an error like KErrAccessDenied, KErrLocked,....
class MyPortClass : public CActive
static MyPortClass* NewL(MyPortClassObserver&, RCommServ&, TCommPort&);
The implementation of InitilizeL() is:
If I change the ECommRoleDCE to ECommRoleDTE the error would be solved.
void MyPortClass::Initialize(RcommSer& aServer, TCommPort& aPort)
// I always get an error here.
User::LeaveIfError(iComm.Open(aServer, aPort.iPort, ECommShared, ECommRoleDCE));
Whats the differences between these enumerators?
Why I get KErrLocked when I opened the port by ECommShared?
If I just create one instance of MyPortClass in my project, I get KErrAccessDenied and if I creat e more objects i get KErrLocked.