|
I've been struggling with an error message that prevents me from initializing the CPoint member (adk) of my structure. As a test, I discovered that my own Point structure worked fine.
What am I doing wrong...surely one can conveniently initialize a CPoint structure???
Excerpt of my Code:
typedef struct {
int x;
int y;
} MyCPoint;
struct s_Door{
MyCPoint InsertionPt;
int iPline;
int iEach_Pline[1];
int iVert;
MyCPoint Vert[5];
CPoint adk;
}
Door =
{
{0,0},
1,
{5},
5,
{-15,0, -14,2, 13,15, 15,13, -15,0},
4
};
Error message:
'Door' : non-aggregates cannot be initialized with initializer list
|
|
|
|
|
Add brackets.
Door = {{0,0}, 1, 5, 5, {{-15,0}, {-14,2}, {13,15}, {15,13}, {-15,0}}, 4};
Kuphryn
|
|
|
|
|
Thanks for your help, but this still gives the same error message. In fact, this very simple code results in the same error message???
struct s_Desk{
CPoint adk;
} Desk = { 0,0 }; //I tried { {0,0} } as well.
error C2552: 'Desk' : non-aggregates cannot be initialized with initializer list
|
|
|
|
|
CPoint cannot be initialized with an initializer list probably because it has one or more constructors, and has a base class.
|
|
|
|
|
OR:
typedef struct {
int x;
int y;
} MyCPoint;
struct s_Door{
s_Door();
MyCPoint InsertionPt;
int iPline;
int iEach_Pline[1];
int iVert;
MyCPoint Vert[5];
CPoint adk;
}
s_Door::s_Door() : InsertionPt( 0, 0), iPline( 1 ), ... adk( 0, 0 )
{
// anything you want to addd....
}
|
|
|
|
|
I want to small project so I can share some data, printer, ...etc. But I don't know VC++ support fuction or ActiveX object for parallel port. please help me.
Thank and Best regards!
The child learn to program
|
|
|
|
|
Here is one solution from MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp
Kuphryn
|
|
|
|
|
Hi,
I have implemented an FTP application, which will schedule itself to run daily by using SetTimer, once it’s started. Everyday it will FTP-get a plain text file from a remote server using MFC classes CInternetSession and CFtpConnection.
The plain text file’s name will be the same, but the content is updated daily. The problem I’m having is the first time I start the application, it gets the text file of that day, but then it will get the same file, even though the content of the remote file has already been updated. It seems like the file is cached somewhere. If I stop the application and re-start it, again it will be fine the first time.
The code is below:
CInternetSession session(_T("DBAdmin"));
CFtpConnection* ftp;
session.SetOption (INTERNET_OPTION_CONNECT_TIMEOUT, 30000);
session.SetOption (INTERNET_OPTION_CONTROL_SEND_TIMEOUT, 30000);
session.SetOption (INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT, 30000);
session.SetOption (INTERNET_OPTION_DATA_SEND_TIMEOUT, 30000);
session.SetOption (INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, 30000);
try
{
ftp = session.GetFtpConnection (strIP, strLogin, strPwd, iPort);
if (ftp)
{
if (!ftp->GetFile (strSrc + strFileName, strDest + strFileName))
}
}
Is this a setting problem or a programming one?
Thanks in advance.
Tony
|
|
|
|
|
I suspect there is a problem on the server side. The server may not be updating its data relative to the actual file. In other words, the server is no aware that the file has changed.
Kuphryn
|
|
|
|
|
When you construct the CInternetSession object, pass the flag INTERNET_FLAG_DONT_CACHE as the Flags parameter:
CInternetSession session(_T("DBAdmin"), 1, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_DONT_CACHE);
|
|
|
|
|
I just downloaded SP5 from msdn and I choose the multi-part download. So I have 11 files numbered 1 to 11 this is the SP5 core, no problem with those.
There are aslo 3 files called vs6sp5s1.exe, vs6sp5s2.exe and vs6sp5s3.exe. When I unpack them they are full of headers, .lib and so. I don't know how to install those files, should I unzip them in the same folder as the SP5 core. It seems odd to me as SP5 is mainly composed of CAB files when the 3 others are a bit messy.
Any info someone ?
Thnak in advance
Yarp
http://www.senosoft.com/
|
|
|
|
|
Just for yor information, you need to unzip all files into one folder and then run the Setup.exe that came with the 1st cab file.
|
|
|
|
|
Thanks for the answer
Now, I will proceed.
Yarp
http://www.senosoft.com/
|
|
|
|
|
Hi guys
I've read the following optimizations switches
/G5 Optimizes for Pentium processor.
/G6 Optimizes for Pentium Pro processor.
But exists some newer switches to optimize for Pentium III or Pentium 4 processors?
Best Regards
Dr.Pi
|
|
|
|
|
|
I'm downloading.
I have some questions.
What happen if you run this code in an AMD processor?
Best regards
Dr.Pi
|
|
|
|
|
How to check if bit STORE_RTF_OK is set in message store provider?
|
|
|
|
|
Call the message store's GetProps() method to retrieve the PR_STORE_SUPPORT_MASK property. Then check the STORE_RTF_OK bit.
|
|
|
|
|
if ((pPropVal->Value.l & STORE_UNCOMPRESSED_RTF) == STORE_UNCOMPRESSED_RTF)
will get it.
|
|
|
|
|
Which is incorrect. The expression (pPropVal->Value.l && STORE_UNCOMPRESSED_RTF) evaluates to 1 so of course the whole condition is TRUE. To AND two values, you need to use the '&' operator.
|
|
|
|
|
Have you tried printing the hex value of pPropVal->Value.l ? It'll show you what bits are set and what bits aren't.
|
|
|
|
|
dec: 145405
hex: 237FD
bin: 10 0011 0111 1111 1101
|
|
|
|
|
100011011111111101 (0x237FD)
& 001000000000000000 (STORE_UNCOMPRESSED_RTF)
====================
000000000000000000
100011011111111101 (0x237FD)
& 000000100000000000 (STORE_RTF_OK)
====================
000000000000000000
|
|
|
|
|
|
I am permanently logging lines of text with a "\r\n" at the end to a CRichEditCtrl. That way, the CRichEdit appends a new line of text with every call of ReplaceSel("SomeText\r\n") and keeps scrolling down. Stupidly the whole thing gets very sluggish as the amount of text increases. I saw applications doing this kind of "logging" for several hours without getting slower. Does anybody have an idea how to do this ???
MS
|
|
|
|