|
Dear friends,
I am writing an application i which there is a need to resolve a given domain and get the resultant IP. For this purpose i am using the traditional gethostbyname() technique.
But the problem is that on some LANs the gethostbyname() call fails. On such networks, the ping call on command prompt also fails. But very strange that Internet explorer and MSN messenger works normally. How can i programatically resolve domain on such networks ...
|
|
|
|
|
confused:can anyone point out soem tutorial on telephone to application control..sort of..like I dial a number and the number is recognized by the application running on my server and it responds accordingly..sort of answering machine with some intelligence..
any ideas and any tutorials are welcome..please..
thanks in advance..
cheers..
Himanshu
|
|
|
|
|
TAPI is pretty simple to learn providing your TSPI supports all the necessary functionality.
The platform sdk has some excellent samples for using TAPI. It also used to have something called WebTelephony Engine which provided some great functionality in conjuction with IIS.
The Speech SDK has links into TAPI very nicely and might be worth investigating.
The following link is a good starting point
http://www.sellsbrothers.com/writing/telprog/[^]
Michael
The avalanche has started, it's too late for the pebbles to vote.
|
|
|
|
|
I have a editbox with a date: DDX_FieldDate(pDX, IDC_PAY_DATE, m_pSet->theDate, m_pSet) . If the date was a string then i could check if the editbox was empty with the code if(myVariable=="") , but how do I do in the case with the date? The variable for the date is defined as TIMESTAMP_STRUCT theDate .
|
|
|
|
|
You can make a Control-variable for your Edit-Box (using the Code-wizard) and then call GetWindowText() on it.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Thanks jhwurmbach!
That was a really simple solution, and simple is the keyword for me
jhwurmbach wrote:
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
How can i disable scrollbar in CHtmlView, i use
this->ShowScrollBar(SB_BOTH,false);
i have windows error message
l also try :
Scrollar = this->GetScrollBarCtrl(SB_VERT);
VerBar->EnableScrollBar(ESB_DISABLE_BOTH);
error message again !
if you know how to disable scroll bar...
|
|
|
|
|
The standart functions regarding scrollbars won't work at htmlview. You have to take a look at IDocHostUIHandler and it's method GetHostInfo. (If you're working with VC7, you don't really need to care about that because CHtmlView get's informed when GetHostInfo is called, and the function OnGetHostInfo is called). In VC6, you need to derive a class from COleControlSite, there implementing the IDocHostUIHandler interface. When adding DOCHOSTUIFLAG_SCROLL_NO to the flags member of the DOCHOSTUIINFO struct passed as a parameter in GetHostInfo, scrollbars won't be displayed.
For further information go to MSDN and search for "WebBrowser Customization" or IDocHostUIHandler in general.
|
|
|
|
|
Thank !
it's OK for disable scrollbar, and now i want to scroll the document where i want, is it possible ?
|
|
|
|
|
jeremysay wrote:
i want to scroll the document where i want
Have a look here: http://www.codeproject.com/useritems/scrollbrowser.asp[^].It's usefull if you want to act on your html document directly. If not, you could simulate keyboard input per send_key(...) to let the document scroll.
But unfortunately the standard CScrollView function won't work.
|
|
|
|
|
thx a lot for he link ! but i try this code but i have some problem...
so now i know where found a example.
|
|
|
|
|
I have a Dialog Application and I want to get new data in a timer function and draw a graph of it in a the Dialog window.
In the 'OnPaint' function I am drawing using CPaintDC like this:-
CPaintDC dc(this);<br />
CRect rect (m_pt.x, m_pt.y, m_pt.x+WIDTH, m_pt.y+HEIGHT);<br />
dc.Rectangle(rect);
In the timer routine I am using InvalidateRect to make it redraw my data like this:-
CClientDC dc(this);<br />
CRect thisRect;<br />
GetClientRect(thisRect);<br />
InvalidateRect(&thisRect);
But the buttons keep getting redrawn as well, which looks horrible. So how should I be doing it, any ideas?
Any help appreciated, thanks
Ali
|
|
|
|
|
you could try one of these:
1. Invalidate only the Rect occupied by graph (from your code, i guess that the graph is not a separate control/window)
or
2. Extract the drawing code into separate function and call this function from OnPaint and from OnTimer
OnPaint()<br />
{<br />
CPaintDC dc(this);<br />
Draw(&dc);<br />
}<br />
<br />
OnTimer()<br />
{<br />
CClientDC dc(this);<br />
Draw(&dc)<br />
}<br />
<br />
Draw(CDC* pDC)<br />
{<br />
CRect rect (m_pt.x, m_pt.y, m_pt.x+WIDTH, m_pt.y+HEIGHT);<br />
pDC->Rectangle(rect);<br />
}
|
|
|
|
|
Both of your ideas seem like good solutions to me. I think I will try them both out and see which I prefer.
I feel a bit anoid with myself really for not thinking of the first one myself, it seems so obvious now you have pointed it out! Oh well, sometimes things just don't seem that obvious at the time - I'll blame it on it being Friday!
Thanks for the help,
Ali
|
|
|
|
|
Hello,
INTRODUCTION:
First of all forgive me for posting this question here as it's not related to VC++.
ENVIRONMENT:
Win2k or XP Pro.
I've created an app that must be started at the beggining and that must be stopped at the end so the user cannot switch to any other app.
The main problem was to keep it secure.
In order to do so, I've created a service that installs two system wide hooks (one that controls the keyboard and other that controls the mouse).
QUESTION:
I need to know how to avoid that the OS shows the user the phrase: "press F8 keyboard to show the start menu options" (Notice that I've translated it and I've done it from my memory (it's almost sure that the phrase is not the same but the meaning yes...)).
Thank you in advance.
|
|
|
|
|
Joan Murt wrote:
I've created an app that must be started at the beggining and that must be stopped at the end so the user cannot switch to any other app.
Basically a shell replacement? Just replace the shell with your program (some registry key somewhere), and don't allow that user to run Explorer.exe.
I need to know how to avoid that the OS shows the user the phrase: "press F8 keyboard to show the start menu options"
I'm not familiar with XP, but is it really the "OS" that displays this? It seems more logical that it would be just Explorer, and in that case it should be as easy as what I have suggested.
++luck;
|
|
|
|
|
first of all thank you for your answer...
Mike Nordell wrote:
it should be as easy as what I have suggested
I don't think that this can be an easy thing... and the fact that is the OS that shows that phrase seems clear...
I think that other versions of Windows made something similar but in Win2K Professional and XP Professional while the OS is being loaded and the first progress bar appears (not in graphical interface) under that progress bar can be read something about pressing the F8 key in order to show a safe startup menu.
I want to avoid that fact.
And, of course, it would be easy if the OS would be loaded and the system wide keyboard hook that I have installed could affect that, but as the OS is still not loaded it must be a flag/feature changeable somewhere in windows in order to avoid to show that.
Thank you in advance.
|
|
|
|
|
I would like to do something when mouse click on html page, have any good sample to show how to handle element events?
|
|
|
|
|
Why can't I use sizeof to find the size of a static data array within a class. It works fine if I use sizeof outside the class.
class myclass
{
public:
static char myarray[];
void myfunction()
{
// VC6 compile error: illegal sizeof operand
// GCC 3.2 'sizeof' applied to incomplete type 'char []'
// cout << sizeof (myarray);
}
};
char myclass::myarray[] = "this is a string";
int main(int argc, char* argv[])
{
myclass mc;
cout << sizeof(mc.myarray); // works
//mc.myfunction();
return 0;
}
another alternative I tried was to make the array const but this only works using GCC on linux; using VC6 I get errors.
class myclass2
{
public:
//VC6 error C2258: illegal pure syntax, must be '= 0'
//VC6 error C2252: 'myarray' : pure specifier can only be specified for functions
static const char myarray [] = "this is another string";
void myfunction()
{
cout << sizeof(myarray);
}
};
int main(int argc, char* argv[])
{
myclass2 mc2;
cout << sizeof(mc2.myarray); // works
mc2.myfunction();
return 0;
}
Thanks if anyone can help.
|
|
|
|
|
myarray must be defined before it is used as a parameter to sizeof, so you can't use it inside a class definition. compiler needs to see the definiton of the array to know its size.
Define the function in cpp file, after the myarray definition:
void myclass::myfunction()<br />
{<br />
cout << sizeof (myarray); <br />
};
|
|
|
|
|
|
In the SDI creat with Internet Explorer Style and a use HtmlView rather than CView? So on the left side, I created Tree (TreeView)?
How do I get the HtmlView to change the website, when I click different node in the tree? in short, How can CHtmlView get the treeview has changed message??
HELP
If there are three people walking with me, one of them can be my teacher.
[Andy]
|
|
|
|
|
When the selection in a treectrl changes it sends a TVN_SELCHANGED message. When you implement a WM_NOTIFY handler for that message in your treeview's message map, you can react on that event appropriately. In your case this could be calling the Navigate2 functon of your htmlview, passing the desired page.
|
|
|
|
|
you can detect leftclick and see if a item was selected.
|
|
|
|
|
I think what you need is to register you application to the registry.
--> check the registry section.
check on how to write system tray - there are some good one in cp.
If there are three people walking with me, one of them can be my teacher.
[Andy]
|
|
|
|