home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4728 < prev    next >
Encoding:
Text File  |  1993-01-07  |  2.0 KB  |  58 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!rsoft!mindlink!a4185
  3. From: Steve_Goyette@mindlink.bc.ca (Steve Goyette)
  4. Subject: Undefined Dynalink HELP
  5. Organization: MIND LINK! - British Columbia, Canada
  6. Date: Fri, 8 Jan 1993 01:06:07 GMT
  7. Message-ID: <19349@mindlink.bc.ca>
  8. Sender: news@deep.rsoft.bc.ca (Usenet)
  9. Lines: 47
  10.  
  11. Hi All,
  12.  
  13.         I am trying to modify the printer setup by calling the ExtDeviceMode
  14. function.  Problem is that on some machines I get an Undefined DYNALINK
  15. message.  Does anybody know what this is?  Here is the code fragment that I
  16. am using:
  17.  
  18.         char szPrinter[64],
  19. szSysDir[128],szFullDriver[256],*szDriver,*szDevice,*szOutput;
  20.         HANDLE hDriver;
  21.         DEVMODE DevMode;
  22.         LPFNDEVMODE lpDeviceMode;
  23.  
  24.         GetProfileString("windows","device","",szPrinter,64);
  25.         szDevice = strtok(szPrinter,",");
  26.         szDriver = strtok(NULL,",");
  27.         szOutput = strtok(NULL,",");
  28.  
  29.         GetSystemDirectory(szSysDir,128);
  30.         lstrcpy(szFullDriver,szSysDir);
  31.         lstrcat(szFullDriver,"\");
  32.         lstrcat(szFullDriver,szDriver);
  33.         lstrcat(szFullDriver,".DRV");
  34.  
  35.         hDriver = LoadLibrary(szFullDriver);
  36.         if (hDriver != NULL)
  37.         {
  38.  
  39.                 lpDeviceMode =
  40. (LPFNDEVMODE)GetProcAddress((HINSTANCE)hDriver,"ExtDeviceMode");
  41.                 if (lpDeviceMode)
  42.                         (* lpDeviceMode)
  43. (HWindow,(HINSTANCE)hDriver,&DevMode,szDevice,szOutput,NULL,NULL,DM_PROMPT |
  44. DM_UPDATE);
  45.         }
  46.         else
  47.                 MessageBox(HWindow,"Could not load driver
  48. file.","Error",MB_OK | MB_ICONEXCLAMATION);
  49.  
  50. --
  51. ------------------------------------------------------------------------------
  52.  
  53. Steve Goyette                    |       Email : Steve_Goyette@MindLink.BC.CA
  54. Software Engineer                |       Cserve: 71763,1435
  55. Abstract Automation Limited      |       Phone : (604) 421-8864
  56.                                  |       Fax   : (604) 421-7722 (Call first)
  57. -------------------------------------
  58.