|
|
Thank you.. I will go through it. How to start working with dial up connection projects? Is dialup networking and dial up connection projects are one and the same? Can anybody shows me a link to study on the topic?
-- modified at 5:19 Wednesday 10th May, 2006
|
|
|
|
|
Use the following APIs
RasSetEntryProperties - to create a new connection in the RAS phonebook
RasDial - to dial
RasHangUp - to disconnect
RasGetConnectStatus - to get the status of the ras connection. Also use this after a RasHangUp to see when your handle is closed, ie when windows really is finished with your ras connection. You do that by polling RasGetConnectStatus until it returns ERROR_INVALID_HANDLE.
RasDeleteEntry - to delete a phonebook entry created with RasSetEntryProperties
Also note that the RAS Api is very much OS version dependant. You will see that when reading the docs for RasSetEntryProperties. I would recommend to go for minimum Win200 if you cant do that you will have much more work to do.
The following RAS properties that you can set in the GUI has no function to set them. So if you really need to change them you need to update the ras phonebook file manually
* Redial on link failure
* DNS Suffix
* MS client
* MS File printer sharing
* Hardware flow control
* Connection speed
Feel free to ask more questions if you like... Ive done a really heavy weight dialer
Magnus
|
|
|
|
|
I am converting a project fom VC++6 to compile under Visual Studio 2005. I have sorted out everything except this line:-
HtmlHelp(this->m_hWnd, strRef, HH_DISPLAY_TOPIC, NULL);
This gives me the error:-
error C2660: 'CWnd::HtmlHelpA' : function does not take 4 arguments
I have Googled it and seen a solution suggesting replacing HtmlHelp with ::HtmlHelp, but this did not work, I then got a Linker error:-
error LNK2019: unresolved external symbol _HtmlHelpA@16 referenced in function ....
Any ideas?
Many Thanks,
Ali
|
|
|
|
|
Alison Pentland wrote: HtmlHelp(this->m_hWnd, strRef, HH_DISPLAY_TOPIC, NULL);
this->m_hWnd can be left out.
HtmlHelp(strRef, HH_DISPLAY_TOPIC, NULL);
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Thanks for the suggestion, I tried:-
HtmlHelp(strRef, HH_DISPLAY_TOPIC, NULL);
But now the error is:-
error C2660: 'CWnd::HtmlHelpA' : function does not take 3 arguments
In fact it seems that HtmlHelp now takes 2 parameters, but I can not figure out what they should be!
The irony of it is that when I press F1 for context sensitive help on HtmlHelp, it says "Information Not Found".
So I can not get context sensitive help on my problem with context sensitive help!
Thanks again, any other suggestions?
Ali
|
|
|
|
|
Now CWnd::HtmlHelp(HH_DISPLAY_TOPIC, NULL);
-- modified at 4:23 Wednesday 10th May, 2006
exapmle from MSDN
HWND hwnd =
HtmlHelp(
GetDesktopWindow(),
"c:\\Help.chm::/Intro.htm>Mainwin",
HH_DISPLAY_TOPIC,
NULL) ;
::HtmlHelp(hwndhandle,file,HH_DISPLAY_TOPIC,15);
|
|
|
|
|
Hi, and thanks for the help.
I am sorry but I don't follow what you mean.
I have changed my line of code to:-
HtmlHelp(HH_DISPLAY_TOPIC, NULL);
And now it compiles and runs, but when I click the 'Help' button it does not work, it says 'Failed to Launch help".
I suppose it doesn't know what the name of the help file is? I guess I've got to do something else, but what?
Thanks for your help,
Ali
|
|
|
|
|
#include htmlhelp.h
you get error LNK2019 because you need to
import
htmlhelp.lib
i use this way and its work without error Failed
HWND hwnd = ::HtmlHelp(::GetDesktopWindow(),
"c:\\2.chm",HH_DISPLAY_TOPIC,NULL) ;
|
|
|
|
|
Thank You
I copied htmlhelp.lib into the project & then added it to the linker dependencies and it compiles & links now with errors.
Cheers,
Ali
|
|
|
|
|
Hi,
We are trying to establish connection between Delegate client and server.
we able to set Delegate server. we are having problem to set Delegate client.
If we try to establish connection, following error occur
1) unknown parameter: -P8021 FCL
2) NIS not available
3) ## cannot load z
pls provide soln for above problem. so we are able to establish connection.
regards
Girish
Software Developer
|
|
|
|
|
|
|
write smth like it
class MyClass : public CObject{
public:
MyClass();
virtual ~MyClass();
virtual void Serialize(CArchive& ar);
COleDateTime m_tmDate;
};
ar<<m_tmdate.m_dt;
ar<<(int)m_tmdate.m_status;
ar>>m_tmDate.m_dt;
ar>>(int)m_tmDate.m_status;
as result: error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)
|
|
|
|
|
NoName II wrote: ar<<m_tmdate.m_dt;
ar<<(int)m_tmdate.m_status;
ar>>m_tmDate.m_dt;
ar>>(int)m_tmDate.m_status;
ar<<m_tmDate;
ar>>m_tmDate; Tell the class to do the stuff. You are trying to help too much!
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
what's mean
"An attempt was made to access an unnamed file past its end
CFile file;
if(!file.Open(_T("persons.dat"),CFile::modeRead)){
AfxMessageBox(_T("Unable to open the file"));
exit(-1);
}
CArchive arr(&file,CArchive::load);
m_obDebtors.Serialize(arr);
arr.Close();
file.Close();
|
|
|
|
|
what's mean
"An attempt was made to access an unnamed file past its end
CFile file;
if(!file.Open(_T("persons.dat"),CFile::modeRead)){
AfxMessageBox(_T("Unable to open the file"));
exit(-1);
}
CArchive arr(&file,CArchive::load);
m_obDebtors.Serialize(arr);
arr.Close();
file.Close();
|
|
|
|
|
what's mean
"An attempt was made to access an unnamed file past its end
CFile file;
if(!file.Open(_T("persons.dat"),CFile::modeRead)){
AfxMessageBox(_T("Unable to open the file"));
exit(-1);
}
CArchive arr(&file,CArchive::load);
m_obDebtors.Serialize(arr);
arr.Close();
file.Close();
|
|
|
|
|
NoName II wrote: "An attempt was made to access an unnamed file past its end
I never heard about this error. It's perhaps because you try to load more objects than the file contains. So, you try to read after the end of the file. Can you confirm that your load and save parts serialize exactly the same objects in the same order ?
|
|
|
|
|
Hi,
would you please give a hand?
how to create a batch of button(more than 200) in the code?
use the array?
And then mapping the messages to one function onButtonClick()?
void onButtonClick(){
....// differentiate the buttons?
....//
}
..
-- modified at 3:12 Wednesday 10th May, 2006
|
|
|
|
|
Store these buttons inside a CTypedPtrMap or CTypedPtrList based on your requirements. Map requires key value pairs. For key you can use the Id of the button.
Override OnCommand to dynamically handle messages from these buttons instead of providing message map entries.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
thank you for your kindness.
I'm afraid I don't know the way of "Store these buttons inside a CTypedPtrMap or CTypedPtrList based on your requirements. Map requires key value pairs. For key you can use the Id of the button."
would you show me the simple code?
and another base-question is dynamically creating button:
I wrote the (a) and (b) in function OnInitDialog()
(a)
CButton btn;
btn.Create("Hi,World",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(10,20,80,40),this,104);
(b)
CButton *btn = new CButton;
btn->Create("Hi,World",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(10,20,80,40),this,104);
it seems that the (a) can't work, but (b) is ok.
is there any different using pointer or not?
|
|
|
|
|
zeus_master wrote: it seems that the (a) can't work, but (b) is ok.
is there any different using pointer or not?
Yes, in your case: you are probably declaring the CButton inside the OnInitDialog function, so its scope is limited to the function. Once the function is finished, the CButton destructor will be called, thus removing the button from the dialog. You won't have the problem if it's a member variable of the class.
To store the buttons, you can also simply store them in a vector or list. Don't forget to change the ID of each button also (and be sure the range of ID's you are using is 'reserved' in the resource.h file, otherwise, some other controls could take the same id and you will be in troubles).
|
|
|
|
|
thank you again for your timely teaching.
I wrote it like this, but it was faild:
CButton * btn[5];// = new 5 CButton
int i =1;
CString str;
for (i=0;i<5;i++) {
str.Format("%0x",i); // for set button caption
btn[i]->Create(str,WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(10,20+30*i,80,40+30*i),this,104+i);
}
|
|
|
|
|
Try to use vector or list from the STL instead. In your class, delcare a member variable (don't forget to include vector):
#include <vector>
CMyClass
{
private:
std::vector<CButton> m_MyButtons;
};
Then in OnInitDialog (or where you create the buttons):
std::vector<CButton>:iterator iter = m_MyButtons.begin()
for(iter; iter!=m_MyButtons.end();iter++)
{
(*iter).Create(str,WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(10,20+30*i,80,40+30*i),this,104+i);
}
I didn't test the code so there are perhaps some errors.
I strongly suggest you read some tutorials on the use of containers of the STL (list, vectors, ...). They are VERY usefull and much more safer than dynamic arrays. There is some tutorials on this website.
|
|
|
|