I don’t know why but I thought I could statically link a function from an Import Library. It would seem I am the only one who has ever tried because I can’t for the life of me find a similar post. Is there a way to selectively static link functions from a dynamically linked project without creating a new project and/or recompiling it as static? The module itself communicates over an interface and I’m not really big on exporting functions. I just want to static link the code to create the object….
how bad would it be to turn this into a macro?
IClassFactory* CF = NULL;
hr = CoGetClassObject (
CLSID_CF,
CLSCTX_INPROC_SERVER,
NULL,
IID_IClassFactory,
(void**)&CF );
Interface* Instance = NULL;
hr = CF->CreateInstance (
NULL,
IID_Interface,
(void**)&Instance );
If this is your own project (or you have source code and are willing to modify it), you could use
inlinefunctions for the functions you don’t want to dynamically link.