|
I think the problem is with the name server of the site you tried to access, not your program, because even standard tools like nslookup can't get the name of 166.111.4.100:
$ nslookup 166.111.4.100
Server: localhost
Address: 127.0.0.1
*** localhost can't find 166.111.4.100: No response from server
$ nslookup www.tsinghua.edu.cn
Server: localhost
Address: 127.0.0.1
Non-authoritative answer:
Name: www.tsinghua.edu.cn
Address: 166.111.4.100
$
|
|
|
|
|
Thanks very much for your reply.
I still have a question. In your reply, you have said that "I think the problem is with the name server of the site you tried to access". Do you mean the work of converting ip address to www address is done by the "name server"? But I think the work is done by other internet servers like the servers converting www address to ip address. Maybe what I think is wrong, because I do not know much about the protocols. Can you give me a simple explanation of how the converting process works? What is the name server you mentioned before in my example(www.tsinghua.edu.cn, 166.111.4.100 or others)?
Thank for helping me.
Maer.
|
|
|
|
|
The name servers take care of both forward (name to IP address) and reverse (IP address to name) mapping. I don't think a simple explanation of DNS is possible , but see the DNS tutorial or the chapter on DNS in the "Rute" The name servers for tshinghua.edu.cn domain are:
ns2.net.edu.cn (202.112.0.33)
dns.tsinghua.edu.cn (166.111.8.28)
ns.pku.edu.cn (202.112.7.13)
ns2.cuhk.hk (137.189.6.21)
I used the DiG (Domain Information Groper) program to look up the name server info.
|
|
|
|
|
Thanks for your reply.
From the article you introduced to me, I have got a simple idea about how the name server works. Thanks again.
I still have a foolish but simple question. That is, is there any tools like the "DiG" or "nslookup" running on Windows Me? Or is there any web sites providing such service like the "DNS tutorial" you introduced to me.
Thanks.
Maer
|
|
|
|
|
The original dig and nslookup commands are parts of the BIND software package. A Google search gives several versions of nslookup for Windows, e.g: WWW interfaces to nslookup, dig, etc. can be found here.
|
|
|
|
|
Thanks very much. I find the tools and web sites you introduced to me is very powerful.
You are a patient and a good teacher. I hope you can help me if I have other question when you are not busy.
Maer
|
|
|
|
|
I need to override the paste command of a CEdit control (When the user chooses Paste from the popup menu or presses Ctrl+V). The problem is that there is no OnPaste or WM_PASTE commands in the class wizard. How do I get this message?
|
|
|
|
|
You'll have to become a wizard yourself. Manually add
ON_MESSAGE(WM_PASTE, OnPaste)
to message map in CYourEdit class. The header of the function should look like this:
afx_msg LRESULT OnPaste(WPARAM, LPARAM);
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm having problems updating a database table containing a couple of numeric fields (length=3, precision=4, scale=2) on a MS SQL Server.
When I call the Update method on my CRecordset derived class I get an "Invalid character value for cast specification" error.
I know this is caused by the numeric fields, since without them it works alright.
When I generated my recordset using the class wizard it set the type of these fields as CString, which I assume is because the ODBC driver does not support the numeric datatype. Thus it tries to convert the numeric to a string when reading from the database, and back to a numeric when writing. All this is beyond my control.
What I'm trying to figure out is how to update these fields without getting the above mentioned error message.
Here's a simplified version of my code:
mySet.Open(CRecordset::snapshot, NULL, CRecordset::none); // Selects a unique record in my database (verified)
mySet.Edit();
mySet.m_MyNumeric1 = "2,00";
// In Sweden we used , instead of . as a decimal separator so that's why the
// above value might look suspicious to most of you.
// I've tried changing this field to "2.00" too, but the result is the same.
// The value is also stored with , as separator in the database.
mySet.Update() // Causes the above mentioned exception to be thrown.
I'm starting to fear that this problem is caused by a conflict between . and , in the driver. I've tried changing the field to almost anything by now, but nothing seems to help.
Does anyone recognize this problem? Some tips would be much appreciated.
|
|
|
|
|
I think you are giving the wizard way too much credit when you write
"When I generated my recordset using the class wizard it set the type of these fields as CString, which I assume is because the ODBC driver does not support the numeric datatype. Thus it tries to convert the numeric to a string when reading from the database, and back to a numeric when writing. All this is beyond my control"
You probably need to change the field bindings to numeric fields (if you were unable to do this with the wizard you may have to do it manually) I have found that it is extrememly important to have the data types match or I will experience the same types of exceptions
|
|
|
|
|
1.How the MDIFrameWnd find "Window" menu.
2.How are the ChildWnd titles added to "Window" menu
In other words: how the "Window" Menu works?
Meng
|
|
|
|
|
1) It looks for the rightmost popup containing the item ID from the range AFX_IDM_WINDOW_FIRST..AFX_IDM_WINDOW_LAST.
CMDIFrameWnd::GetWindowMenuPopup does the job.
2) This is done with Win32 API - check WM_MDISETMENU docs for details.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hello,
pls help me how to make a custom dialogbased application with buttons in title bar.
|
|
|
|
|
Checkout http://www.codeguru.com/buttonctrl/ccaptionbutton.html.
/Tommy
|
|
|
|
|
I would like to make a combobox that allows you to resize the list part of the combo box by dragging the little grip icon in the bottom right corner of the list part, just like internet explorer allows you to do if you start to type in the address search bar.
What is the best way to do this? I tried subclassing the control and painting to the device context in the onctlcolor function, but it wouldn't let me draw to the dc. It let me resize the list part of it from there, but not draw do it?
anyone have any suggesstions for me?
thanks
Greg ellis
|
|
|
|
|
void CWhateverclass::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetTheRectangleForTheGripFunction(&rect);
dc.DrawFrameControl(&rect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
}
This should do the trick. (Or was it in OnNCPaint?? Am not sure now.)
cheers
|
|
|
|
|
I want to port a windows' program to macintosh's,how can I do?
Give my best wishs to anyone who gives me any tip!
|
|
|
|
|
I am designing an electronic whiteboard. In this program,I want to embed OLE controls such as bitmaps,audio clips in the whiteboard and then transfer them on the Internet via CSocket class. But i don't know how to transfer the OLE controls . please help me.
I am a beginner.
|
|
|
|
|
when i debug one component from vb client,the vc debuger popup one box "user breakpoint called from code at 0x*******",and only can see the asm code,what is the meaning ,and how can this be?
thank you
sandos
|
|
|
|
|
hy!
I think there is a breakpoint set in your component ( i don'y know for sure because i never do vb programming ...;P )
Bye,
BogdanO
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
I am trying to compare 2 colours having the COLORREF value, and specifying a tolerance, to decide if a pen of color 1 will be different enough to be visible if drawn on a background color 2.
Do you know of a reference where I my be able find information about this. I thought about using variation of the algorithm I have for finding the nearest color from a palette. However it is not working for me in trying to work out a reasonable value for 'dist' in the code below.
int blue = (GetRValue(dwColor) - GetRValue(sE->seRGB));
blue *= blue;
int green = (GetGValue(dwColor) - GetGValue(sE->seRGB));
green *= green;
int red = (GetBValue(dwColor) - GetBValue(sE->seRGB));
red *= red;
int dist = red + green + blue;
Happy programming!!
|
|
|
|
|
try using ABS so that red green and blue are always positive. Otherwise 0,0,255 and 255,0,0 will have a dist ==0, this way it would be 510.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
That's great
Thank you
Happy programming!!
|
|
|
|
|
As Tomaz pointed out, this was wrong, because you square the value and so a negative * a negative = a positive.
What may work for you is to look at a greyscale algorithm to get an idea of how the eye percieves blue, green and red (i.e. how strong each colour is ) and weight them accordingly.
I think you're going to have some trouble though - darker colours obviously need to be more distant from one another than lighter colours, and a greater weight distance in one colour will give better differentiation than the same distance spread over all three, for example.
How many colours do you need ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
The could be anything almost.
The software is for designing embroidery patterns, and in Cross stitch block mode I would like give an indication of the presence of a stitch even if the colours are close together. In real thing the eye would of course still see the stitch because of texture.
The result therefore does not have to be perfect but is intended to be a guide, and make previewing a little easier.
Happy programming!!
|
|
|
|