Prev: CFtpConnection GetFile cause memory leaking. Why?
Next: Fatal error LNK1104:File "C:\Programme\Microsoft.obj"can not be opened!!
From: George on 21 Nov 2007 03:05 Hello everyone, The PRIVATE keyword of module definition file (.DEF) means, http://msdn2.microsoft.com/en-us/library/hyx1zcd3(vs.80).aspx -------------------- The optional keyword PRIVATE prevents entryname from being placed in the import library generated by LINK. It has no effect on the export in the image also generated by LINK. -------------------- My questions are, 1. Does it has any practical usage to prevent the exported function from import library file? 2. If the exported function is not in the import library file, then other component has to use LoadLibrary and GetProcAddress to use the DLL, other than using implicit link? thanks in advance, George
From: Ulrich Eckhardt on 21 Nov 2007 04:42 George wrote: > The PRIVATE keyword of module definition file (.DEF) means, > > http://msdn2.microsoft.com/en-us/library/hyx1zcd3(vs.80).aspx > > -------------------- > The optional keyword PRIVATE prevents entryname from being placed in the > import library generated by LINK. It has no effect on the export in the > image also generated by LINK. > -------------------- > > My questions are, > > 1. Does it has any practical usage to prevent the exported function from > import library file? Yes. I could imagine a plugin-like DLL exporting a certain interface (defined by the .DEF) but also additional interfaces which may or may not be there. IOW, the interface of the DLL is split in a guaranteed part (placed in the import lib) and an optional part (available via explicit linking methods). > 2. If the exported function is not in the import library file, then other > component has to use LoadLibrary and GetProcAddress to use the DLL, other > than using implicit link? Almost. You can still use implicit linking and then use GetProcAddress() to retrieve the pointers to the additional functions. Uli
From: George on 22 Nov 2007 01:25
Thanks Uli, > Yes. I could imagine a plugin-like DLL exporting a certain interface > (defined by the .DEF) but also additional interfaces which may or may not > be there. IOW, the interface of the DLL is split in a guaranteed part > (placed in the import lib) and an optional part (available via explicit > linking methods). Explicit linking methods you mean using LoadLibrary and GetProcAddress? regards, George "Ulrich Eckhardt" wrote: > George wrote: > > The PRIVATE keyword of module definition file (.DEF) means, > > > > http://msdn2.microsoft.com/en-us/library/hyx1zcd3(vs.80).aspx > > > > -------------------- > > The optional keyword PRIVATE prevents entryname from being placed in the > > import library generated by LINK. It has no effect on the export in the > > image also generated by LINK. > > -------------------- > > > > My questions are, > > > > 1. Does it has any practical usage to prevent the exported function from > > import library file? > > Yes. I could imagine a plugin-like DLL exporting a certain interface > (defined by the .DEF) but also additional interfaces which may or may not > be there. IOW, the interface of the DLL is split in a guaranteed part > (placed in the import lib) and an optional part (available via explicit > linking methods). > > > 2. If the exported function is not in the import library file, then other > > component has to use LoadLibrary and GetProcAddress to use the DLL, other > > than using implicit link? > > Almost. You can still use implicit linking and then use GetProcAddress() to > retrieve the pointers to the additional functions. > > Uli > > |