Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!mms00786 From: mms00786@uxa.cso.uiuc.edu Newsgroups: comp.windows.ms Subject: FAR functions and float types Message-ID: <246400022@uxa.cso.uiuc.edu> Date: 11 Sep 89 04:30:00 GMT Lines: 46 Nf-ID: #N:uxa.cso.uiuc.edu:246400022:000:1809 Nf-From: uxa.cso.uiuc.edu!mms00786 Sep 10 23:30:00 1989 Ok, I have wasted an entire weekend, so I hope wasting a little bandwidth is ok. I am trying to write a medium model Windows program. I have certain functions that are in seperate modules (obj files), and I need to call one from the other. Here's what happens: a) if I declare something like void FAR fnPlotSegment (hWnd, fFromX, fToX) HWND hWnd; float fFromX; float fToX; {...} then I am unable to pass the float type arguments! Everything compiles, runs, etc. but if I try to print the float values passed in, they are always 0.0! b) if I declare something like void FAR PASCAL fnPlotSegment ... then windows crashes the first time I call it! As in, no warning, lets go back to the C prompt and destroy the contents of the cmos setup too! c) but the declaration void FAR fnPlotAnalog (hWnd, fFromX, fToX) HWND hWnd; double fFromX; double fToX; {....} works without a glitch! The only problem is that with this solution, I am unable to sleep, because the only way I can explain it is that I am getting lucky with the "double" declaration, and its going to crash on Tuesdays with a lunar eclipse when the Panda bear at the zoo get pneumonia. Can someone please explain what I am doing wrong, or why any of the above makes sense? I am using the medium model, but the small model has the same symptoms. I am also compiling using the same line options that Petzold uses in his sample make files. I am using MSC 5.0. I have scanned K&R and parts of the MSC manuals, but the only difference between float and double should be the precision. I am also having incredible problems trying to pass user defined types as arguments to functions - as in just can't do it. Please help before I flunk out of school. Thanks, Milan mms00786@uxa.cso.uiuc.edu .