> so the code would look something like > > // ... Resolve function pointer from library handle > Foo *Bar = pNewFoo(); // pNewFoo = GetProcAddress( myLib, "newFoo" ); > > do i have to go > pDeleteFoo( Bar ); > > or can i just go > > delete Bar; ?
Your module that loads the DLL obviously knows what a "class Foo" is otherwise you couldn't do this... Foo *Bar = pNewFoo(); ...(I assume they share the same Foo.h file). There's no reason you can't use 'delete' to free up the class since the module loading the DLL and the DLL should share the same heap space. The only problem you would run into is if you changed the 'class Foo', rebuild the DLL, but forgot to rebuild the application that loads the DLL. In this case you might want to make a Delete() function so that you are freeing up the same size object that was allocated (of course, if the sizes were different, you'd have other crashing problems as well). Jeffrey "botman" Broome _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders