|
Your question is not very clear, but if you are having trouble accessing files in your project then check that the location property is correct.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Ok! in my project there is two file-first main.cpp and main.h,and i am using command #nclude"main.h",But in the с++ editor the error that can't open this file Both files are in one directory
|
|
|
|
|
What do you mean "can't open"? If both files are in the correct directory then the editor will find them. You must have some other problem that is preventing it from locating the file. I presume the word "#nclude " above is a simple typo here only and not in your source file.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
PeLeg89 wrote: #nclude
Try #include
==============================
Nothing to say.
|
|
|
|
|
If your editor can't find a file, it means either:
0. File doesn't exist.
1. Path is not specified correctly in the include (if using entire path).
2. Path is not part of the project library/include directories (if using <> ).
3. I believe I've also seen this occur if the file is not part of the project (although don't quote me on that one, don't quite remember)
|
|
|
|
|
Thank all,you helped me ,I think this is 3 item
|
|
|
|
|
Great
|
|
|
|
|
Can someone assist me how to read/write physical memory location from IP address?
Thanks.
|
|
|
|
|
User code can just access virtual memory (i.e. it doesn't know the physical address is accessing).
fingerss5 wrote: from IP address
If you mean: "from a remote PC" then you have to write a client-server application for the purpose.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
fingerss5 wrote: Can someone assist me how to read/write physical memory location from IP
address?
Just what do you mean? An IP address has nothing to do with memory.
If you mean on a remote machine, then say so. And the other posters comments are entirely valid if that is the case.
==============================
Nothing to say.
|
|
|
|
|
[ This ] talks about Shared memory access permissions on Windows.
Maybe [ this ] article on Memory-mapped files might help but it applies to XP, not Vista/Windows 7.
("Memory-mapped files allow a file on disk to be associated with an address space. Once this mapping is done the data in the file can be accessed as if the file was in memory." )
MSDN has lots on Memory-mapped files, google "Sharing Memory Over Networks" and/or "Memory-mapped files".
|
|
|
|
|
|
I am having hard time trying to understand why SetDefaultCommConfig will not set DTR / RTS parameters to 0. I can set the DCB to DTR = DTR_CONTROL_DISABLE (0) but when I read it back using GetDefaultCommConfig it goes back to 1.
I can control baud rate as expected, no problems here.
So what is so special about DTR or RTS that is cannot be controlled using Set/GetDefaultCommConfig?
Has data flow control involved here? In my system it is set to None.
The MSDN is rather cryptic saying that “some parameters cannot be changed” -using these APIs.
Here is my test code snippet:
COMMCONFIG config;
CString sPort;
int nPort = 2;
sPort.Format(_T("COM%d"), nPort);
DWORD dwSize = sizeof(COMMCONFIG);
if (!GetDefaultCommConfig(sPort, &config, &dwSize))
{
TRACE(_T("Failed in call to GetDefaultCommConfig\n"));
}
config.dcb.fDtrControl = DTR_CONTROL_DISABLE;// DTR_CONTROL_ENABLE;
config.dcb.fRtsControl = RTS_CONTROL_DISABLE;
config.dcb.BaudRate = 123456;
config.dcb.fOutxDsrFlow = false;
All parmaters are correct in watch.
if (!SetDefaultCommConfig(sPort, &config, dwSize))
{
TRACE(_T("Failed in call to GetDefaultCommConfig\n"));
}
if (!GetDefaultCommConfig(sPort, &config, &dwSize))
{
TRACE(_T("Failed in call to GetDefaultCommConfig\n"));
}
As always , thanks for your help.
|
|
|
|
|
Vaclav_Sal wrote: some parameters cannot be changed
Maybe it is concise, but is clear: you cannot change some parameters with this function (don't ask me the reason).
If you need to control DTR/RTS then use SetCommConfig every time you need it.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I was hoping to stop the DTR/RTS, set to 0, before I actually need to control them. I wanted to build a different default configuration. I do use SetCommConfig down the line.
And yes, I hope someone will come up with a reason why they cannot be controled by this API. But it appears to be long shot here.
I think I found a workaround, not using DTR/RTS, but I need to test it.
Thanks for your input.
|
|
|
|
|
i have a string such that
hello
hi
good
i want to extract the values line by line....please help
|
|
|
|
|
What sort of string, and what do you mean by extract the values line by line? You could use one of the strtok[^] variants for a simple character array, or one of these functions[^] for a string .
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
i have a character array such thatb char buffer[100];
the values are stored like
cklvcmsdl
dclcm
dcpcc
i have to extract these values line by line and compare them with the input to find matching usernames
buffer contains the usernames
|
|
|
|
|
Well it looks like you need to use the first option I suggested.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
That means the user names are separated by the newline character, you may use strtok as Richard already suggested or hand-craft a simple loop to collect all the names.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
As CPallinial suggested, here is simple loop to collect all the names.
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
char one_line_string[] = "hello hi how are you nice weather we are having ok then bye";
char seps[] = " ,\t\n";
char *token;
int main()
{
vector<string> vec_String_Lines;
token = strtok( one_line_string, seps );
cout << "Extracting and storing data in a vector..\n\n\n";
while( token != NULL )
{
vec_String_Lines.push_back(token);
token = strtok( NULL, seps );
}
cout << "Displaying end result in vector line storage..\n\n";
for ( int i = 0; i < vec_String_Lines.size(); ++i)
cout << vec_String_Lines[i] << "\n";
cout << "\n\n\n";
return 0;
}
|
|
|
|
|
Hi all,
I have a program that runs as a service somewhere on a server. It communicates with a console-type program (possibly on another machine within the network) by means of a messages file. The file is created by the service (because there may be multiple console programs running) However, the service is started by an administrator. Due to this, the console programs do not have access rights to the messages file. It works fine if I create the file manually (the service only creates if it does not exist) but if the file for some reason gets deleted, the consoles are no longer able to add their messages into the file.
Is there a way in which I can grant full control rights to all users from the service program after creating the file?
Anyone? Please?
Thanks in advance,
William
|
|
|
|
|
Sorry this doesn't answer your question, but I'd recommend instead you have a network group that has the create and write permissions and then ensure the administrator and other users are members of that group.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Which is indeed what I advised my clients. However, there are several clients using this software and if there is one thing I learned over the years: Sysadmins will ALWAYS have their own thoughts on how to organise and authorize their users!
William
|
|
|
|
|
Ah yes, clients, users and sysadmins. The nemesis of our existence.
It might be possible at the folder level to allow full control to network access and to have that access flow to sub-folders. That might override the local adminstrator account when it creates the file.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|