|
As others have said, you either have main() or you have your WinApp (theApp ) but not both. And definitely not two instantiations of theApp .
The command line arguments can be accessed during your InitInstance() function by looking at the m_lpCmdLine data member of your class.
There are a number of classes / functions that can help you parse it in the argc/argv style you're accustomed to, links are in earlier answers to this question.
|
|
|
|
|
|
in your CWinApp:InitInstance, you should be able to access the __argv and __argc variables.
|
|
|
|
|
I did not know that, been tokenizing m_lpCmdLine myself. +5 for the info.
|
|
|
|
|
Hi ,
How can we represent structure bitfiled in the UML Model??
|
|
|
|
|
|
If i have the following case,
Struct Mode
{
union
{
unsigned char MSB;
struct
{
unsigned char a:2
unsigned char b:3
unsigned char c:3
}
}
}
How to model the struct "Mode" in the class diagram?
|
|
|
|
|
[ Here ] is a good UML primer.
#include <iostream>
using namespace std;
class c_Mode
{
public:
union
{
unsigned char MSB;
struct
{
unsigned char a:2;
unsigned char b:3;
unsigned char c:3;
};
};
} ;
struct s_Mode
{
public:
union
{
unsigned char MSB;
struct
{
unsigned char a:2;
unsigned char b:3;
unsigned char c:3;
};
};
} ;
int main()
{
c_Mode clsMode;
clsMode.a=0;
clsMode.MSB=0;
s_Mode mode ;
mode.a=0;
mode.MSB=0;
return 0;
}
|
|
|
|
|
|
|
People Hi!People, prompt why VC ++ doesn't open title files, can where it is necessary to adjust?
It is all to be in one folder, and doesn't want to open.
|
|
|
|
|
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]
|
|
|
|