Click here to Skip to main content
15,896,118 members
Articles / Desktop Programming / MFC

COOP - Co-operate Library to Transfer Data between Processes

Rate me:
Please Sign up or sign in to vote.
4.40/5 (10 votes)
28 Feb 2010CPOL3 min read 25.3K   964   41  
Co-operate library to start another process and transfer data between processes
#ifndef __COOP__FRAME__H__
#define __COOP__FRAME__H__

#ifdef COOP_EXPORTS 
#define COOP_API2 __declspec(dllexport)
#else
#define COOP_API2 __declspec(dllimport)
#endif

#define STDCALL __stdcall

DECLARE_HANDLE(HCOOPSESSION);

typedef VOID (CALLBACK* COOPPROC)(LPCVOID pData, UINT nSize, LPVOID pParam);

#ifdef __cplusplus
extern "C" {
#endif

//
// If current process is created by co-operator, the return value is not NULL
//
COOP_API2 HCOOPSESSION STDCALL GetCoopSession(COOPPROC fnCoopProc, LPVOID pParam);

//
// Create a process
//
COOP_API2 HCOOPSESSION STDCALL StartCoopSession(COOPPROC fnCoopProc, LPVOID pParam, LPCTSTR szPath, LPCVOID pData, UINT nSize);

//
// Set callback function
//
COOP_API2 VOID STDCALL SetCoopSessionProc(HCOOPSESSION hCoopSession, COOPPROC fnCoopProc, LPVOID pParam);

//
// Is co-operator still running
//
COOP_API2 BOOL STDCALL IsCoopSessionValid(HCOOPSESSION hCoopSession);

//
// Release session
//
COOP_API2 VOID STDCALL CloseCoopSession(HCOOPSESSION hCoopSession);

//
// Send data to co-operator
//
COOP_API2 VOID STDCALL SendToCoopSession(HCOOPSESSION hCoopSession, LPCVOID pData, UINT nSize);

#ifdef __cplusplus
}
#endif

#endif//__COOP__FRAME__H__

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
China China
Begin coding from basic, since 1994. Interested in coding and database and website constructing.
My website: http://www.regexlab.com/ - Regular Expression Laboratory
The easiest regex engine: http://www.regexlab.com/deelx/

Comments and Discussions