|
I want to install the file data.bmp in system32:
hFile = CreateFile((L"c:\\windows\\system32\\data.bmp"), GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL);
When I run this hFile is given a value, so I write to the file, and close it. Why doesn't it appear in system 32 ?
I have no trouble writing to other folders, but not to Windows, or even to C:.
The problem seems to be pecular to Vista, and certainly doesn't arise on XP.
Raymond Mercier
|
|
|
|
|
As with most Vista write problems, you are probably not running the process as an Administrator. You must do so to write to any system directories.
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Thanks, that has cured it. Now I have to see how to run the program in debug mode within VisualStudio, but as administrator.
Raymond
|
|
|
|
|
I think that if you run VS as Administrator then any projects you run in debug mode under it will also run as Administrator.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Thanks again. It does as you say. Great game, this Vista !
Raymond
|
|
|
|
|
in vista ..
there is one compiled MFC source code in this code was developed XP,that code was not running in vista.
But in vista we have 2 generate the source code and developed it then only its possible to achieve ..
|
|
|
|
|
I've been using C# for the last few years but now I have to work with an embedded C++ compiler and am having problems with enum types, since they can't apparently be used in a different class.
<code>
class Message
{
public:
enum Index
{
Length,ID1,ID2,ID3,Type,From,To,SourceX,SourceY,Var,Routing,MaxIndex=255
};
....
....
....
}
...
...
...
bool Sensor::SendMessage(Message msg)
{
char message[Message.MaxIndex];
message[Message.ID1] = 'X';
...
...
}
</code>
This sort of thing works fine in C# but the C++ compiler gives an error when 'Message.MaxIndex' etc is used - it says 'type names cannot be used' (or similar depending on the compiler). Do I really have to make all my enum's global (e.g. 'Message_MaxIndex') or is there a better way?
|
|
|
|
|
Try Message::ID1. In C++ scope resolution operator is ::.
-Saurabh
|
|
|
|
|
Hi all i am new to the concepts of mfc,
in my application i want to create resitry entries i did that well but when i tried to insert value for the default key (default) in the registry the key is duplicated,and i am not able to set the value for the default one.
can anyone suggest me the correct approcah for doing this.
thanks in advance.
|
|
|
|
|
try this code, it working fine for me
CRegKey key;
if( key.Create(HKEY_CURRENT_USER,L"Software\\Alok") == ERROR_SUCCESS)
{
if(key.SetKeyValue(L"",L"Alok") == ERROR_SUCCESS)
{
AfxMessageBox("Successful in setting the Default value of key");
}
}
please include Atlbase.h in your code!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
hariakuthota wrote: ...when i tried to insert value for the default key (default) in the registry the key is duplicated,and i am not able to set the value for the default one.
And what does this have to do with MFC?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Is there any software that makes single monitor behave multiple??? Actually we can use hardware device switch but I am looking for software. I remember once I had downloaded code from CP but now I am not finding it. Please do provide the link reference.
|
|
|
|
|
|
Mihai Moga wrote: 1) Don Kackman's MFC classes for multiple monitors[^]
2) Jon Newman's Multiple Monitor Support[^]
3) Asim Goheer's Dual / Multiple Monitor Support in Win32[^]
Don't these all require multiple monitors?
OT: I found it funny that all three articles were conceived out of the need for a screensaver.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I want to create a simple SMTP client which will send an email with login and password features using VC++...
How can i acieve it..
Actually i want to know how do we pass messages int commant prompt using C++..so that i can pass commands like
MAIL FROM
MAIL TO
telnet address port(25)
Please help
|
|
|
|
|
Well, I think you should have a look into PJ Naughter CSMTPConnection[^] class. I used in private project and it is very reliable.
Best regards,
Mihai Moga
|
|
|
|
|
Hi,
The SMTP protocol does not support username and password authentication. You have to get authorized by login into the associated POP3 server, which will give you a time span to connect with the SMTP server. (Go through RFC 821)
For accepting parameters from the console, you can use the combination of functions printf()and scanf()or the C++ standard "cin" and "cout"
|
|
|
|
|
|
For client/server socket programs.
Clients are on local area network (inside the company) and from the internet (outside the company).
Should the Server program uses network IP address or internet IP address or both to accept all clients? why?
|
|
|
|
|
No. The IP address that you get through internet is the Proxy's address. Not the client machine (that's inside a lan)'s address. To know more about it, search for NAT- Network Address Translation.
But the client machine can connect to a machine that's outside the lan. The initiat-er makes the difference. If a machine waits outside the lan, (A Server) , you can connect it from a machine inside the lan. But you cannot do the reverse. [My networking data are fading out, so better check it up]
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
If your IP address is part of a private block (10.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16) then there is no way for an IP address outside that network to connect to your IP address unless your gateway router is set up to do port forwarding or NAT or some other IP aliasing. If your IP address is not within these blocks, then it may or may not be route-able from the internet depending on firewall/gateway settings.
|
|
|
|
|
ipconfig displays 3 IP addresses in 3 lines, such as:
//-------------------------------------------
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.101
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.254
//-------------------------------------------
what do the 3 addresses stand for?
which one is Networking IP address?
|
|
|
|
|
includeh10 wrote: what do the 3 addresses stand for?
IP address
Subnet mask
Default gateway
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
includeh10 wrote: Default Gateway . . . . . . . . . : 192.168.1.254
This is what I called as "Proxy".. you get it? To check it, from your lan, from multiple machines, open IPchicken.com and check the IP adress. it will all be the same. That's what is actually getting exposed to the internet.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
A bitwise ANDing of the IP Address and the subnet mask will give you the network address. In this case: 192.168.1.101 AND 255.255.255.0 = 192.168.1.0.
|
|
|
|