Thread: I need Windows MulDiv but for 64 bit.

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    96

    I need Windows MulDiv but for 64 bit.

    For 32 bit systems I can use the function, MulDiv to convert the screen resolution to the printer (or any device) resolution.

    For my purposes, I need to convert my computer screen's points to my printer's points. In this case I use the printer's Y resolution to get the height I need.

    The function is as follows:
    Code:
    MulDiv(longPoints, GetDeviceCaps(resource->dc, LOGPIXELSY), 72)
    NOTE that 72 points = 1 inch.

    This works for a 32 bit system, but not for a 64 bit system.
    I need something like a MulDiv64 function that will do the same job but for 64 bit systems.

    I've read suggestions to use '64 bit math'.
    I found a library for MulDiv64.
    My compiler sees and compiles these files just fine if my code never calls MulDiv64.
    I get a compile time error (unresolved external symbol MulDiv64 referenced) when my code calls MulDiv64.
    Code:
    int64_t nRtn = MulDiv64(12, 300, 72);
    I'm compiling in VS 2015 using php compiler files & nmake.
    This is a php extension for printing documents.

    If I could just get help making the MulDiv64 library work that might suffice.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,534
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Access Windows directory with OPENFILENAME in Windows mobile
    By nikhilesh1987 in forum Windows Programming
    Replies: 2
    Last Post: 05-31-2011, 02:49 AM
  2. Differences between Windows XP and Windows Vista programming
    By nathan3011 in forum Windows Programming
    Replies: 3
    Last Post: 01-15-2009, 10:05 AM
  3. Open an excel file from a windows service under Windows Vista
    By AdrianaLuby in forum C# Programming
    Replies: 1
    Last Post: 06-05-2007, 03:55 AM
  4. Replies: 4
    Last Post: 10-03-2005, 04:44 PM
  5. Replies: 6
    Last Post: 01-07-2002, 02:46 AM

Tags for this Thread