🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12096

DPtoLP

#12096
From: M. Finch
Date: Fri, 26 Dec 2003 19:32
45 lines
2060 bytes
Hello,

I seem to be missing how the DPtoLP function works.  I am using

POINT pt;
    .
    .
    .
  case WM_MOUSEMOVE:

        pt.x = (LONG)LOWORD(lParam);
        pt.y = (LONG)HIWORD(lParam);

        SetMapMode(hDC,MM_ANISOTROPIC);
        SetWindowExtEx(hDC, xwin,ywin,NULL);
        SetViewportExtEx(hDC,width,-height,NULL);

// Mouse moves are stored in pt.x and pt.y in DEVICE COORDINATES??
// Using the DPtoLP function should return their coordinates in LOGICAL
COORDINATES??

        retval = DPtoLP(hDC, &pt, 1);
        reterr = GetLastError();
      .
      .
      .

I find that I get an error in the retval and I retrieve the error using
GetLastError() which is 87.  87 is Invalid Parameter as defined in System
Error Codes on MSDN.

????

Anyone have any ideas on what is causing the error?
Should I expect that the coordinates returned are
    pt.x = pt.x * (xwin / width)
    pt.y = pt.y * (ywin / height)

which are the device coordinates times  the ratio of logical to device
coordinates??


Thanks in advance.

Mike Finch
Technical Details
Message-ID: <3fec8cda$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,51ae0f0f4731a002,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-26 11:39:23 PST
Reply-To: "M. Finch" <mlfsup@nospam.comcast.net>
From: "M. Finch" <mlfsup@nospam.comcast.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: DPtoLP
Date: Fri, 26 Dec 2003 14:32:43 -0500
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 68.51.77.211
Message-ID: <3fec8cda$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1072467162 68.51.77.211 (26 Dec 2003 11:32:42 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail