|
Hello,
When I try to run the following program on any of the OS, except 64-bit windows versions, I don't have any problem, but if I try to run the program on 64-bit system, I don't call fails with error no. 3.
My specific requirement is to get the contents of the following directory
under Windows 64 - XP it is= "C:\windows\system32\config". I face problem only when accessing this directory, I could access all the other directories.
I tried this using Visual Studio 2005.
Following are the code lines
WIN32_FIND_DATAW pTempFind;
mbstowcs(szTemp, "C:\\WINDOWS\\system32\\config\\*", 256);
hFile = FindFirstFileW(szTemp, &pTempFind);
Can someone pls. tell me what could be the reason for this? any solution is highly appreciated.
Regards,
Adi
|
|
|
|
|
Do you have appropriate permission for that folder?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Yes.
But the problem is that, this happens only on 64-bit system. I tried this with administrative login also, but then also it fails.
If I write the VB.NET applications, i.e. using the Open Dialog, then it shows me this folder.
So what could be the problem?
Regards,
Adi
|
|
|
|
|
If FindFirstFile() is failing and GetLastError() is returning 3, that equates to ERROR_PATH_NOT_FOUND .
AdiBhapse wrote: So what could be the problem?
What does mbstowcs() return?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How do I make use of this structure? Just get the current time and compare to times.Please help.
Please note:I dont want any other time formats.
286? WOWW!
|
|
|
|
|
Actually it's a long interger and its usage is pretty strightforward, see MSDN for time function.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Actually ... with VS 2005 time_t is either __int64 or long integer depending on whether _USE_32BIT_TIME_T is defined or not.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
cmk wrote: Actually ... with VS 2005 time_t is either __int64 or long integer depending on whether _USE_32BIT_TIME_T is defined or not
it's pure academia. The difference doesn't matter in the current context
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
Could anybody tell me about typecasting.How to convert a simple int to a CString.I want to return a integer value through the messagebox.
Thank you
Siddharth
|
|
|
|
|
If just displaying an integer value in message box is your problem, use CString::Format for that.
CString str;
int i = 68;
str.Format("%d is an integer and %c is a character", i, i);
AfxMessageBox(str);
|
|
|
|
|
Hi,
I entered this code,
Now it is displaying some garbage value???
Actually, iam getting that integer through a edit control like,
int s;
m_height.GetDlgItemInt(s,NULL,TRUE);
m_height is the value entered in the edit box.
so,i want to know whether it taking it properly ,thats why i want to display it through the messagegbox.
Thank you,
Siddharth
|
|
|
|
|
Try this:
CString str;
m_edit.GetWindowText(str);
AfxMessageBox(str);
|
|
|
|
|
siddharthsan wrote: m_height is the value entered in the edit box.
m_height should be a CEdit object. Then you can use its GetWindowText() method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
yes,I already tried it.But getting "memory could not be read "error.
Thank you
Siddharth
|
|
|
|
|
Can you show your code how do you use?
|
|
|
|
|
Hi,
Why don't u create an data member for thar Edit box (Category as Value and type as int)in MFC class wizard.This will get u the integer value by the statement UpdateData();
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Hi Everyone,
In my application I used directdraw to play the media files like MPEG,MPEG2,etc..,in that while loading the files I want the duration of the files in list control while adding it in the List itself. How to get the duration of the files while loading in the playlist before playing the file.
Looking forward for your reply
with regards,
Ganesh
|
|
|
|
|
Hi all,
i Have a problem regarding multithreading....
Actually i am having a list control in that list control i having 2 columns one contaning url value n other for displaying result....
this i have done through making a class for ping which is derieved from CWinThread class...
if i run a single class then the result displayed in the list control column is correct but instead if i select more than 1 value then the result displayed is same (both rows contain same value). But the value calculated for ping is correct..problem is in displaying it in listctrl..
for sending messeage i have used SendMessage function .
Can anybody help me in this...
thanks in advance
|
|
|
|
|
neha.agarwal27 wrote: for sending messeage i have used SendMessage function .
Your secondary thread should not be sending messages directly to the list control (which belongs to the primary thread). Post a message to the primary thread instead, and let it update its controls. See here for more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
I have a homework about finding amicable numbers
[[[[
Amicable numbers:Two numbers are called Amicable(or friendly)if each equals to the sum of the aliquot divisors
of the other.Aliquot divisors mean all the divisors excluding the number itself. For example,
aliquot divisors of number 220 are 1,2,4,5,10,11,20,22,44,55 and 110. The aliquot divisors of number 284 are 1,2,4,71 and 142.
If we represent anamicable pair by(m,n)and sum of aliquot divisors of m and n by(m)and(n)respectively,then for amicable pair(220,284)we get
(m)=(220)=1+2+4+5+10+11+20+22+44+55+110=284=n
(n)=(284)=1+2+4+71+142=220=m
]]]]
my teacher wanted this programs code in C++ without using any arrays(we are allowed to do this with if,while,for,do while).And also the program must be like this:
220 and 284 are amicable numbers.
Number of amicable number less than 1000 is 1.
1184 and 1210 are amicable numbers.
2620 and 2924 are amicable numbers.
5020 and 5564 are amicable numbers.
6232 and 6368 are amicable numbers.
Number of amicable number less than 10000 is 5.
....
....
....
....
It must survive up to 10^10.
Please help me,I will so appreciate...
|
|
|
|
|
I'll point you in the right direction to help you do it yourself.
First off you clearly need a function to compute the aliquot divisor of a number.
Second you need to decide how to find the pairs. (assume that you need to detect/avoid duplicates) I think a simple loop can handle this problem.
You need to go through the thought process. You can get help for that here - maybe.
|
|
|
|
|
I cannot do it by myself.I found these codes in this site but it has an array like int get_sumf(int val).We are not allowed to do that.How can I do it without ant array???
#include <stdio.h>
#define MAX 10000000000
int get_sumf(int val)
{
int sum = 1;
int k;
for (k = 2; k <= val / 2; ++k)
if (val % k == 0)
sum += k;
return sum;
}
int main()
{
int i, k;
for (i = 2; i < MAX; ++i) {
int val = get_sumf(i);
for (k = 0; k < i; ++k)
if (val == k && get_sumf(k) == i)
printf("%d %d\n", i, k);
}
return 0;
}
|
|
|
|
|
sugaragga wrote: Please help me...
Exactly which part do you need help with? What code do you have in place so far? What doesn't work?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
how can I insert these informations:
"Number of amicable number less than 1000 is 1."
"Number of amicable number less than 10000 is 5."
like this:
"220 and 284 are amicable numbers.
Number of amicable number less than 1000 is 1.
1184 and 1210 are amicable numbers.
2620 and 2924 are amicable numbers.
5020 and 5564 are amicable numbers.
6232 and 6368 are amicable numbers.
Number of amicable number less than 10000 is 5."
.
I can only write these numbers like:
220 284
1184 1210
2620 2924
5020 5564
6232 6368
....
....
Please help me
|
|
|
|