usman999_1
May 10th, 2003, 05:20 AM
Hi*!
I have a Dll that dll implements a class. I have a class factory kindof function in the DLL that gives me an Object of the class in DLL. I dont want to include any libs in my project for the DLL. The class factory in the Dll does something like
// Doing some other stuff too
void* pMem = HeapAlloc(GetProcessHeap(), 0, sizeof(CMyDllClass));
return new (pMem) CMyDllClass();
Is it correct??? It works but i want to know if theres a more appropriate way to achieve the same????
Secondly when i dont need the object, what should i do???? delete will also i think delete the memory & If i use Heap functions to delete the memory, then do i have to call the dtor myself?????
Thanks for ur time,
Regards,
Usman.
I have a Dll that dll implements a class. I have a class factory kindof function in the DLL that gives me an Object of the class in DLL. I dont want to include any libs in my project for the DLL. The class factory in the Dll does something like
// Doing some other stuff too
void* pMem = HeapAlloc(GetProcessHeap(), 0, sizeof(CMyDllClass));
return new (pMem) CMyDllClass();
Is it correct??? It works but i want to know if theres a more appropriate way to achieve the same????
Secondly when i dont need the object, what should i do???? delete will also i think delete the memory & If i use Heap functions to delete the memory, then do i have to call the dtor myself?????
Thanks for ur time,
Regards,
Usman.