home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!agate!rsoft!mindlink!a4185
- From: Steve_Goyette@mindlink.bc.ca (Steve Goyette)
- Subject: Undefinied Dynalink ... The Sequel
- Organization: MIND LINK! - British Columbia, Canada
- Date: Fri, 8 Jan 1993 01:09:05 GMT
- Message-ID: <19351@mindlink.bc.ca>
- Sender: news@deep.rsoft.bc.ca (Usenet)
- Lines: 43
-
- Sorry, but I think that my editor screwed up the code fragment, so here it is
- again:
-
- char szPrinter[64],
- szSysDir[128],szFullDriver[256],*szDriver,*szDevice,*szOutput;
- HANDLE hDriver;
- DEVMODE DevMode;
- LPFNDEVMODE lpDeviceMode;
-
- GetProfileString("windows","device","",szPrinter,64);
- szDevice = strtok(szPrinter,",");
- szDriver = strtok(NULL,",");
- szOutput = strtok(NULL,",");
-
- GetSystemDirectory(szSysDir,128);
- lstrcpy(szFullDriver,szSysDir);
- lstrcat(szFullDriver,"\");
- lstrcat(szFullDriver,szDriver);
- lstrcat(szFullDriver,".DRV");
-
- hDriver = LoadLibrary(szFullDriver);
- if (hDriver != NULL)
- {
-
- lpDeviceMode =
- (LPFNDEVMODE)GetProcAddress((HINSTANCE)hDriver,"ExtDeviceMode");
- if (lpDeviceMode)
- (* lpDeviceMode)
- (HWindow,(HINSTANCE)hDriver,&DevMode,szDevice,szOutput,NULL,NULL,DM_PROMPT |
- DM_UPDATE);
- }
- else
- MessageBox(HWindow,"Could not load driver
- file.","Error",MB_OK | MB_ICONEXCLAMATION);
-
- --
- ------------------------------------------------------------------------------
-
- Steve Goyette | Email : Steve_Goyette@MindLink.BC.CA
- Software Engineer | Cserve: 71763,1435
- Abstract Automation Limited | Phone : (604) 421-8864
- | Fax : (604) 421-7722 (Call first)
- -------------------------------------
-