|
the MSDN reference doesn't help me since i am not familiar with the subject....
can you refer me to a code snippet that uses DnsQuery to get the mail server ?
also, i need to know the current user email address...can u help there as well?
thanks again for all the kind help
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: can you refer me to a code snippet that uses DnsQuery to get the mail server ?
Can't you just Google for an example?
http://www.google.com/search?hl=en&q=DnsQuery+DNS_TYPE_MX
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
in a Small research i did, i found out that in order to use DnsQuery you need to specify the name of the owner of the record set queried (first parameter). this isn't good for me.
i need to explain exactly what i am planning to do:
i need to retreive a SMTP server i.e Mail.yaron.net then i need to retrieve the current user email
i.e yaron@yaron.net......
problem is i can't do either with what you have suggested.....
i was trying to use Outlook automation, but couldn't find how to retrieve the SMTP server using that....
any suggestions? references?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: in a Small research i did, i found out that in order to use DnsQuery you need to specify the name of the owner of the record set queried (first parameter). this isn't good for me.
What are you talking about? This should work fine:
DNS_RECORD *ppQueryResultsSet = NULL;
DNS_STATUS statusDNS = DnsQuery("yaron.net", DNS_TYPE_MX, DNS_QUERY_STANDARD, NULL, &ppQueryResultsSet, NULL);
if (statusDNS == ERROR_SUCCESS)
cout << ppQueryResultsSet->Data.MX.pNameExchange << endl;
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I used richeditcontrol2 to use as it to display readonly text (as static edit box). i want to display the text in some color other than black,
i created richedit control as follows and tried to display the text ,but its displaying some junk text ..please do inform me regarding this ....
LPTSTR temp = (LPTSTR) "test";
CHARFORMAT ch;
m_Richer.GetSelectionCharFormat(ch);
ch.cbSize = sizeof(CHARFORMAT);
ch.dwMask =CFM_COLOR;
ch.crTextColor =RGB(120,250,123);
GetDlgItem(IDC_RICHEDIT24)->SetWindowText((LPTSTR)"HELLO");
Manjunath S
GESL
Bangalore
|
|
|
|
|
I think you should use _T macro:
LPTSTR temp = _T("test");
and
GetDlgItem(IDC_RICHEDIT24)->SetWindowText(_T("HELLO"));
I hope it helps.
-- modified at 10:59 Wednesday 5th July, 2006
In addition, "ch.cbSize = sizeof(CHARFORMAT) " must be done before "m_Richer.GetSelectionCharFormat(ch) ", but actually this is not even needed in case of MFC.
|
|
|
|
|
Hi,
Its displaying text but color of the text is not changing.its displaying in black color only...
Manjunath S
GESL
Bangalore
|
|
|
|
|
You should use SetSelectionCharFormat as was suggested by DavidCrow. Note that before this you have to specify the range where the colour must be applied. For instance, if you want to change the entire text, try this:
CHARFORMAT cf;
cf.dwMask = CFM_COLOR;
cf.crTextColor = RGB(120, 250, 123);
m_Richer.SetSel(0, -1);
m_Richer.SetSelectionCharFormat(&cf);
|
|
|
|
|
Manjunath S wrote: i want to display the text in some color other than black
So shouldn't you be calling SetSelectionCharFormat() then?
Manjunath S wrote: GetDlgItem(IDC_RICHEDIT24)->SetWindowText((LPTSTR)"HELLO");
Why aren't you using:
m_Richer.SetWindowText("HELLO");
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
rtf sucks. The thing to do is open MS word, create a document formatted as you wish, save it to rtf, then read the rtf text file to find out the formatting.
Pre and post fix this formatting to your desired text, then add it to your rich edit control.
earl
|
|
|
|
|
I create a control this way:
hDrawingControl = CreateWindowEx(WS_EX_LEFT,
"Static",
NULL,
WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP,
aLeftTop,
aBottomRight,
aWidth,
aHeight,
parentHandle,
NULL,
hInstance,
NULL);
How can I register an event handler to this control?
modified 9-Mar-17 17:20pm.
|
|
|
|
|
In what? raw win32 / MFC / ATL / other?
|
|
|
|
|
Raw WIN32. MFC is also interesting for me. So if you know both methods, please tell me!
Thank you!
modified 9-Mar-17 17:19pm.
|
|
|
|
|
Sorry, I spaced -- static controls don't support events.
In general:
MFC supports message cracking; there is a tool built in to visual studio to help with this or you can manually modify the message map macros.
win32 makes you do some more work on your own. In general, most controls (and certainly the system controls -- static, edit, button, etc) will notify you via a WM_COMMAND message sent to your WndProc. See the WM_COMMAND docs in the msdn, but basically you check WPARAM for the window identifier, LOWORD(LPARAM) for your child window handle, and HIWORD(LPARAM) for your notification code. See the docs for the various controls to see lists of the notification codes. Or just grab them from the headers -- seach for, eg, EN_CHANGE (code for an edit control changing).
http://windowssdk.msdn.microsoft.com/en-us/library/ms649779.aspx
earl
|
|
|
|
|
It's not totally clear what you mean by events. As earl says, there isn't anything interesting that a static control would be doing to warrant it sending notifications to the parent window.
However, if you want to handle messages going to the control yourself, WM_MOUSEMOVE, WM_LBUTTONDOWN etc etc, you can subclass the window using SetWindowLong with GWL_WNDPROC and specify your own window procedure that would receive the messages.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_subclas3.asp[^]
In MFC you would just inherit off the appropriate base class (CStatic etc) and the framework handles the subclassing for you and you just have to use the IDE to add the messages you are interested in handling to the message map.
|
|
|
|
|
Hi,
I have a project using MFC ( win32 but use mfc in static library)
and would like to use a code that not use mfc(win32). Anyone know the best way to modify it?
thanks in advance
farshad
|
|
|
|
|
Can you be a little more specific about what you are trying to do?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Most of the MFC classes are a wrapper for win32 functions or doing a set of actions that can be performed with a number if win32 functions.
on using win32, you may have to play with handles instead of classes and its pointer.
It is depends on your project and amount of MFC code used inside project. Anyway there's a countable effort to make an MFC application to win32 application.
e.g there is CWnd::FindWindow function and FindWindow win32 function
the differnce is that. CWnd FindWindow returns a static CWnd* (pointer) and FindWindow API return an HWND. in win32 you may have to add more parameters for corresponding API.
Sit with MSDN and visual studio. If you are an expert or average knowledge in win32 and MFC, the conversion will be more fast. Using static library and shared library is not a big deal. in the initialization, there we need to call Invoke static library instead for controls. finally it matters in the file size and less number of dependency.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
<blink>My Blog | Understanding State Pattern in C++
|
|
|
|
|
My project have two dialog box.
If I want to call AddString function from parent dialog for add string of List Box Control that in child dialog.
How I write the code?
|
|
|
|
|
is the child dailog is a modal dialog?
there you can do this in 2-3 ways.
1. Provide an interface from child dialog(public function) to add the string to list box. Inside that function call "Addstring" function of the required list box. or keep it in data array and update to list box whenever needed(recommended)
2. Return the handle of the list box on calling an interface (public function)provided. ( not recommended)
3. Define a custom message handler in child dialog. pass the string in on calling PostMessage or SendMessage pass the string (pointer) in WPARAM or LPARAM (casting may requried). Inside the message handler cast the passed parameter to string pointer and update the listbox. for message sending in this case SendMessage is good because post message will return on posting the command. it will not wait till the update complete. so the pointer passing to the function may get invalid. ( this is too not recommended)
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
<blink>My Blog | Understanding State Pattern in C++
|
|
|
|
|
hi
i have downloaded a project from Codeproject,for serial port communication.
http://www.codeproject.com/com/CompCateg2.asp[^]
In SerialCommunications Classes i have added function Ready() and function Run(),When Ready function is called i am getting "ok" reply from instrument,then i call Run() function, it takes 5 to 10 mintues to complete the run, so i have to wait,bec of that UI freez,for that i want to create a worker thread,so that worker thread will check for the reply from instrument,after some time..how to dot it..?.In Ready() i am calling On_FireSend()..should i need to in Run() also..?
Thanks in before
James
-- modified at 9:57 Wednesday 5th July, 2006
|
|
|
|
|
Cedric answered your question below. CreateThread
earl
|
|
|
|
|
|
|
hi sarath..when u have checked..it did not complete my question,i was just checking whether..URL link is correctly added or not..pls help me..if u have any idea...
James
-- modified at 10:09 Wednesday 5th July, 2006
|
|
|
|