Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 09:23:37 +0000



Post From: TCP/IP Server in custom study

[2021-05-31 19:18:27]
User438857 - Posts: 5
I want to create a TCP/IP Server in a custom study for changing informations with other c# applications.

This server should have access to SCStudyInterfaceRef object reference

For launch the TCP/Ip server I use a new thread created from SCSFExport scsf_GetDataDCOM(SCStudyInterfaceRef sc) on (sc.SetDefaults) section.

The TCP/Ip server have this struct data as parameter:

typedef struct MyData {
SCStudyInterfaceRef ≻
int debug;
} SERVER_SOCKET_MYDATA, * PMYDATA;



the code for thread creation is:


PMYDATA pDataArray;
DWORD dwThreadIdArray;
HANDLE hThreadArray;

pDataArray = (PMYDATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(SERVER_SOCKET_MYDATA));


if (pDataArray != NULL)
{

sc.AddMessageToLog("starting thread", 1);
// ACSIL Programming Concepts: Passing ACSIL Interface Members Structure To Secondary Function


pDataArray->sc = sc;
pDataArray->debug = 1;


hThreadArray = CreateThread(
NULL, // default security attributes
0, // use default stack size
initSocketServer, // thread function name
pDataArray, // argument to thread function
0, // use default creation flags
&dwThreadIdArray); // returns the thread identifier

if (hThreadArray == NULL)
{
sc.AddMessageToLog("Server thread error", 1);
}

sprintf_s(log_message, "Thread return : %d", hThreadArray);
sc.AddMessageToLog(log_message, 1);

}

The problem is I receive error at this line: pDataArray->sc = sc;

error LNK2001: unresolved external symbol "public: struct s_sc & __cdecl s_sc::operator=(struct s_sc const &)" (??4s_sc@@QEAAAEAU0@AEBU0@@Z)

Can you help me with some sugestions?

Thanks and best regards