|
What function are you using to get the scroll position, GetTopIndex()?
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Hi,
How to check whether a directory is write protected(not ready-only attribute) or not. I tried using _taccess_s but its not working for directories(MSDN confirms it). Is there any way to check it.
Thanks.
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Use GetFileAttributes function
-Sarath
|
|
|
|
|
Hi,
GetFileAttribute doesnot retrieve the write-protection setting. Thats why I specifically mentioned "not read-only attribute" in my post.
Thanks.
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
See Access Control List
MSDN Security Glossary[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Thanks Mike,
I got it. Its a combination of APIs. Lot of code. But its working fine.
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run.
Can anybody help me?
Thanks.
<br />
void update()<br />
{<br />
....<br />
<br />
free((void*)m_pszRegistryKey);<br />
m_pszRegistryKey = NULL;<br />
free((void*)m_pszProfileName); <br />
m_pszProfileName =_tcsdup(szPath); <br />
....}<br />
...<br />
{<br />
AfxGetApp()->GetProfileString(......);<br />
}<br />
...<br />
hi
|
|
|
|
|
You can check in sources what is wrong there (maybe it caches open file handle), but why don't you use GetPrivateProfilexxx functions directly?
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
|
zt9788 wrote: But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run.
try these INI file reading wrapper class:-
INI FILE reader![^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
There is a statement in the description of the CArray in MSDN:
……
If you need a dump of individual elements in an array, you must set the depth of the CDumpContext object to 1 or greater.
………
What dose “the depth of the CDumpContext object” means? I can’t understand.
|
|
|
|
|
I see from msdn that the generic mapping of atof() is _tstof(), but I can't use it even after I include <stdlib.h> & <stdio.h>. So, which .h file should I include?
MSDN:
TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined
_tstof atof atof _wtof
-- modified at 21:20 Wednesday 17th May, 2006
|
|
|
|
|
|
It's very strange that I can use _tstof() in VS.net 2003 but not VC6, even I include the file tchar.h.
Maybe I need the latest Platform SDK?
|
|
|
|
|
Hi,
On Windows Xp, there is a functionality that allows to copy the archives of an user. This functionality is had access through My Computer ( click of the right button of mouse ) -> Settings -> Advanced -> User Profiles -> Configurations -> Copy to.
How can I do that by C++ programming? I was thinking in something like a method of a WMI Class or the ShellExecute command.
Can you help me?
Grateful!
Hélio
|
|
|
|
|
I don't know what you are trying to do.
SHGetSpecialFolderLocation[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
I just want to copy the files of a user profile to another directory.
Here is a example:
There is user called João. In the directory c:\documents and settings\João\ are the João user's files. I just want to copy them to another directory. This functionality, as i said, is had access by My Computer -> Properties -> Advanced -> User Profiles -> Settings -> Copy To, but i want do that by C++ programming.
I still watting for help!!
gratiful!
Hélio
|
|
|
|
|
Hello all..
for the following program I got headache about the switch statment:
if I use switch(*hello) I got a compile error : switch quantity not an integer!
if I remove the stat I got a runtime error: segmentation fault!
I need help to fix this problem..
#include <stdio.h>
main()
{
int *hello;
printf("Hi, Enter any value > ");
scanf("%d",&hello);
switch (hello)
{
case 1: printf("your 1 luck number is > %d\n",hello);
case 2: printf("your 2 luck number is > %d\n",hello);
case 3: printf("your 3 luck number is > %d\n",hello);
default: printf("your 4 luck number is > %d\n",hello);
}
}
thanks
Ajmi
|
|
|
|
|
did you try changing the declaration of hello to be:
int hello;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
The segmentation fault is because the scanf statement is writing a new value to the POINTER hello , setting it to the value entered by the user. So if the user enters "4", hello is now a pointer to "address" 4. This will crash.
Do this instead:
<br />
int hello;<br />
printf("Hi, Enter any value > ");<br />
scanf("%d", &hello);<br />
switch(hello)<br />
{<br />
...<br />
...<br />
}<br />
Bob Ciora
|
|
|
|
|
moloza wrote: int *hello;
int hello is enough
nave
|
|
|
|
|
Thanks all
but I need hello to be a pointer because it might be passed as an argument to some function (like in case of use 'recv' in socket programing) in the program.
Actually I submet a very simple program but what if the program read hello from the keyboard and send it to another side in a socket connection, ofcourse, I will need hello to be a pointer.
so the change must be somewhere in the program rather than the decleration of hello.
but where?!!
thanks again
Moloza
Ajmi
|
|
|
|
|
modify like this..
main()
{
int *hello = new int;
printf("Hi, Enter any value > ");
scanf("%d",hello);
switch (*hello)
{
case 1: printf("your 1 luck number is > %d\n",hello);
case 2: printf("your 2 luck number is > %d\n",hello);
case 3: printf("your 3 luck number is > %d\n",hello);
default: printf("your 4 luck number is > %d\n",hello);
}
}
nave
|
|
|
|
|
If you need a pointer to hello, you can get one by writing &hello .
|
|
|
|
|
moloza wrote: int *hello;printf("Hi, Enter any value > ");scanf("%d",&hello);switch (hello)
if you still want to use pointers in your code, you see this example
#include<stdio.h>
#include <malloc.h>
main()
{
int *hello;
printf("Hi, Enter any value > ");
hello=(int*)malloc(sizeof(int));
scanf("%d",hello);
switch (*hello)
{
case 1: printf("your 1 luck number is > %d\n",*hello); break;
case 2: printf("your 2 luck number is > %d\n",*hello);break;
case 3: printf("your 3 luck number is > %d\n",*hello);break;
default: printf("your 4 luck number is > %d\n",*hello);
}
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|