www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Does implib /s switch work?

reply A. Fontana <A._member pathlink.com> writes:
Using 

implib /s C:\......\msvfw32.lib c:\.......\msvfw32.dll

the file msvfw32.lib is generated but there's no "_" prepend to import function.
Linker gives me errors (becouse it can't find some functions). On my partial
compiled file there's a reference for msvfw32.dll but all functions are defined
without "_" !

A. Fontana
Feb 22 2006
parent reply Bertel Brander <bertel post4.tele.dk> writes:
A. Fontana wrote:
 Using 
 
 implib /s C:\......\msvfw32.lib c:\.......\msvfw32.dll
 
 the file msvfw32.lib is generated but there's no "_" prepend to import
function.
 Linker gives me errors (becouse it can't find some functions). On my partial
 compiled file there's a reference for msvfw32.dll but all functions are defined
 without "_" !

Yes, it works. Building the .lib with this command: implib.exe /s msvfw32.lib C:\WINDOWS\system32\msvfw32.dll I can create this program: #include <windows.h> extern "C" { BOOL GetOpenFileNamePreview(LPOPENFILENAME lpofn); } void OnFileOpen() { static char Filter[] = "jpg (*.jpg)\0*.jpg\0All (*.*)\0*.*\0"; char CurrentFileName[1024]; OPENFILENAME OpenFilename; memset(&OpenFilename, 0, sizeof(OpenFilename)); OpenFilename.lStructSize = sizeof(OpenFilename); OpenFilename.hwndOwner = 0; OpenFilename.hInstance = 0; OpenFilename.lpstrFilter = Filter; OpenFilename.lpstrFile = CurrentFileName; OpenFilename.nMaxFile = sizeof(CurrentFileName); OpenFilename.Flags = OFN_FILEMUSTEXIST; OpenFilename.lpstrDefExt = "txt"; if(GetOpenFileNamePreview(&OpenFilename)) { } } int main() { OnFileOpen(); } And compile it with: dmc ofn.cpp msvfw32.lib And it works. -- Absolutely not the best homepage on the net: http://home20.inet.tele.dk/midgaard But it's mine - Bertel
Feb 22 2006
parent reply A. Fontana <A._member pathlink.com> writes:
In article <dtj01q$hik$1 digitaldaemon.com>, Bertel Brander says...
A. Fontana wrote:
 Using 
 
 implib /s C:\......\msvfw32.lib c:\.......\msvfw32.dll
 
 the file msvfw32.lib is generated but there's no "_" prepend to import
function.
 Linker gives me errors (becouse it can't find some functions). On my partial
 compiled file there's a reference for msvfw32.dll but all functions are defined
 without "_" !

Yes, it works. Building the .lib with this command: implib.exe /s msvfw32.lib C:\WINDOWS\system32\msvfw32.dll I can create this program: #include <windows.h> extern "C" { BOOL GetOpenFileNamePreview(LPOPENFILENAME lpofn); } void OnFileOpen() { static char Filter[] = "jpg (*.jpg)\0*.jpg\0All (*.*)\0*.*\0"; char CurrentFileName[1024]; OPENFILENAME OpenFilename; memset(&OpenFilename, 0, sizeof(OpenFilename)); OpenFilename.lStructSize = sizeof(OpenFilename); OpenFilename.hwndOwner = 0; OpenFilename.hInstance = 0; OpenFilename.lpstrFilter = Filter; OpenFilename.lpstrFile = CurrentFileName; OpenFilename.nMaxFile = sizeof(CurrentFileName); OpenFilename.Flags = OFN_FILEMUSTEXIST; OpenFilename.lpstrDefExt = "txt"; if(GetOpenFileNamePreview(&OpenFilename)) { } } int main() { OnFileOpen(); } And compile it with: dmc ofn.cpp msvfw32.lib And it works. -- Absolutely not the best homepage on the net: http://home20.inet.tele.dk/midgaard But it's mine - Bertel

Hey you didn't use any function inside lib :) Try to define one of them!
Feb 23 2006
parent Bertel Brander <bertel post4.tele.dk> writes:
A. Fontana wrote:
 
 Hey you didn't use any function inside lib :) Try to define one of them!
 

The code use GetOpenFileNamePreview. If I don't link to msvfw32.lib I get: ofn.obj(ofn) Error 42: Symbol Undefined _GetOpenFileNamePreview So I think I use GetOpenFileNamePreview from the lib/dll. -- Absolutely not the best homepage on the net: http://home20.inet.tele.dk/midgaard But it's mine - Bertel
Feb 23 2006