Menu

problem with winspool.dll (or winspool.drv)

Help
Tom Bishop
2003-07-04
2012-10-07
  • Tom Bishop

    Tom Bishop - 2003-07-04

    Hi,

    The following very small program compiled with MinGW ran fine on Win95 but said "Error while loading DLL 'winspool.dll'" when running on NT4. I was able to solve the problem with these dubious commands:

    cd \winnt\system32
    copy winspool.drv winspool.dll

    (There was no winspool.dll file before this.)

    But, it's not OK to ask our customers to mess around with files in the system folder. I notice that libunicows.a contains "winspool.dll"; should it be "winspool.drv", or is some other change needed to the library?

    (begin file "test.c")
    #include <windows.h>
    #include <winspool.h>

    int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
    PSTR szCmdLine, int iCmdShow)
    {
    DWORD needed, returned;

    MessageBox (NULL, TEXT ("Hello!"), TEXT ("test"), 0) ;
    EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 4, NULL, 0, &needed, &returned);
    MessageBox (NULL, TEXT ("Goodbye!"), TEXT ("test"), 0) ;
    return 0 ;
    }
    (end file "test.c")

    (begin "makefile")
    CC = gcc
    CFLAGS = -DUNICODE=1 -s -O6 -mwindows -Wall -Wshadow -g
    CLIBS = -L.. -lunicows -lwinmm -lwinspool
    OBJS = test.o
    test.exe: $(OBJS)
    $(CC) $(CFLAGS) $(OBJS) -o $@ $(CLIBS)
    (end "makefile")

    I make this on a Win95 machine using MinGW. Then I move "text.exe" to the NT machine, and run it. It does the "Hello" dialog, then gives the same error message: "Error while loading DLL 'winspool.dll'".

    Thanks in advance for any help.

    Tom

     
    • Tom Bishop

      Tom Bishop - 2003-07-07

      I re-built libunicows.a from the source, after editing unicows_import.c, only changing "winspool.dll" to "winspool.drv". This does seem to have solved the problem.

      It seems that either name, .dll or .drv, works on Win95, but only .drv works on NT; the actual file is named .drv on both operating systems.

       
      • Vaclav Slavik

        Vaclav Slavik - 2003-07-16

        Thanks a lot! Fixed now.

         

Log in to post a comment.

MongoDB Logo MongoDB