Thread: I need Windows MulDiv but for 64 bit.

  1. #1
    Registered User
    Join Date
    Feb 2011

    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:
    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.
    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
    The edge of the known universe

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
  2. Differences between Windows XP and Windows Vista programming
    By nathan3011 in forum Windows Programming
    Replies: 3
    By AdrianaLuby in forum C# Programming
    Replies: 1
  4. Replies: 4
  5. Replies: 6

Tags for this Thread