Click here to Skip to main content
16,010,334 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Some basic C++ question... yes, I'm a newbie - sorry! Pin
V.18-Jul-04 21:28
professionalV.18-Jul-04 21:28 
GeneralMSFlexGrid Control Problem Pin
Naveed Shoaib18-Jul-04 12:56
Naveed Shoaib18-Jul-04 12:56 
GeneralRe: MSFlexGrid Control Problem Pin
Toni7818-Jul-04 16:23
Toni7818-Jul-04 16:23 
GeneralRe: MSFlexGrid Control Problem Pin
Toni7818-Jul-04 16:25
Toni7818-Jul-04 16:25 
GeneralRe: MSFlexGrid Control Problem Pin
V.18-Jul-04 21:10
professionalV.18-Jul-04 21:10 
Generalproblem with including headers Pin
Jump_Around18-Jul-04 12:54
Jump_Around18-Jul-04 12:54 
GeneralRe: problem with including headers Pin
Ravi Bhavnani18-Jul-04 13:28
professionalRavi Bhavnani18-Jul-04 13:28 
GeneralDetermining DPI Pin
JD Steffen18-Jul-04 11:41
JD Steffen18-Jul-04 11:41 
Hello all,

Got a small problem that I was hoping I could get some help on. Using the CView class I need to get the current screen DPI. I know that I can use the GetDeviceCaps method in the CDC class to get the current DPI. The problem is that I want to retreive the values and store them somewhere in a variable BEFORE CView's OnDraw method. For example I tried this in CView's constuctor:

CTestView::CTestView()
{
CDC *Test;

Test = GetDC();

PixPerInchX=Test->GetDeviceCaps(LOGPIXELSX);
PixPerInchY=Test->GetDeviceCaps(LOGPIXELSY);

ReleaseDC(Test);

}

PixPerInchX, and PixPerInchY are defined elsewhere as an INT.

When I run this, it ASSERT fails. I think that my Test pointer is coming up NULL. Any ideas?

(P.S. I'm not a very good programmer yet, so if this is stupidly obvious I apologize.)

Thanks,
JD
GeneralRe: Determining DPI Pin
Michael Dunn18-Jul-04 12:52
sitebuilderMichael Dunn18-Jul-04 12:52 
GeneralRe: Determining DPI Pin
JD Steffen19-Jul-04 23:50
JD Steffen19-Jul-04 23:50 
GeneralCRecordSet->MoveFirst() exception Pin
JabraJabra18-Jul-04 7:12
JabraJabra18-Jul-04 7:12 
GeneralRe: CRecordSet->MoveFirst() exception Pin
Toni7818-Jul-04 7:15
Toni7818-Jul-04 7:15 
GeneralRe: CRecordSet->MoveFirst() exception Pin
Scozturk18-Jul-04 7:23
professionalScozturk18-Jul-04 7:23 
GeneralRe: CRecordSet->MoveFirst() exception Pin
Alexander Wiseman18-Jul-04 9:05
Alexander Wiseman18-Jul-04 9:05 
GeneralLOGPEN Pin
Trollslayer18-Jul-04 6:47
mentorTrollslayer18-Jul-04 6:47 
GeneralRe: LOGPEN Pin
Trollslayer18-Jul-04 8:37
mentorTrollslayer18-Jul-04 8:37 
GeneralRe: LOGPEN Pin
Alexander Wiseman18-Jul-04 9:06
Alexander Wiseman18-Jul-04 9:06 
GeneralRe: LOGPEN - resource usage warning Pin
PJ Arends18-Jul-04 9:06
professionalPJ Arends18-Jul-04 9:06 
GeneralRe: LOGPEN Pin
Alexander Wiseman18-Jul-04 8:56
Alexander Wiseman18-Jul-04 8:56 
GeneralGet a pointer from an RVA Pin
Toni7818-Jul-04 6:43
Toni7818-Jul-04 6:43 
GeneralRe: Get a pointer from an RVA Pin
bikram singh19-Jul-04 12:55
bikram singh19-Jul-04 12:55 
GeneralProblem Creating a server on the local PC using CAsyncSocket Pin
femi ashiru18-Jul-04 6:42
femi ashiru18-Jul-04 6:42 
GeneralRe: Problem Creating a server on the local PC using CAsyncSocket Pin
valikac18-Jul-04 13:59
valikac18-Jul-04 13:59 
GeneralDirectory Date/Time Pin
Atlence18-Jul-04 4:04
Atlence18-Jul-04 4:04 
GeneralRe: Directory Date/Time Pin
Toni7818-Jul-04 7:32
Toni7818-Jul-04 7:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.