|
Why don't you create one with the wizard and then look through it. The *point* of the wizard is to save you the set up time that you seem to want to spend yourself, so it seems natural that you let it show you how it is done, then you can do it yourself.
To counter any hint of rudeness in the above, I admit to not using the ClassWizard terribly often because I like putting everything in myself.....
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.
|
|
|
|
|
Hi-
-Pls post the code- if you want specific help -
Ok, you dont like the AppWizard, but I am sure you have the following..
1. A CFrameWnd derived class
2. A CView derived class ( for the left pane)
3. A CView derived class ( for the right pane)
I assume you also dont like ClassWizard, in that case
1. Manually override the OnCreateClient function in the CFrameWnd derived class.
2. Add a member variable CSplitterWnd (m_wndSplitter) in the CFrameWnd dervied class.
3. Add the following code to the OnCreateClient function..
.....
m_wndSplitter.CreateStatic(this, 2,1);
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(LeftView),CSize(rect.Width(),rect.Height()), pContext);
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(RightView),CSize(rect.Width(),rect.Height()/4), pContext);
.....
Voila thats it..
Also handle the WM_SIZE mthod if you want to..
One suggestion : If you refuse to use AppWizard or ClassWizard, you are setting yourself up for a lot of misery.
Later-
V
|
|
|
|
|
Thanks everyone. After a long and hard battle trying to do it myself without the wizard I have to admit to defeat. I cannot get it working without having debug assertions flying left and right. So I have seen the err in my ways and have switched to the dark side. After only about twenty minutes of getting familiar with the wizards I finally have my splitter window working.
|
|
|
|
|
What is my wrong in this code for dialing ???
VARIANT var;
CString szTemp("+++ATDP118\n");
var.vt = VT_BSTR;
var.bstrVal = szTemp.AllocSysString();
m_comm.SetPortOpen(TRUE);
m_comm.SetOutput(var); // WON'T WORK !!!
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Are you sure this is the spot that won't work.
Are you at least able to send a single letter.
and could you elaborate on the "// WON'T WORK !!! " part please.
cheers
Alfadhly
It is Illogical to define an inventor by his invention
|
|
|
|
|
I'm using the following code which works (I've tested it until I dropped on the floor, so believe me):
m_pMSComm->SetRThreshold(1);
m_pMSComm->SetSThreshold(1);
m_pMSComm->SetInBufferCount(0);
m_pMSComm->SetOutBufferCount(0);
m_pMSComm->SetCommPort(m_iCommPort);
// Standard setings: 9600 baud, no parity, 8 data, and 1 stop bit. "9600,N,8,1"
m_pMSComm->SetSettings(m_sCommSettings);
// We want to read the buffer in it's whole
m_pMSComm->SetInputLen(0);
// Open the gates!
m_pMSComm->SetPortOpen(true);
// Call number 37 (for ISDN modems, use ATB20DT37)
CString sMessage = "ATDT37";
COleVariant vSend = sMessage;
m_pMSComm->SetOutput( vSend );
Hope this helps a little. Let me know where the problem lies.
Structured programming vs. chaotic mind boggling
|
|
|
|
|
I wrote it, but this code won't work, too.
My program can only open COM port, but my program can't dialing !!!
m_comm.SetRThreshold(1);
m_comm.SetSThreshold(1);
m_comm.SetInBufferCount(0);
m_comm.SetOutBufferCount(0);
m_comm.SetCommPort(3);
m_comm.SetSettings("9600,n,8,1");
m_comm.SetInputLen(0);
VARIANT var;
BSTR bstr_string = SysAllocString(L"ATDP118");
var.vt = VT_BSTR;
var.bstrVal = bstr_string;
m_comm.SetPortOpen(TRUE);
m_comm.SetOutput(var);
SysFreeString(bstr_string);
Please help me ... i need your help ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
2 tips:
1) I see you use ATDP instead of ATDT. I don't know what's the difference, but ik know ATDT works
2) What I forgot to mention was that instructions to the modem must be followed by a Carriage Return / Line Feed. So you should do this:
const LF = '\012';
const CR = '\015';
SysAllocString(L"ATDT118" + CString(CR) + CString(LF));
Hope this helps
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Excellent, very good, nice work, good skill, ...
Yeah, i wrote "ATDP118\015\012", this code will work.
By the way, ATDT is for Tone dialing and ATDP is for Pulse dialing ...
Thanks alooooot again for your helps ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have other question about MSCOMM ...
What is DTREnable and RTSEnable ???
I read MSDN, but i din't understand.
Please explain about it ...
And please explain to me, i must put true in DTREnable ??? or not ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
As far as I understand it, it's got something to do with the events MSComm generates...
If you put DTREnable to true, you will get a DTREnable-event on the moment the DTR light on your modem goes on or off. The same is true for the RTSEnable thingy.
Best practice is to put both values on true. This can help you a lot if you implement the communication on an event-driven manner... If you're sure you're never going to use the event anyway, I think it's okay to put it to false..
Structured programming vs. chaotic mind boggling
|
|
|
|
|
hmmm,
You write *event* in your reply ...
What is thease events ???
Does it is: Recivieing and sending events ???
So, please explain about thease events ...
Thanks.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
MSComm can fire a function (let's say an event handler) every time something happens, like when the input or output buffer is full...
You can catch these events by adding an event handler to the MSComm object on your dialog using the classwizard. It also fires events for state-changes in the modem like the DTR or RTS light going on or off...
I can't help you that much on events, though, because I wrote around these events. I never liked events that much because they only make things more difficult to understand....
Structured programming vs. chaotic mind boggling
|
|
|
|
|
hmmm,
I think best way is using of MsComm defualt ...
In MsComm defalts: DTREnable is true and RTSEnable is false ...
In last thank you again 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 wrote sending data section in my program ...
Now, i want to create getting data section, just i want to know for do it, i must use of GetInput() or SetInput() or ... ???
For example for sending, we used of SetOutput(), now for getting ???
I'm watting for your reply ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have written an ATL com dll that manipulates some data, but now I want to add a Dialoge to the Dll to display the data ect... I have gon through the wizard and inserted an ATL dialoge but I am not too sure what I have to do now. It does not have an interface or anything like that so how am I supposed to display the dialoge from the calling application. How do I add any of my com objects to the dialog class, its doen't seem to like it at the moment.
If anybody has any any demos that would be great
Cheers
AndyC
|
|
|
|
|
Could someone please tell me how I know when user clicks on a bitmap (object of CStatic) in a dialog? I have got as far as making a dialog with a picture on it and dialog class with bunch of mouse message functions like OnLButtonDown and OnMouseMove and so on. I've also turned on Notify option for the static and given it a unique ID. ...Now what do I do?
Thank you.
|
|
|
|
|
I would just use GetWindowRect on the static and check if I am inside the rect using PtInRect and the mouse pos ( in LButtonDown).
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.
|
|
|
|
|
Once you give the static control the SS_NOTIFY style, it sends its parent an STN_CLICKED notification when the user clicks it.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Thank you very much Christian and Michael, I didn't know message was sent automatically. On a related note, but different aspect of it, there is something I don't quite understand.
By trial and error, I figured today that things like Slider controls message goes to OnNotify, and Static messages go to OnCommand. What I don't understand is, how do they differ? In Class Wizard, there are:
OnChildNotify
OnCmdMsg
OnCommand
How do I know what message goes to where? How do I pick the right one in the future, without trial and error?
Thank you
|
|
|
|
|
I have a question I am running a dual processor Xeon processor running IIS 5.0 and serving pages / info from an Access DB. I havnt run into any problems yet, but here is my question.
Is there a maximum of concurrent users that can query the DB at one time?
Are there any relevant restrictions that using an Access DB over say SQL server that I should be aware of.
Can anyone provide me with information as to the benefits related with running a SQL Server over an access DB?
It seems that when I am page loading from a MAC the server really chugs? any insight? I can use many PC's concurrently, but when I access the website with a MAC its quite a different story.. Any Help / Finger pointing to help would be appreciated.
recurse.org - Recusion For the Rest Of Us.
|
|
|
|
|
Hello, the codegurus around the world.;)
Really? Did you use Access Database?
Access Database isn't the thread-safe.
That is, Access Database can't deal with con-corrent aceess on the web service.
SQL server or Oracle actually use TCP/IP, meaning Socket level exchange.
Or as long as you write the program with thread, Access database may be
the thread safe.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Just a question, I have created a group box with check boxes in it. I would like to use the graying out effect to gray out the rest of the check boxes. Can anyone help me know where to do this at. Do I do it in the function OnInitDialog() or where. I know to use the EnableWindow method, but am unsure as to where specifically to do that in my program. I have each check box defined as a member variable and I have a pointer to each check box. THanks for any help in advance.
|
|
|
|
|
If you disable ( grey out ) the other check boxes, you will not be able to click on them to select them, as they will be disabled. If they were being disabled based on sub choices depending on which one is clicked, then set it up in OnInit and set it to what it should become in the handler for clicking wach check box.
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.
|
|
|
|
|
On the surface this seems like a case where you might want to consider using radio buttons instead of check boxes, as it seems like you're trying to get the same functionality out of the checks that is built into a group of radios.
JMHO.
|
|
|
|