goofy_10
February 10th, 2003, 05:54 AM
Hi Everyone,
I'm new to this group, Threads programming and COM. And I need help fast!!!!
I have created a simple server (ATL/COM exe) that has a global object "_Module" of the class "CServiceModule" with a DWORD member "iDomain"( this is a thread index) and 2 methods "GetValue()" and "SetValue()" that are used to set and fetch the value of "iDomain" using "TlsGetValue()" & "TlsSetValue()" respectively. This server is accessible to clients through an interface having 2 interface methods "IGetInfo()" and "ISetInfo()". I try to set & fetch the value of "iDomain" from the client through these interfaces which in turn call the object methods mentioned earlier. I have attached those methods also here for your reference.
void CServiceModule::SetValue(int *iDom)
{
int iTemp;
iTemp=*iDom;
TlsSetValue(_Module.iDomain,&iTemp);
}
int CServiceModule::GetValue()
{
int *itemp;
itemp=(int*) TlsGetValue(_Module.iDomain);
int iVal=*itemp;
return iVal;
}
Now I'm not able to set the value using TlsSetValue() and hence TlseGetValue() too doesn't give me the desired result.
However I have tried using thse 2 functions in a simple C++ program and they seem to work. What could be wrong? ANy help would be greatly appreciated. Thanks in advance.
I'm new to this group, Threads programming and COM. And I need help fast!!!!
I have created a simple server (ATL/COM exe) that has a global object "_Module" of the class "CServiceModule" with a DWORD member "iDomain"( this is a thread index) and 2 methods "GetValue()" and "SetValue()" that are used to set and fetch the value of "iDomain" using "TlsGetValue()" & "TlsSetValue()" respectively. This server is accessible to clients through an interface having 2 interface methods "IGetInfo()" and "ISetInfo()". I try to set & fetch the value of "iDomain" from the client through these interfaces which in turn call the object methods mentioned earlier. I have attached those methods also here for your reference.
void CServiceModule::SetValue(int *iDom)
{
int iTemp;
iTemp=*iDom;
TlsSetValue(_Module.iDomain,&iTemp);
}
int CServiceModule::GetValue()
{
int *itemp;
itemp=(int*) TlsGetValue(_Module.iDomain);
int iVal=*itemp;
return iVal;
}
Now I'm not able to set the value using TlsSetValue() and hence TlseGetValue() too doesn't give me the desired result.
However I have tried using thse 2 functions in a simple C++ program and they seem to work. What could be wrong? ANy help would be greatly appreciated. Thanks in advance.