|
Thanks for the info. But I already tried this with the same result.
result = EnumDisplaySettings(lpdParams.DeviceName,0,&lpDMode);
where lpdParams is DISPLAY_DEVICE variable that has been populated with data returned from
EnumDisplayDevices(NULL, 1, &lpdParams, EDD_GET_DEVICE_INTERFACE_NAME);
Not sure where I am doing wrong.
thanks
PKNT
|
|
|
|
|
Do you have some sort of loop set up for this? Something like:
int result = -1;
for (int x = 0; result != 0; x++)
result = EnumDisplaySettings(lpdParams.DeviceName, x, &lpDMode);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I have no loops for this functions. This function is called the same way I noted earlier after EnumDisplayDevices() only once.
thanks
PKNT
|
|
|
|
|
Kiran Satish wrote: I have no loops for this functions.
My bad. I just assumed when _AnsHUMAN_ suggested the same thing, that your "But I already tried this..." reply meant you were using a loop of some sort.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I found out that this problem is only on Windows 7, the function ran fine on XP. Any ideas about this issue on win7??
thanks
PKNT
|
|
|
|
|
Kiran Satish wrote: Any ideas about this issue on win7??
UAC, perhaps?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
UAC on my system is turned off. So, I guess its not causing the problem as the first function runs fine.
thanks
PKNT
|
|
|
|
|
Hello Friends,
I am planning to do MCTS: .NET Framework 4, Windows Applications and I was searching for study materials or dumps. Friends kindly help me if you have any study materials or dumps for this certification.
Regards,
S.Shanmugaraja
|
|
|
|
|
And you ask it at the native C++ forum?
Veni, vidi, vici.
|
|
|
|
|
Why are you asking here? This is a Microsoft certification so go to the Microsoft web site and search there.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
Why do you need dumps. Dumps are the worst thing when it comes to certification. they take away the motivation for studies and i as i keep saying(learning is what matters the most in our profession)
|
|
|
|
|
Can be obtained?
Generally storage devices.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
|
Hi,
What would be the best way to extract an array of strings (only the first strings separated by a "," ) encapsulated within the curly braces ( { } )from within a file...?
Eg: Test.txt
***************************
This is also in the text file
{ abc def ghi ,
jkl mno pqr ,
stu vwl yza ,
}
This is also in the text file
*****************************
I only want "abc" "jkl" and "stu" in an array..
Thanks,
Faez
|
|
|
|
|
What have you done so far??
|
|
|
|
|
int main()
{
char *buf[1024], *tok;
FILE *fp1, *fp2;
fp1=fopen("test.txt","r+");
fp2=fopen("newtest.txt","w+");
while(fgets(buf, bufsize, fp1) != NULL)
{
for(tok = strtok(buf,"{");tok !="}";)
{
fprintf(fp2, "%s",buf);
}
}
fclose(fp2);
fclose(fp1);
}
modified 10-Feb-12 0:03am.
|
|
|
|
|
Please use <pre> tags round your code (you can edit the above message) as it makes it so much easier to read.
Your call to strtok() should use a pattern of all the characters you wish to ignore, you can then use the first returned token on each line, something like:
while(fgets(buf, bufsize, fp1) != NULL)
{
tok = strtok(buf,"{ ,}");
if (tok != NULL)
printf("Token: %s\n", tok);
}
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Did you really intend for buf to be an array of pointers?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Well spotted!
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Lovely..! This program works like a charm.... But now I am getting some extra unwanted strings too till the point I wanto extract the needed string..
My new o/p file now look like
Token: DCLGEN
Token: LIBRARY
Token: ACTION
Token: LANGUAGE
Token: NAMES
Token: QUOTE
Token: COLSUFFIX
Token: IS
Token: EXEC
Token: POLICY_NO
Token: REG_NO
Token: EFFECTIVE_DATE
Token: EXPIRY_DATE
Token: CAN_EFF_DATE
Token: CAN_PRO_DATE
Token: RETURN_PREMIUM
Token: CAN_PROCESSED
Token: END-EXEC
But I want the strings only after EXEC and before END-EXEC... ie from POLICY_NO to CAN_PROCESSED... I tried using
while(strcmp("EXEC",tok))
but it ain't working .. :-/
Thanks in advance,
Faez
modified 10-Feb-12 0:05am.
|
|
|
|
|
Try this:
BOOL bCapture = FALSE; while(fgets(buf, bufsize, fp1) != NULL)
{
tok = strtok(buf,"{ ,}");
if (tok != NULL)
{
if (bCapture == FALSE)
{
if (strcmp(tok, "EXEC") == 0)
bCapture = TRUE;
}
else {
if (strcmp(tok, "END-EXEC") == 0)
bCapture = FALSE;
else
printf("Token: %s\n", tok);
}
}
}
[edit]Fixed the "END-EXEC" string, thanks to Carlo for pointing it out.[/edit]
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
modified 10-Feb-12 6:56am.
|
|
|
|
|
My 5, though your code, as it stands, wouldn't match the-requirements.
Veni, vidi, vici.
|
|
|
|
|
I wrote it over breakfast; what's missing?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Nothing is missing, however an underscore is not an hyphen.
--Carlo The Nitpick.
Veni, vidi, vici.
|
|
|
|