|
Is this a desktop or a mobile app?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi Dave,
It is an MFC42/CPP Desktop Application I want to Auto Dial from, to establish a Voice Connection. I.e.: I want staff to contact selected customers, via de Phone Number we have on our DB. As a Laundrette, we have an issue with customers forgetting they left stuff in. I'm writing an MFC Application for staff to deal with this during quiet times. Automatic dialling helps to prevent mis-dials, and protects our phone bill against misuse.
Thanks + Regards,
Bram van Kampen
modified 29-Apr-16 18:45pm.
|
|
|
|
|
Bram van Kampen wrote: It is an MFC42/CPP Desktop Application... And how is it connected to the phone?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi David,
Thanks for your reply.
I am planning to connect Via a "RealTech" Dial up Modem Card, or Equivalent. All my XP Computers have one, or something similar, by a different manufacturer. I also harvested about half a dozen. The Installation software is typically part of WinXP.
The XP Default installation is that specific and unspecified features may not be available. However, I seek only Voice Contact, on an Out Dialling only Connection.
I have also a number of Installation disks for older Real Tech Modems which I bought in the past. I suppose that any and all of them can do a basic Function, Dialling out, and thereafter managing a Voice Based conversation. All Computers we currently have, have also a form of sound processing card.(Very Basic in most cases) I assume that this can be used to get the Voice Aspect realised for a phone connection.
Al I am ultimately interested in is, getting an outgoing Voice Connection.
We have NO requirement at all, to deal with in coming calls.
Thanks for your Reply,
Looking forward to your response
Bram van Kampen
modified 1-May-16 20:46pm.
|
|
|
|
|
Bram van Kampen wrote:
I am planning to connect Via a "RealTech" Dial up Modem Card, or Equivalent. Okay, you'll need to look into connecting to the cards via the CreateFile("COM3", ...) function. Then you'll send the appropriate AT commands to the open port.
Also check out the TAPI.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
modified 3-May-16 9:08am.
|
|
|
|
|
Thanks David, for your Reply,
But I was really looking for a good Article about the subject, on CP or else were. Even the title of a Good Book will do.
Thanks Again,
Regards,
Bram.
Bram van Kampen
|
|
|
|
|
Note.: I replied to this earlier, but id does not appear to have landed.
Here we go again...
Hi Dave,
Thanks for your reply, but what I was really looking for was a good article about this on CP or elsewhere, or, even a book will do. Maybe You know where to find same.
Thanks again,
Regards, :}
Bram van Kampen
|
|
|
|
|
Hi Dave,
I Think we are both rumbled by gremlins. My Post was somehow split in two by the CodeProject Server.
Let us Discard One Thread, I Propose This One!
Otherwise: My Reply to This One is:
You must be under pressure, but, I know how that feels. Answered this question before in this thread, However,it is a Desktop Task, in MFC42. I am not looking for a Solution, but for an article(hopefully Old, so that it appreciates the limitations of MFc42) in CodeProject, or elsewhere. Even a Title of a book will do.
Thanks + Regards
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: I am not looking for a Solution, but for an article(hopefully Old, so that it appreciates the limitations of MFc42) in CodeProject... Did you try here?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Thanks David,
It is a Good Start!
(Mental Block I had, not looking for 'Modems' in the first place!), as you know, that's how it goes.
However, it covers, apart from a sprinkling of C or CPP, a Lot of CE, C#, etc, which have their own libraries, etc, and hence are instructive, but not very useful. For Instance, "Phone.Lib" is not a component of MFC42.
All I need to do is the Dialling, and the Channelling of the connection to the Sound System, and hanging up, after ending the call.
I'm going to try for now something called "RasDial.exe" and see how I get on with it. Hopefully I can fool it in not looking for a Phonebook Entry, or stopping it from trying to make an Internet Connection.
I have also bought a £6.00 USB Dialup Modem which comes with a CD. Hopefully the CD contains something useful. I live in hope. Even if it fails, the cost is less than a packet of cigs, and, I still have the Modem.
Hope if all else fails to be able to hang a Head Set and Mike to the 'Phone' Output, and, hope the Modem can do the Dialling via the Line Socket.
May need to set to Pulse, and a switch to isolate the head set, (I know how POTS works) but, for now hope we can make it work without having to resort to this.
Worth Six Pound to try it, though, even if it does not work!
Thanks, and, I'll keep you Posted, but, remember, I'm on my own, and have to resolve many issues, all by myself. If I get an Intractable Problem in One Place, I put it aside, for dealing with, and whilst waiting, tackle something else. That keeps the entire front moving.
Kind Regards,and thanks again
Bram van Kampen
|
|
|
|
|
Hi guys,
In my application I had a CTabCtrl object & it has 2 tab window. I want to navigate between these tabs window via Ctrl + TAB.
Currently i can do the same in preTranslateMsg i.e. to look for keydown messages & filter it out ctrl + tab key out of it & calling setcusel().
I need to know if there is any other way that I can implement the same functionality.
Thanks,
Amrit
|
|
|
|
|
I'm curious why you don't use a CPropertySheet with two CPropertyPage objects instead. Navigation would be automatically handled by the framework.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
Hi
I have a CDialog which I created on the heap along the way I create a Richedit and a number of other controls
When the users hits X in the right hand corner I Destroy the CDialog do I have to DestroyWindow the rich edit and child controls as well
|
|
|
|
|
|
Sorry Didn't see this
Quote: The function first destroys child or owned windows, and then it destroys the parent or owner window
|
|
|
|
|
No, Richard gave you the link all child windows are automatically disposed.
Your only responsibility is to cleanup any memory allocation, handles etc you specifically created. You do that by intercepting the WM_DESTROY message and cleaning up there. WM_DESTROY is sent just before the window is deleted but while the window is actually still valid.
Typically you create things in the WM_CREATE and you dispose of it in the WM_DESTROY.
In vino veritas
|
|
|
|
|
So If I do a "new" for an object which I later create a child or my case rich edit I have to delete the object after the DestroyWindow which destroys the Parent CDialog and child controls
Thanks
|
|
|
|
|
Yes, if you are allocating memory using 'new' to your RichEdit, then yes you have to release it. But you have to do it before your parent window (in this case your CDialog) is destroyed.
Override OnDestroy (WM_DESTROY) and destroy your RichEdit followed by 'delete' (to release heap memory) and then call the CDialog::OnDestroy().
|
|
|
|
|
Okay the rules with memory or object allocation and deleting are very simple.
Situation 1:
If the memory/object is used by multiple children windows and/or the parent then you create it in OnCreate (WM_CREATE) on the parent and destroy it on OnDestroy (WM_DESTROY) of the parent. The reason is because multiple children and/or parent are using it and you need it created before any children and disposed of after the children are deleted.
Situation 2:
If the memory/Object is used by ONLY the SINGLE child window EXCLUSIVELY (that is the data belongs really to the child) then you create it on OnCreate (WM_CREATE) of the child and you delete it with the OnDestroy (WM_DESTROY) of the child.
Sometimes people get lazy and just use situation 1 to cover situation 2 but there are traps in that. It is very easy to forget you need something done before the child is created which is in an unrelated block of code in the parent window create function. So generally I would advise against being lazy and using situation 1 to try and cover all situations. Using Situation 2 when it is valid to do so makes your code self contained portable without thinking about it.
Situation 2 is that most often not understood by people. I will give you a simple example I might use on your edit entry, and this is a subclass of the edit I use a lot in programs. OnCreate (WM_CREATE) of the edit box I create a string object. Whenever the user hits enter, I validate the entry via a message call and if its valid put the current value into the string object and then update the edit window to the new value. Why do this ... well because in the edit box handler hitting the "esc" key goes and gets the value from the string object and puts it back it the edit box. It is a return to last valid value function or a simple single step back. If you think about it you could extend the concept to a list and be able to scroll back thru the list of entered values something you might recognize for the entry address input of your web browser. Now the point here is the string object is the edit boxes responsibility to delete so it will do that on it's OnDestroy (WM_DESTROY). Now everything is self contained I can create as many of these edit boxes as I want into a parent and they all look after there own object string.
So basically you need to work out what data is being used where and in this regard it is very similar to thread or task code.
In vino veritas
|
|
|
|
|
How does one view/obtain the GCC C sources?
I don’t know how to use git. I just downloaded a Windows version yesterday (haven’t installed it yet), and am studying an ebook on it. Or should I use GitHub? I don’t know anything about these things. Is there an easier way to do it? Is there an ftp site where you can just download it from without having to learn/use some complicated source code management system?
I’ve nearly completed writing my own version of only what I need from the C Standard Library, and all I need from the C++ Standard Library is a String Class, and I’ve used my own for many, many years which works fine. The only thing I need yet is a full implementation of pow, and possibly exp if pow needs that, and I don’t know how to do it myself. That’s why I need to study and learn from the GCC C sources. I’m linking without the Standard Libraries so as to avoid the bloat, and using Windows.
But if I’d have asked here first how to implement pow, within 1 minute of posting that question I’d have been told to look at the GCC sources, which I don’t know how to do. That’s why I’m asking for instruction here first on that. Once I’ve figured out how to get at the GCC sources, then I can tackle my pow issue.
I'm not the only one baffled by this...
Apparently, I downloaded the wrong program ( git ), and am studying the wrong book. Apparently I've got to learn how to use svn before I can even attempt this? This is ridiculous, in my opinion.
I guess what I'm looking for is a list of all the hoops I've got to jump through to get what I want. Something like this...
1) Download and install Subversion (and hope there is a Windows version of it);
2) Buy a book that teaches how to use Subversion;
3) Figure out how to use Subversion to navigate to GCC sources;
4) Find pow or exp and figure out how it works;
Is the above what I should do, or is there some other route?
modified 24-Apr-16 9:01am.
|
|
|
|
|
Frederick J. Harris wrote: This is ridiculous, in my opinion. Many things are. However, if you want source code then you have to go and search for it. Have you tried the GNU website[^]?
|
|
|
|
|
I think I'm on the right track Richard. I downloaded Subversion for Windows from SourceForge, but it doesn't look like I have to use it. By replacing svn:// with http:// I can browse to sources as just ftp folders. I've gotten this far...
https://gcc.gnu.org/svn/gcc/trunk/
https://gcc.gnu.org/svn/gcc/trunk/libgcc/
Perhaps I just need to spend some time searching for pow. Haven't found it yet.
|
|
|
|
|
Frederick J. Harris wrote: searching for pow ... probably in a file named math.c, or similar.
|
|
|
|
|
What you are looking for are the glibc sources (the C standard library) and not the GCC sources (the GNU compiler collection). Glibc download: The GNU C Library[^]; download without using Git: Index of /gnu/glibc[^].
The pow() and exp() functions are part of the math library which depends on the target platform processor. Once you have unpacked the glibc sources, these functions can be found here for x86 CPUs (file names for double ):
- sysdeps/i386/fpu/e_pow.S: Implementation using the x87 math coprocessor.
- sysdeps/ieee754/dbl-64/e_pow.c: Implementation in plain C.
The FPU implementation is in assembler and should not need any other functions. The IEEE implementation needs other modules (at least e_exp.c) and some header files.
|
|
|
|
|