home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!rsoft!mindlink!a4185
- From: Steve_Goyette@mindlink.bc.ca (Steve Goyette)
- Subject: Undefined Dynalink HELP
- Organization: MIND LINK! - British Columbia, Canada
- Date: Fri, 8 Jan 1993 01:06:07 GMT
- Message-ID: <19349@mindlink.bc.ca>
- Sender: news@deep.rsoft.bc.ca (Usenet)
- Lines: 47
-
- Hi All,
-
- I am trying to modify the printer setup by calling the ExtDeviceMode
- function. Problem is that on some machines I get an Undefined DYNALINK
- message. Does anybody know what this is? Here is the code fragment that I
- am using:
-
- 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)
- -------------------------------------
-