Guest:
Register
|
Login
|
Member List
|
Statistics
|
FAQ
Minidx Support Forum
»
日本語ユーザ
» マルチモニタAPIを使用するときによく発生するエラー
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: マルチモニタAPIを使用するときによく発生するエラー
dingzhigang
Administrator
UID 2
Digest Posts 0
Credits 40
Posts 75
Reading Access 200
Registered 27-3-2007
Status Offline
#1
Post at 4-7-2007 07:39
Profile
|
Blog
|
P.M.
マルチモニタAPIを使用するときによく発生するエラー
Windowsにおいて、GetMonitorInfoやMonitorFromPointなどのマルチモニタAPIを使用するときによく発生するエラーと、その対処法を紹介します。
スクリーン上の座標x,yが属するモニタの情報を取得するため、以下のようなコードを書いたとします。
POINT Point = {x, y};
MONITORINFO MonitorInfo;
HMONITOR MonitorHandle = ::MonitorFromPoint(Point, MONITOR_DEFAULTTOPRIMARY);
MonitorInfo.cbSize = sizeof(MonitorInfo);
::GetMonitorInfo(MonitorHandle, &MonitorInfo);
特に変哲のない普通にコードですが、これだけのコードでもコンパイルエラーやリンクエラーに悩まされます。
最初に出会うのがこのコンパイルエラーです。
error C2065: 'MONITORINFO' : 定義されていない識別子です。
MOINTERINFOの説明(MSDN)を読むと、windows.hをインクルードするだけで良い様に思えますが、どうやらmultimon.hというヘッダファイルをインクルードする必要があるようです。
[Adv.]
Poll
Trade
Reward
Activity
Minidx Support Forum
Minidx
> English User
> 日本語ユーザ
> 中文用户
All times are GMT+8, the time now is 2-12-2008 07:27
Processed in 0.320419 second(s), 7 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
Minidx Inc
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team