|
Hi every one, my problem is:
I must create an App to detect other computer has pasted a file on my Shared Folder, and alert some infor :
- the file
- the computer has pasted the file.
is there any way to solve the problem ??
Help me ??
thanks
|
|
|
|
|
sorry for asking this question for the hundredth time but I've never got an answer how to get the MX server.
I want to make a program that can send an email from you computer and for each mail address I have to write the SMTP server. I want a function that get's it automatically.
Thankx
gabby
|
|
|
|
|
If you are using MAPI try this. You should have a profile name supplied.
<br />
HRESULT GetServerName(LPSTR rszProfileName)<br />
{<br />
HRESULT hRes = S_OK; <br />
LPPROFADMIN pAdminProfiles = NULL; <br />
LPSERVICEADMIN pSvcAdmin = NULL; <br />
LPPROFSECT pGlobalProfSect = NULL;<br />
LPSPropValue pProps = NULL; <br />
<br />
if ( FAILED ( hRes = MAPIAdminProfiles ( 0L, &pAdminProfiles ) ) )<br />
return hRes ;<br />
<br />
if ( FAILED ( hRes = pAdminProfiles -> AdminServices (<br />
rszProfileName,<br />
NULL,<br />
0L,
0L,<br />
&pSvcAdmin ) ) )<br />
return hRes ;<br />
<br />
if ( FAILED ( hRes = pSvcAdmin -> OpenProfileSection (<br />
(LPMAPIUID)pbGlobalProfileSectionGuid,<br />
NULL,<br />
0L,<br />
&pGlobalProfSect ) ) )<br />
return hRes ;<br />
<br />
<br />
if ( FAILED ( hRes = HrGetOneProp ( pGlobalProfSect,<br />
PR_PROFILE_HOME_SERVER,<br />
&pProps ) ) )<br />
return hRes ;<br />
<br />
CString m_strServerName = pProps -> Value.lpszA ;<br />
<br />
if ( NULL != pAdminProfiles )<br />
pAdminProfiles -> Release ();<br />
<br />
if ( NULL != pSvcAdmin )<br />
pSvcAdmin -> Release ( );<br />
<br />
if ( NULL != pGlobalProfSect )<br />
pGlobalProfSect -> Release ( );<br />
<br />
if ( NULL != pProps )<br />
MAPIFreeBuffer ( &pProps );<br />
<br />
pSvcAdmin = NULL;<br />
pGlobalProfSect = NULL;<br />
pProps = NULL;<br />
pAdminProfiles = NULL;<br />
<br />
return hRes;<br />
}<br />
The above code might have some variables not declared. Pls check it out before using.
Muthukumar.V
Home: WWW.CoderSource.Net
|
|
|
|
|
If you're wanting to write your own SMTP server application I recommend reading RFC 2821. In regards to your question about how to obtain an MX record for a particular domain (example: yahoo.com, hotmail.com, etc...), you will need to need to query DNS. A good place to start to would be to use google.com, or better yet, if you're just looking for a quick solution, try this link.
http://www.codeguru.com/Cpp/I-N/internet/dns/article.php/c6163/
Regards,
John
|
|
|
|
|
Your best bet is to relay through an existing mail server, just like Outlook Express does.
But if you really need to do it directly, and expect to run on Windows 2000 onwards, then checkout the DNS API, DnsQuery specifically.
Otherwise you'll have to look up the DNS spec, find out how to locate your local DNS server and do the query manually.
Paul
|
|
|
|
|
How do i create a hyoerlink? Let's say in the "About..." form i want to add my email adress or a website's page.
Thanks!
|
|
|
|
|
|
Purpose: I am trying to have an app that will detect when a new app launches so I can open my app(password protection) instead before proceeding with the original application the user tried to open.
Current Solution: using a windows hook to look for new processes and hiding the app window(with ShowWindow()) unitl my password protection has been completed.
PROBLEM: ShowWindow() works great for hiding apps such as IE and Word, but it is not working for games like starcraft, warcraft. While in a game Alt-Tab will not even take you out of the game and quite often Ctrl-Alt-Del will NOT bring you to the desktop to see the taskmanager. Should I be using a different function call than ShowWindow()? Or is there a better way to accomplish this task?
Thanks,
--bacon
|
|
|
|
|
Check my article about the little firewall I've designed.
http://www.codeproject.com/useritems/A_not_so_simple_firewall.asp
Here you can modify it the way you want to show a dialog box instead of a messagebox which asks you if you want to open the app or not.
Hope you find it helpful
gabby
|
|
|
|
|
Nitron wrote:
If there is no need to change the buffer, then it should be explicitly const [...]
Remember that you may be dealing with a bad implemention of existing code, where a function might take a non-const pointer even though it does not modify it or its contents. Developers that get too comfortable with string objects can often find themselves in situations like that.
The explicit cast to LPCTSTR is unnecessary; CString::operator LPCTSTR() takes care of that for you.
Peace!
-=- James
Tip for SUV winter driving survival: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
How do I change the icon in the title bar of a dialog box? Currently, it is displaying Window's default icon.
Thanks!
|
|
|
|
|
Use the resource editor in VC++.NET to create an icon, having it as a named resource in your project. Then in your dialog's OnInitDialog() function, type (replace IDI_DIALOG with the name of your icon's resource name.):
[...]
HICON hicon = AfxGetApp()->LoadIcon(IDI_DIALOG);
ASSERT(hicon != NULL);
SetIcon(hicon, TRUE);
[...].
Happy Programming and God Bless!
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Using VS 2003, MFC 7.1, when creating a property sheet the internal CPropertySheet::OnInitDialog() will create an exception, an access violation writing a location. This is observed in the VS debug output window, and surrounding the OnInitDialog call with some TRACE statements will prove where it's coming from.
I have experimented by creating the simplest apps with CPropertySheets I can imagine, and the exception always occurs. True for both static and dynamic MFC linking, various runtimes, etc.
Any suggestions? Has anyone else seen this also?
Richard
|
|
|
|
|
Hi i assume you fixed the problem . can you give me suggestion
|
|
|
|
|
Off and on for some time I've tried to find the best way to bring a window (whose parent is the desktop) to the top of all the other application windows on some particular event. They could very well be using another application window at the time so I can't allow it to take the focus away as this could result in lost keystrokes. My current implementation of this is basically the following:
HWND hwnd = ::GetForegroundWindow();
::SetWindowPos(myhwnd, hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
::SetWindowPos(myhwnd, hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
I've investigated numerous other ways over time. This works well but doesn't always work perfectly. Some times focus is stolen and sometimes the z-order isn't correct. These are rare cases and usually involve some specific other application that was in use at the time.
I'm wondering if anyone could offer solutions they've tested and used in the past for performing something similar?
Craig
|
|
|
|
|
Sorry, I meant to code it:
HWND hwnd = ::GetForegroundWindow();
::SetWindowPos(myhwnd, hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
::SetWindowPos(hwnd, myhwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
|
|
|
|
|
How to concatenate a string and an int
|
|
|
|
|
There are many ways. It depends of type of your string. For null-terminated const char * you can use this one:
char res[128];
const char *str = "Result is: ";
int num = 10;
sprintf(res, "%s%d", str, num);
---
Realtime 3D screensavers
|
|
|
|
|
well a solution would be this one:
int x=466;
char conc[1024];
_itoa(x,conc,10); //converts the int to string now conc="466"
strcat(conc," is a converted number");
//now conc is "466 is a converted number"
Hope this is what you want
gabby
|
|
|
|
|
unresolved external symbol "public: __thiscall CMyProcessesInfo::CMyProcessesInfo(class CWnd *)" (??0CMyProcessesInfo@@QAE@PAVCWnd@@@Z)
|
|
|
|
|
|
I have a project and am hoping for input on how I might further consider the feasability of using C++ to implement it. My main problem is that I am only slightly familiar with visual C++.
Project Details:
(1) Embedded device reads data every 4 seconds and transmits a UDP paket to a Server.
(2) C++ application gets packet, pulls out info, and updates MSSQL database.
(3) Web browser loads page and constantly updates the current value for viewing purposes, and other application access the data directly from the database.
So, Step (1) and (3) are no problem. My question involves (2). I will be using visual c++ 6.0.
The only experience I have had with Visual C++ is to take and existing application and make modifications to it basically using examples that were in the code already. I have 3 questions below that are all: "How do I do that?" What I am getting at is what libraries and functions I use to get the functionality, or the correct terminolgy so that I can find some sort of help on each separate topic.
This is an application that must be running continuously, can or should it run as a service? How do I do that? Is it worth the effort that might be involved versus just dropping the exe into the startup folder?
The application must be set up to listen for udp packets on a certain port. How do I do that?
Once I have the packet I will need to yank out the data and do an SQL update. How do I do that? I am familiar with using ADO in ASP pages, is it similar to use in C++?
Any help whatsoever is greatly appreciated. Links to other online material that answer it for me or the names of the libraries and functions that I would use, or anything else that might help is what I think I am looking for.
Thanks for you help!
Brian
|
|
|
|
|
brian2222 wrote:
can or should it run as a service?
Yes
brian2222 wrote:
How do I do that?
http://www.codeproject.com/system/serviceskeleton.asp[^]
brian2222 wrote:
The application must be set up to listen for udp packets on a certain port. How do I do that?
You learn about "Socket" development. It's no small subject and will take some time.
brian2222 wrote:
I am familiar with using ADO in ASP pages, is it similar to use in C++?
The ADO COM interface is of course exactly the same. Working with COM in C++ is going to be very different than in script code or VB. So you have a learning curve there as well. I suggest looking at using the #import statement and the ATL smart pointer templates.
Good luck
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Anybody out there know a reasonably straight-forward way to save modified CBitmaps??
|
|
|
|
|
i need to extract the data to form a Tree ,i must transfer the cstring into char*
i use (lpstr) but compile note not well
so i myself write a function as following:
char* CSelectDlg::change(CString mystr)
{ int len=mystr.GetLength();
char* array=new char(len);
for(int i=0;i
|
|
|
|