Click here to Skip to main content
15,923,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Thread issue Pin
basementman3-Jun-04 6:40
basementman3-Jun-04 6:40 
GeneralRe: Thread issue Pin
John M. Drescher3-Jun-04 7:33
John M. Drescher3-Jun-04 7:33 
Generalmemory allocation Pin
Gérald Mercet3-Jun-04 4:42
Gérald Mercet3-Jun-04 4:42 
GeneralRe: memory allocation Pin
jmkhael3-Jun-04 5:45
jmkhael3-Jun-04 5:45 
GeneralRe: SetForegroundWindow() to a Message-Window prevents a later popped parentless-modal-dialog from showing Pin
Blake Miller3-Jun-04 3:33
Blake Miller3-Jun-04 3:33 
GeneralBeginner registry problem Pin
Scozturk3-Jun-04 3:03
professionalScozturk3-Jun-04 3:03 
GeneralRe: Beginner registry problem Pin
Dominik Reichl3-Jun-04 3:12
Dominik Reichl3-Jun-04 3:12 
GeneralRe: Beginner registry problem Pin
David Crow3-Jun-04 4:12
David Crow3-Jun-04 4:12 
Scolinks wrote:
But I have difficulties using the RegQueryValue functions.
I found some examples on the net but they all use CString and I cant use it because I dont write in MFC...


There are plenty of MSDN examples that do not use MFC. Here's but one:

#define RTN_UNKNOWN 0
#define RTN_SERVER 1
#define RTN_WORKSTATION 2
#define RTN_NTAS 3
#define RTN_ERROR 13
 
DWORD GetWindowsVariant(void)
{
    #define MY_BUFSIZE 32    // Arbitrary initial value. 
                             // Dynamic allocation will be used.
    HKEY hKey;
    TCHAR szProductType[MY_BUFSIZE];
    DWORD dwBufLen = MY_BUFSIZE;
    LONG lRet;
 
    if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
        TEXT("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"),
                    0,
                    KEY_QUERY_VALUE,
                    &hKey) != ERROR_SUCCESS) return RTN_ERROR;
 
    lRet = RegQueryValueEx(hKey,
                    TEXT("ProductType"),
                    NULL,
                    NULL,
                    (LPBYTE)szProductType,
                    &dwBufLen);
 
    RegCloseKey(hKey);
 
    if(lRet != ERROR_SUCCESS) return RTN_ERROR;
 
    // check product options, in order of likelihood
    if(lstrcmpi(TEXT("WINNT"), szProductType) == 0) 
         return RTN_WORKSTATION;
    if(lstrcmpi(TEXT("SERVERNT"), szProductType) == 0) 
         return RTN_SERVER;
    if(lstrcmpi(TEXT("LANMANNT"), szProductType) == 0) 
         return RTN_NTAS;
    // else return "unknown variant" code
    else return RTN_UNKNOWN;
}
Here are some searches returned from Google:

http://www.windowsitlibrary.com/Content/69/07/1.html

http://www.geocities.com/merijn_bellekom/new/win9xcpu.html

http://www.pc-magazin.de/common/forum/forum.php?id=30000624&forum=30&dsp_start=120&expand=1&suchwort=




"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen


Generalcasting a vector Pin
Jerome Conus3-Jun-04 2:33
Jerome Conus3-Jun-04 2:33 
GeneralRe: casting a vector Pin
cgott3-Jun-04 3:07
cgott3-Jun-04 3:07 
GeneralRe: casting a vector Pin
John M. Drescher3-Jun-04 8:03
John M. Drescher3-Jun-04 8:03 
GeneralRe: casting a vector Pin
Jerome Conus3-Jun-04 19:09
Jerome Conus3-Jun-04 19:09 
GeneralRe: casting a vector Pin
Johnny ²3-Jun-04 21:41
Johnny ²3-Jun-04 21:41 
GeneralRe: casting a vector Pin
John M. Drescher4-Jun-04 7:52
John M. Drescher4-Jun-04 7:52 
GeneralNeed help urgent please! Pin
12ed23gv54ha46rdsg6543-Jun-04 2:25
12ed23gv54ha46rdsg6543-Jun-04 2:25 
GeneralRe: Need help urgent please! Pin
David Crow3-Jun-04 4:17
David Crow3-Jun-04 4:17 
GeneralRe: Need help urgent please! Pin
Rick York3-Jun-04 6:59
mveRick York3-Jun-04 6:59 
GeneralChanging colors in VS6 image editor Pin
dart133-Jun-04 2:25
dart133-Jun-04 2:25 
GeneralSetButtonText on toolbar in DLL acts strange Pin
wimvhouts3-Jun-04 2:13
wimvhouts3-Jun-04 2:13 
GeneralToolbars with Drag/Drop functionality Pin
raed3-Jun-04 2:05
raed3-Jun-04 2:05 
GeneralRe: Toolbars with Drag/Drop functionality Pin
Iain Clarke, Warrior Programmer3-Jun-04 4:22
Iain Clarke, Warrior Programmer3-Jun-04 4:22 
GeneralRe: Toolbars with Drag/Drop functionality Pin
raed3-Jun-04 4:45
raed3-Jun-04 4:45 
GeneralRe: Toolbars with Drag/Drop functionality Pin
Iain Clarke, Warrior Programmer3-Jun-04 5:31
Iain Clarke, Warrior Programmer3-Jun-04 5:31 
QuestionThe character we get in a mouse position? Pin
golfbear3-Jun-04 1:56
golfbear3-Jun-04 1:56 
AnswerRe: The character we get in a mouse position? Pin
jmkhael3-Jun-04 2:06
jmkhael3-Jun-04 2:06 

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.