|
Answering the phone:
1) Wait until it rings
2) Pick up the horn and say your name, preferably 'goodmoring' as well
Just kidding Now this is how your modem should do this:
First you have to set the DTR to true. Don't ask me why, you just have to. You can use the SetDTREnable(true) function for that.
Then send the next message to the modem:
ATE1S0=1
followed by a carraige return - line feed again.
Now it will pick up the phone (if everything's okay, you will probably see the AA light on your modem light up... Auto Answering mode).
Now you're gonna have to poll the input buffer and as soon as you get a message from the modem (ended by a carraige return - line feed) which starts with the string 'CONNECT ', then you know the handshake has succeeded and your connection is open...
Good luck!
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Thanks aloooooooot for all helps.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi again ...
I want to know can i control the Microphone in MSCOMM ?
Because i can dialing by MSCOMM, and i can hang up the phone and ... but when i speak in microphone, my friend can't hear my voice !!! why ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Oh, well,
you lost me there. All I ever did was let 2 PC's communicate. I've no idea where the voice comes in... I don't even know if it IS possible, even though I think it should be...
Good luck!
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Hi again,
How are you ?, i have other question ...
I see example about MSCOMM in MSDN ..., in this example he write function for sending data(I wrote, too), but he write this function, too !!!
void DoEvents()
{
MSG msg;
while(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
{
if(!AfxGetThread()->PumpMessage()) return;
}
}
Just, i want to know for recieving data, i must use of this function ???
Thanks.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hello again to you too,
I'm doing fine, thanks. What about you? I'm starting to get curious about the sort of application you're building at the moment... If it's not too rude sticking my nose into your business
Anyways, I've left the MSComm story a month ago and am now busy programming some ASP-website.
About your question, this function looks like some weird windows-messaging function. I think it's probably a GUI-related function from the example. Shouldn't worry about it too much. I never used it and my application is working great.
Good luck!
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Thanks, you really helped me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Using Visual C++ 6.0 and MFC
I have populated a CEdit control programmatically. Sometimes the text is longer than the display area.
Can anyone please tell me how to issue a command to scroll back to the start of the text. Currently it always scrolls to the end.
Thanks in anticipation
Sara
|
|
|
|
|
How did you get the such a strange behaviour ... ?
I've just created a MFC dialog-based app with a single line edit control and I tried that code:
1)m_edtText.SetWindowText("I'm the man with the mission");
and that:
2)m_strText = "I'm the man with the mission";
UpdateData(FALSE);
and all works fine (it means - I can't reproduce your app behaviour =).
Anyway - try this code:
m_edtText.SetSel(0,0);
Hope it will help you.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Calling the CEdit member function SetSel(0, 0, FALSE) will scroll it so the first character is visible.
p1514
|
|
|
|
|
Many thanks to Ben, anonymous , markkuk.
As a result of your help (jun 14) I share the next example program that worked very well for my purposes:
// Example about using map
#include <iostream>
#include <string>
#include <utility>
#include
using namespace std;
const int tam=10;
struct stTot {
string stLey;
double dMonto[tam];
};
stTot myTot;
map<string, sttot=""> mpCont;
string clave;
int main()
{
myTot.stLey = "Text one";
for(int i=0; i<tam; i++)
="" mytot.dmonto[i]="i+11;
" mpcont["one"]="myTot;
" mytot.stley="Text two" ;
="" for(i="0;" i<tam;="" clave="two" mpcont[clave]="myTot;
" map<string,sttot="">::iterator it = mpCont.find("one");
cout << (*it).first << " " << (*it).second.dMonto[3] << endl;
it = mpCont.find(clave);
cout << (*it).first << " " << (*it).second.stLey << endl;
return 0;
}
/*
Output obtained for both cases is:
one 14
two Text two
*/
|
|
|
|
|
Unfortunately, some words or characters seems not to be displayable, for example the include files: these are iostream, string, utility and map, all enclosed in angular parenthesis.
There some others but I think these are easy to discover for the interested people.
|
|
|
|
|
They're lost because HTML is parsed in our posts. SO a < > pair is assumed to contain an HTML command and is therefore not shown. To get those signs I used & lt and & gt, without the spaces.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Alternatively you could use the <pre> tag before your code segment and the </pre> after, everything in between should be exactly as you typed it.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
hey guys,
how do i save my drawing, which i make using onDraw(CDC* pDC) in a MFC application as an image file or how do i export it to word or any other software??
Nitish
|
|
|
|
|
GDI+ lets you save images in a variety of formats, at last count GDI supports - none. Sorry
Seriously though, there is code on the CP to save bmp files, if you want a variety of formats, you can go to www.paintlib.de and download paintlib. It supports bmp, gif, jpg, png, tif and if they've finally put in the code I gave them last year, tga as well.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Actually i am facing the problem to open a new dialog window by clicking a hyperlink in the client area of the window--
How is it possible?
Can i insert menu in a dialog window?
|
|
|
|
|
Hi Syjoy !
1)To open dialog you should write a responce code (to a hyperlink click) like the sample below:
CYourDlg dlg;
dlg.DoModal();
please note that rhe example is for a modal dialogs only ... hope it will be enough for you.
2)Yes it's possible.
3)To insert menu into dialog (assuming that you're using MFC, ClassWizard and other usefull stuff =):
a)Insert a new menu into resources ... name it IDR_MENU1
b)select a dialog you'd like menu insert into (Resource View "Tab"->Dialog->)
c)Select diagog properties - (rigth click on the dialog)
d)Select "General" Tab
e)In "Menu" combo select IDR_MENU1.
f)compile project
g)link project
h)debug it a little
i)run it
j)enjoy =)
I'm in a rather good mood today =);P
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Actually i am facing the problem to open a new dialog window by clicking a hyperlink in the client area of the window--
How is it possible?
Can i insert menu in a dialog window?
|
|
|
|
|
Hi
Please tell me how to convert from int to BSTR in VC++.I want to create a xml node with an int value.I need to pass BSTR variable to the method createTextNode().
How can I do it?
Thanks.
Pathi
bhikshapathi_g@semanticspace.com
|
|
|
|
|
Convert the integer into a string using itoa and then either type cast it directly to BSTR or copy it first in a CString object and then into a BSTR.
I hope this helps.
|
|
|
|
|
TCHAR szStringRepresentation[32];
wsprintf ( szStringRepresentation, _T("%d"), nYourIntegerValueHere );
pInterface->CreateTextNode ( _bstr_t(szStringRepresentation) );
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I have an MFC application that has some dialogs with there classes. I want to take these dialogs with the classes into a dll. How can I do that.
Please this is urgent...
Anyone knows why Visual C++ compiler causes problems in Windows 2000.
|
|
|
|
|
DLL:
Create an MFC extension DLL project with the App wizard.
Include (copy over) your dialog classes, and resources. (you can open the original apps .rc file and drag and drop the dialog templates to your dll projects resource view).
Add AFX_EXT_DLL to the declaration of your CDialog based classes (after the class keyword).
Compile the dll.
APP:
In the apps that will use it, include the now modified (AFX_EXT_DLL) headers for the dialogs and the defines for the resource ids of the dialogs - try not to conflict with any of the existing apps dialog IDs.
Add the dlls lib file to the apps project link settings.
You should be able to work with the classes in your app, as long as it can find the DLL.
|
|
|
|
|
After posting the above, I ran into some strange problems as I went to test in release - some strange problems with VC that I don't think I have seen before - seems ok now, but could you describe a bit more about the type of workspace you're working and the problems you are having?
Also, what service packs do you have for VC (HKLM\Software\Microsoft\VisualStudio\6.0\ServicePacks)
|
|
|
|