I think Crypto++ seems a little unusual in that it does this special
new/delete stuff. Is the idea to make sure that the new and delete
operations, which are global in scop and 'control' access to heap
memory, are trustworthy? Or unusual in that it overrides new/delete
within the DLL?

On Jul 28, 5:33 am, soeren <[EMAIL PROTECTED]> wrote:
> Hi Jeff,
>
> > Read the ReadMe.txt file.
>
> I did so. It states three different methods on how to use the DLL but
> does not say *HOW* one can eplicitly choose or activate these
> methods, .i.e. "1.  The calling application can tell Crypto++...." -
> okay, but how is this done?
>
> What I've done is to copy these lines from the dlltest.cpp to my
> own .cpp file with the main method:
>
> ============================
> #ifdef CRYPTOPP_IMPORTS
>
> static PNew s_pNew = NULL;
> static PDelete s_pDelete = NULL;
>
> extern "C" __declspec(dllexport) void __cdecl
> SetNewAndDeleteFromCryptoPP(PNew pNew, PDelete pDelete, PSetNewHandler
> pSetNewHandler)
> {
>         s_pNew = pNew;
>         s_pDelete = pDelete;
>
> }
>
> void * __cdecl operator new (size_t size)
> {
>         return s_pNew(size);
>
> }
>
> void __cdecl operator delete (void * p)
> {
>         s_pDelete(p);}
>
> ============================
>
> Now it works altough I must admit that I don't completely understand
> how this code is related to Crypto++ (sorry, I'm a unix guy normally,
> we don't have this sort of problems on unix systems...we have other
> problems <g>).
>
> Now that I've solved a regular executable linking against the dll
> version I'll likely have to spend this weekend for level 2: link it
> against another dll with managed/unmanaged code...keep fingers
> crossed ,-)
>
> Thanks so far,
> Soeren Gerlach


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to