Click here to Skip to main content
15,928,111 members
Home / Discussions / COM
   

COM

 
Questionpreparing DISPPARAMS for a method?? Pin
Muhammad Azam24-Mar-05 19:00
Muhammad Azam24-Mar-05 19:00 
AnswerRe: preparing DISPPARAMS for a method?? Pin
Vi227-Mar-05 22:30
Vi227-Mar-05 22:30 
GeneralRe: preparing DISPPARAMS for a method?? Pin
Muhammad Azam27-Mar-05 22:47
Muhammad Azam27-Mar-05 22:47 
GeneralRe: preparing DISPPARAMS for a method?? Pin
Vi227-Mar-05 23:01
Vi227-Mar-05 23:01 
GeneralRe: preparing DISPPARAMS for a method?? Pin
Muhammad Azam27-Mar-05 23:06
Muhammad Azam27-Mar-05 23:06 
GeneralOpen excel woorbook in office xp 2002 with c# Pin
24-Mar-05 6:16
suss24-Mar-05 6:16 
GeneralUsing COM dll in C Pin
Monty223-Mar-05 23:54
Monty223-Mar-05 23:54 
GeneralRe: Using COM dll in C Pin
Jörgen Sigvardsson24-Mar-05 2:52
Jörgen Sigvardsson24-Mar-05 2:52 
A COM DLL is a regular DLL with some restrictions on it: It must export the 5 functions DllMain, DllCanUnloadNow, DllGetClassObject, DllRegisterServer and DllUnregisterServer. Technically, the last function isn't really needed to run COM stuff, but if you want to uninstall the COM DLL, it's nice to be able to remove references to it in the registry.

To load a DLL:
HMODULE hDLL = LoadLibrary(_T("the.dll"));
if(!hDLL) exit(-1); // Error!
To acquire a function pointer to a function inside the DLL:
void (*function)();
function = (void (*)())GetProcAddress(hDLL, "TheNameOfFunction");
if(!function) exit(-1); // Error!
function(); // Call it
And finally, if you are done with the DLL, and you wish to unload it, call
FreeLibrary(hDLL);
There's also LoadLibraryEx which might be interesting to have a look at.

Did I answer your question? The MSDN Library has all the information you need to manuall load and use DLLs.

--
My name in Katakana is ヨルゲン.
My name in German is Jörgen.
My name in Mandarin/Kanji is 乔尔根 西格瓦德森.
My name in Korean is 요르겐.

I blog too now[^]

GeneralRe: Using COM dll in C Pin
Monty224-Mar-05 5:20
Monty224-Mar-05 5:20 
GeneralRe: Using COM dll in C Pin
Jörgen Sigvardsson24-Mar-05 9:54
Jörgen Sigvardsson24-Mar-05 9:54 
GeneralRe: Using COM dll in C Pin
Mike Dimmick24-Mar-05 5:43
Mike Dimmick24-Mar-05 5:43 
GeneralRe: Using COM dll in C Pin
Monty224-Mar-05 7:22
Monty224-Mar-05 7:22 
GeneralQueryInterface calls Pin
GizzoF23-Mar-05 0:41
GizzoF23-Mar-05 0:41 
GeneralRe: QueryInterface calls Pin
ThatsAlok23-Mar-05 1:58
ThatsAlok23-Mar-05 1:58 
GeneralRe: QueryInterface calls Pin
GizzoF23-Mar-05 4:23
GizzoF23-Mar-05 4:23 
GeneralDCOM Server using in service Pin
Member 28664122-Mar-05 17:39
Member 28664122-Mar-05 17:39 
QuestionHow to make an ActiveX control can be copied and pasted in a Richedit control Pin
gxulg22-Mar-05 17:30
gxulg22-Mar-05 17:30 
GeneralGet text on screen Pin
levgiang22-Mar-05 0:31
levgiang22-Mar-05 0:31 
QuestionHow to make ICopyHook work ? Pin
khan++21-Mar-05 0:43
khan++21-Mar-05 0:43 
AnswerRe: How to make ICopyHook work ? Pin
khan++21-Mar-05 23:01
khan++21-Mar-05 23:01 
GeneralRe: How to make ICopyHook work ? Pin
Jörgen Sigvardsson22-Mar-05 4:37
Jörgen Sigvardsson22-Mar-05 4:37 
GeneralActiveX and events Pin
DaSharmXXX120-Mar-05 20:59
sussDaSharmXXX120-Mar-05 20:59 
GeneralParse Remote SSL Certificate Pin
AZinNC18-Mar-05 9:10
AZinNC18-Mar-05 9:10 
GeneralProblem with Word 2003 COM Add-in. Pin
Johannes Ackermann17-Mar-05 23:29
Johannes Ackermann17-Mar-05 23:29 
GeneralRe: Problem with Word 2003 COM Add-in. Pin
Johannes Ackermann23-Mar-05 23:14
Johannes Ackermann23-Mar-05 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.