Exporting a visual studio c++ project for use in another project, without revealing the .cpp and .h source files -


i have visual studio project called

"topsecretproject"

that want share anonymous developer user, without revealing of code, including header files (since .h files include structure of project ant user cannot know it).

the user should receive:

  1. a list of function names may call (depending on permissions user has) , user should able develop program using these functions black boxes.
  2. my sealed topsecretproject, cannot open.

is scenario possible in way?

i tried following solution failed:

  1. exporting topsecretproject static library.
  2. creating new vs project user, , adding .lib user project.
  3. copying .h files user's project , creating pre compiled header file.
  4. removing headers (now have .pch don't need them anymore)

the pre compiled header rebuilt in run , removing first pre built pch... tried copy pch directly topsecretproject didn't help.

thanks in advance!!

any exported function declarations in pre-compiled header, regardless of whether or not want end user able call them, can extracted pch (or library, matter). you're causing headaches trying deliver pre-compiled header. :-)

instead, how creating header file end users functions want available them declared? pitfall being have make header file each set of permissions (although more difficult specifying available functions each set?)

note, however, still @ library's exported symbols if wanted try use other features of library.

edit:

regarding classes, if don't want give class declaration, you're stuck implementing layer on class them interact with. there's no getting around this. means 1 of 2 paths:

one: can declare functions creating, destroying, , using classes , pass ole' void * pointers. e.g.

typedef void * mysecretclass;  mysecretclass initializemsc( ... ); void freemsc( mysecretclass cls ); int usemsc( mysecretclass cls, int param, ... ); 

two: can create wrapper class same thing.

class mysecretclasswrapper {    public:       mysecretclasswrapper( void );       int useclass( int param );     private:       void * mysecretclassdata; // <-- actual class instantiated here }; 

and compiled definitions:

mysecretclasswrapper::mysecretclasswrapper( void ) {    mysecretclassdata = reinterpret_cast<void *>(new mysecretclass); }  int mysecretclasswrapper::useclass( int param ) {    mysecretclass * object = reinterpret_cast<mysecretclass *>(mysecretclassdata);    return object ? object->useclass(param) : -1; } 

the first method use when making c++ classes available c applications. second exact same idea wrapped in class easier use c++ users.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -