windows - C Runtime objects, dll boundaries -


What is the best way to design a C API for the DLO which is dealing with the problem of running "objects" Runtime is dependent (File *, Indicator, come back by Molok ...). For example, if two DLLs are connected to the second version of the runtime, then my understanding is that you can not pass from one file to another * securely with a DLL.

What is Windows-dependent API (which is guaranteed to work in DLS)? The C API is already present and mature, but was designed by Unix POV, mostly (and still have to work on Unix).

You have not asked for a C ++ solution for C.

There are general methods for this type of object in C:

  • Design the module API for not just requiring CRT objects in raw C. types Get the goods to pass - that means the user needs to load the file and just pass the pointer to you. Or, internally opened, read and closed, get a consumer who passes the fully qualified filename.

  • One method used by other C modules, some sections of the MS cabinet SD and OpenSSL library, IIRC, are to be minded, in pointers to work in the initial ceremony Get the consumer application to pass. Therefore, any API takes an indicator in a string with function pointers that match the signature of Freed, FOPN etc. at some point during initialising to pass a file *. * Working with external files * Functions instead of CRT functions

With this simple move, you can create your own CRL Interface fully independently from the CRT host CRT - or actually require a host Is written in C or C ++.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -