|
Click here[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
|
I want to know how through use of MFC API we can do nslookup and query our DNS server to look for smtp mail server, responsible for forwarding our messages to other smtp servers on same network(doamin) or some other domain.
|
|
|
|
|
You can use DnsQuery() for this.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
How can I programatically retrieve the list of users available in the 'Administrators' group
which is accessible (in XP) through :
Right click 'My Computer' -> Manage -> Computer Management (Local) -> System Tools ->
Local Users and Groups -> Groups -> Administrators (double click).
Using NetUserEnum(), I am able to retrieve users who are also Administrators but entries like
XYZDomain\XYZAdminUser under the 'Administrators' group couldn't be retrieved.
How could I specifically retrieve entries like 'XYZDomain\XYZAdminUser'.
Thanks in Advance.
|
|
|
|
|
SherTeks wrote: How can I programatically retrieve the list of users available in the 'Administrators' group
which is accessible (in XP) through :
Right click 'My Computer' -> Manage -> Computer Management (Local) -> System Tools ->
Local Users and Groups -> Groups -> Administrators (double click).
Use NetLocalGroupGetMembers() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hi,
I wrote some multiThread application that upload some file to FTP server.
When i run 10 threads all work fine - but when i run 50 thread i have deadlock.
I attached my code - this is the Connection method that each thread calls
My code ...
bool FTPConnection::UploadInfo(CString MachineIpAddress, CString FileToDownload)
{
try
{
CMyInternetSession InternetSession;
CFtpConnection* ftpConnection = InternetSession.GetFtpConnection(MachineIpAddress, "admin", "admin");
if( !ftpConnection->SetCurrentDirectory("/SomeFtpFoled"))
{
int E = GetLastError();
return false;
}
if(!ftpConnection->PutFile(FileToDownload, FileToDownload))
{
int E = GetLastError();
return false;
}
return true;
}
catch (CException* e)
{
return false;
}
}
|
|
|
|
|
Are you syncronizing threads. If there is a problem of Syncronization of threads then try using Mutex, critical section etc. try to syncronize the threads.
|
|
|
|
|
The thread are synchronize.
I don't think that this is the synchronize problem because each thread is running ok.
But - when i press on pause button - i see that some thread(s) are still waiting on the line "GetFtpConnection" and other thread(s) are still waiting on "PutFile".
So i think that the synchronize of the thread is ok - and maybe i have some communication problem.
|
|
|
|
|
I don't think that the scenario you're talking about is 'dead lock'. You are calling the synchronous calls like PutFile which returns only when the task gets completed or failed. Try out with opening the file using OpenFile and Write functions. You'll get closer control over the code and thread.
- Malli...!
|
|
|
|
|
The file are very small ( 2-3 Kb ) so i don't see any problem with waiting until the file will be done.
|
|
|
|
|
Closing the FTP connection after the use may help to reduce the number of connection load.
- Malli...!
|
|
|
|
|
On a side note, MFC exceptions should be deleted when caught with catch (e->Delete() ).
Steve
|
|
|
|
|
Please let me know how do I create a timestamp. In the following format..
2007.11.21 16:36:46.094+00:00
Thanks
|
|
|
|
|
Get the system time by calling GetSystemTime() . The SYSTEMTIME struct contains everything you need to generate this timestamp.
Use CString::Format() to format to your required format.
pl_kode wrote: 2007.11.21 16:36:46.094+00:00
BTW this time is in UMT? For converting your local time to UMT, Get the current timezone by calling GetTimeZoneInformation() then convert it to UMT by calling TzSpecificLocalTimeToSystemTime()
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi All,
How can I save multiple registry keys into a single file? The RegSaveKeyEx() fails if a file already exists.
Thank you,
AJ
|
|
|
|
|
Ajay L D wrote: The RegSaveKeyEx() fails if a file already exists.
Can't you rename the existing file and delete it later if RegSaveKeyEx() succeeds?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks! I could do it, but I need to store all the values into a single file, by appending the values. I would have multiple calls to RegSaveKeyEx() but the file name needs to be the same.
Thank you,
AJ
|
|
|
|
|
I think the OP wasn't asking about that (my CPMRU battery pack is fully charged): maybe he was asking how to write multiple keys (possibly unrelated) in the same file.
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
|
|
|
|
|
You hit the bull's eye!!
Any answers?
Thank you,
AJ
|
|
|
|
|
Nope, unfortunately.
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
|
|
|
|
|
CPallini wrote: Nope, unfortunately. [Cry]
Running low on drugs?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yes.
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
|
|
|
|