Click here to Skip to main content
15,921,062 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFAQ for an interview in Multithreading/C++ Pin
AryaSoft22-May-06 16:05
AryaSoft22-May-06 16:05 
AnswerRe: FAQ for an interview in Multithreading/C++ Pin
kumar_mk22-May-06 17:46
kumar_mk22-May-06 17:46 
AnswerRe: FAQ for an interview in Multithreading/C++ Pin
AryaSoft23-May-06 7:45
AryaSoft23-May-06 7:45 
AnswerRe: FAQ for an interview in Multithreading/C++ Pin
Laxman Auti22-May-06 18:13
Laxman Auti22-May-06 18:13 
AnswerRe: FAQ for an interview in Multithreading/C++ Pin
AryaSoft23-May-06 7:46
AryaSoft23-May-06 7:46 
QuestionAdd and Remove Program Pin
_anil_22-May-06 16:03
_anil_22-May-06 16:03 
QuestionEnumDisplayDevices Pin
zaro33322-May-06 15:39
zaro33322-May-06 15:39 
AnswerRe: EnumDisplayDevices Pin
_anil_22-May-06 16:41
_anil_22-May-06 16:41 
Hi Though I can't exactly tell why the problem is occoring some of the resons are

UNICODE and WINVER definations. If you go to winuser.h you can see the defination of EnumDisplayDevice.
you can try as MSDN way. that is dynamically loding the funtion from DLL.

<br />
BOOL GetDisplayMonitorInfo(int nDeviceIndex, LPSTR lpszMonitorInfo)<br />
{<br />
    FARPROC EnumDisplayDevices;<br />
    HINSTANCE  hInstUser32;<br />
    DISPLAY_DEVICE DispDev; <br />
    char szSaveDeviceName[32];<br />
    BOOL bRet = TRUE;<br />
    <br />
    hInstUser32 = LoadLibrary("User32.DLL");<br />
    if (!hInstUser32) return FALSE;  <br />
    <br />
    // Get the address of the EnumDisplayDevices function<br />
    EnumDisplayDevices = (FARPROC)GetProcAddress(hInstUser32,"EnumDisplayDevicesA");<br />
    if (!EnumDisplayDevices) {<br />
        FreeLibrary(hInstUser32);<br />
        return FALSE;<br />
    }<br />
<br />
    ZeroMemory(&DispDev, sizeof(DISPLAY_DEVICE));<br />
    DispDev.cb = sizeof(DISPLAY_DEVICE); <br />
    <br />
    // After the first call to EnumDisplayDevices, <br />
    // DispDev.DeviceString is the adapter name<br />
    if (EnumDisplayDevices(NULL, nDeviceIndex, &DispDev, 0)) {  <br />
        lstrcpy(szSaveDeviceName, DispDev.DeviceName);<br />
        <br />
        // After second call, DispDev.DeviceString is the <br />
        // monitor name for that device <br />
        EnumDisplayDevices(szSaveDeviceName, 0, &DispDev, 0);   <br />
        <br />
        lstrcpy(lpszMonitorInfo, DispDev.DeviceString);<br />
    } else    {<br />
        bRet = FALSE;<br />
    }<br />
<br />
    FreeLibrary(hInstUser32);<br />
<br />
    return bRet;<br />
}<br />
<br />


Regards
Anil
AnswerRe: EnumDisplayDevices Pin
zaro33323-May-06 4:56
zaro33323-May-06 4:56 
GeneralRe: EnumDisplayDevices Pin
zaro33323-May-06 4:58
zaro33323-May-06 4:58 
GeneralRe: EnumDisplayDevices Pin
zaro33323-May-06 5:01
zaro33323-May-06 5:01 
GeneralRe: EnumDisplayDevices [modified] Pin
_anil_23-May-06 15:05
_anil_23-May-06 15:05 
AnswerRe: EnumDisplayDevices [modified] Pin
zaro33324-May-06 4:14
zaro33324-May-06 4:14 
QuestionEmbedded Chart Missing X-Axis Scale Pin
Jenleonard22-May-06 15:38
Jenleonard22-May-06 15:38 
QuestionC++ vs C# Performance Pin
Ed K22-May-06 14:37
Ed K22-May-06 14:37 
AnswerRe: C++ vs C# Performance [modified] Pin
Nibu babu thomas22-May-06 17:14
Nibu babu thomas22-May-06 17:14 
AnswerRe: C++ vs C# Performance Pin
bob1697222-May-06 17:15
bob1697222-May-06 17:15 
GeneralRe: C++ vs C# Performance Pin
Ed K23-May-06 14:06
Ed K23-May-06 14:06 
AnswerRe: C++ vs C# Performance Pin
Ryan Binns22-May-06 18:32
Ryan Binns22-May-06 18:32 
GeneralRe: C++ vs C# Performance Pin
Ed K23-May-06 14:09
Ed K23-May-06 14:09 
QuestionProcessShellCommand and DDE [modified] Pin
tbrake22-May-06 13:07
tbrake22-May-06 13:07 
AnswerRe: ProcessShellCommand and DDE [modified] Pin
Ryan Binns22-May-06 18:33
Ryan Binns22-May-06 18:33 
QuestionApplication Crash Pin
jduff22-May-06 11:36
jduff22-May-06 11:36 
AnswerRe: Application Crash [modified] Pin
Stephen Hewitt22-May-06 13:58
Stephen Hewitt22-May-06 13:58 
AnswerRe: Application Crash Pin
Stephen Hewitt24-May-06 21:28
Stephen Hewitt24-May-06 21:28 

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.