|
Cha-Ching!!! Thanks!!!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Install what ? where ? and why does an install program should know about the FTP server?
Do you need to configure something on the user's FTP site ?
Watched code never compiles.
|
|
|
|
|
Maximilien wrote: Install what ? where ? and why does an install program should know about the FTP server?
Lesson learned today: Never hint at what the project actually does because it's really irrelevant and developers go there first! I'd probably do the same thing...
How can I find the root directory for an FTP server? (IIS) I've checked the registry.. not there. Not sure where else it could be stored.. Possibly a configuration file somewhere??
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
I'm using a ListView to display certain data, yet I can't select the row!
This is the DWORD style used in CreateWindow:
WS_CHILD|LVS_REPORT|LVS_EX_DOUBLEBUFFER|LVS_SINGLESEL|WS_TABSTOP|WS_VISIBLE
The only selection can only be done on Item, but not any of the SubItems.
|
|
|
|
|
Because you have not set the LVS_EX_FULLROWSELECT style.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
WS_CHILD|LVS_REPORT|LVS_SINGLESEL|LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER|WS_VISIBLE
Still no changes everything is still the same!
|
|
|
|
|
You need to change these settings with something like :
SendMessage(hWndView,
LVM_SETEXTENDEDLISTVIEWSTYLE,
LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES,
LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES
);
in your view initialization code. Take a look at the MSDN documentation for LVM_SETEXTENDEDLISTVIEWSTYLE .
It's time for a new signature.
|
|
|
|
|
Hy . I want to build my CSmtp client MFC compatible class , and for that I need to call gethostbyname , but here I'm stuck ... because I use CString , and function parameter is 'const char FAR *' ... my questions is : how can I convert CString to const char * ?
P.S. If you know some SMTP client tutorial , it will be very good ! Thank you !
|
|
|
|
|
You will have to do no conversion. CString already provides you with the LPCTSTR operator!
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Ok , and how to put LPCTSTR operator in the function argument ? Because I try in some dummy way , but it failed ... can you draw an little code sample ?
|
|
|
|
|
How did you called? Can you put your code here so we can see what's going on?
|
|
|
|
|
P.S.Here is my trial :
LPHOSTENT lpHostEnt = gethostbyname(sServer.GetBuffer(1 + sServer.GetLength()));
sServer.ReleaseBuffer();
but seems not working ...
|
|
|
|
|
short nProtocolPort;
LPHOSTENT lpHostEnt;
LPSERVENT lpServEnt;
SOCKADDR_IN sockAddr;
SOCKET hServerSocket = INVALID_SOCKET;
struct in_addr addr;
sTemp = sServer;
sTemp = sTemp.Left(1);
if(atoi(sTemp) == 0)
{
lpHostEnt = gethostbyname(sServer.GetBuffer(1 + sServer.GetLength()));
sServer.ReleaseBuffer();
}
else
{
addr.s_addr = inet_addr(sServer.GetBuffer(1 + sServer.GetLength()));
sServer.ReleaseBuffer();
if(addr.s_addr == INADDR_NONE)
{
m_nError = CSMTP_BAD_IPV4_ADDR;
return INVALID_SOCKET;
}
else lpHostEnt = gethostbyaddr((char *)&addr,4,AF_INET);
}
if(lpHostEnt == NULL)AfxMessageBox("lpHostEnd is NULL !");
|
|
|
|
|
Of course
sServer = "smtp.gmail.com"
|
|
|
|
|
Do not call GetBuffer() unless you are modifying the internal buffer.
CString sServer;
LPHOSTENT lpHostEnt = gethostbyname(sServer);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I use the following to declare, initializing, and delete arrays. Please check if I am doing OK? Thanks!
float* tim_var[1000];
for (i=0;i<1000;i++)
{
tim_var[i]=new float[6];
}
//
for(i=0;i<1000;i++) {
for(int j=0;j<6;j++)
{
tim_var[i][j]=0;
}
}
//
...........
//
delete [] *tim_var;
|
|
|
|
|
A rule of thumb: for each call to new there needs to be a corresponding delete . In your sample you call new within a loop (1000 times) and have only one delete.
Can you use STL or some other containers instead?
|
|
|
|
|
Thanks.
Should I put a loop of 1000 to delete ? If so could you give me
the correct code to do so. I am not sure how to put code with a loop to delete.
Tahnks again.
|
|
|
|
|
for (i=0;i<1000;i++)
{
delete tim_var[i];
}
and as Nemanja suggested, can't you use the STL container classes ? This will save you a lot of troubles in the future.
|
|
|
|
|
tim_var [][] is a two dimensional array.
float* tim_var[1000];
for (i=0;i<1000;i++)
{
tim_var[i]=new float[6];
}
//
for(i=0;i<1000;i++) {
for(int j=0;j<6;j++)
{
tim_var[i][j]=0;
}
}
//
So the delete loop you gave me is compiled. So this means the two dimensional array is deleted for 6x1000 variable memories.
Thanks
|
|
|
|
|
mrby123 wrote: tim_var [][] is a two dimensional array.
float* tim_var[1000];
But you've only shown one of those dimensions.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
This was code I put in the beginning to show a two dimensional array
float* tim_var[1000];
for (i=0;i<1000;i++)
{
tim_var[i]=new float[6];
}
//
for(i=0;i<1000;i++) {
for(int j=0;j<6;j++)
{
tim_var[i][j]=0;
}
}
//
...........
//
delete [] *tim_var;
|
|
|
|
|
mrby123 wrote: This was code I put in the beginning to show a two dimensional array
float* tim_var[1000];
But tim_var only has one dimension: 1000 .
mrby123 wrote: delete [] *tim_var;
Should be:
for (i = 0; i < 1000; i++)
delete [] tim_var[i];
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Thanks.
tim_var has two dimensions: tim_var[1000][6]
Your code below compiled OK:
for (i = 0; i < 1000; i++)
delete [] tim_var[i];
But the following code also compiled:
for (i = 0; i < 1000; i++)
delete tim_var[i];
Which one delete the two dimensional array tim_var[1000][6] ?
Please help
thanks
|
|
|
|
|
mrby123 wrote: tim_var has two dimensions: tim_var[1000][6]
No, tim_var has one dimension (1000), whereas tim_var[0...999] also has one dimension (6). The difference is subtle but important nonetheless.
mrby123 wrote: But the following code also compiled:
for (i = 0; i < 1000; i++)
delete tim_var[i];
It will compile but will result in a memory leak.
mrby123 wrote: Which one delete the two dimensional array tim_var[1000][6] ?
Neither, since that is a stack-based notation.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|