|
That is a good point, and it need not be an edit box at all. I'm just looking for something like an edit box with scroll controls that I can add dynamic child controls inside of. Do you have any suggestions?
|
|
|
|
|
cscafidi wrote:
Do you have any suggestions?
Nothing additional.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Here is a code snippet:
int xDim = 0;
int width = SOUND_CAPTION_BOX_WIDTH * cxChar;
//SendMessage(hList,EM_SETLINE,int((idx - SND_FILE_LIST_OFFSET)/HWNDS_PER_SOUND),(LPARAM)TEXT("\n"));
SendMessage(hList,LB_INSERTSTRING, 0, (LPARAM)TEXT("\n\n"));
captionRef = CreateWindowEx(
WS_EX_CLIENTEDGE,
"EDIT",
NULL,
//WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | WS_THICKFRAME,
WS_CHILD | WS_VISIBLE | ES_LEFT,
xDim,
yDim,
width,
cyBox,
hList,
(HMENU)idx,
hInstance,
NULL);
SetWindowText(captionRef,caption);
idx++;
numActiveSoundChildWindows++;
xDim += width;
width = SOUND_PLAY_BTN_WIDTH * cxChar;
playBtnRef = CreateWindow(TEXT("button"),
TEXT(" PLAY "),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
xDim,
yDim,
width,
cyBox,
hList,
(HMENU)idx,
hInstance,
NULL);
idx++;
numActiveSoundChildWindows++;
xDim += width;
width = SOUND_FILE_NAME_BOX_WIDTH * cxChar;
fileNameRef = CreateWindowEx(
WS_EX_CLIENTEDGE,
"EDIT",
NULL,
WS_CHILD | WS_VISIBLE | ES_LEFT,
xDim,
yDim,
width,
cyBox,
hList,
(HMENU)idx,
hInstance,
NULL);
SetWindowText(fileNameRef,fileName);
idx++;
numActiveSoundChildWindows++;
yDim += cyBox;
the 'hList' is the handle to the edit box.
|
|
|
|
|
One word: OwnerDraw
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
if ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
Hi!. i want to overload operator >>. What i've done so far doesn't work. I'm using visual C++ 6.0. When i place my mouse cursor over s, it says int s. It's the same if instead of writing 'std::string s' i write 'string s', even though in the header file i declared 'typedef std::string string;'
<br />
istream &operator>>(istream& stream, XML &x)<br />
{<br />
<br />
std::string s;<br />
std::getline(stream,s);<br />
x.fromString(s);
return stream;<br />
}<br />
This is how i declared inside the class in the header class.
<br />
friend istream &operator>>(istream &stream, XML &x)
this is what i'm including and using in the header file.
<br />
#include <iostream><br />
using std::istream;<br />
using std:stream;<br />
and in main: using namespace std;
my class is called xml
in main i declare:
<br />
xml table;<br />
cin >> table;<br />
thanks!!
|
|
|
|
|
Hi,
First of all, please tick the "Notify me by e-mail if someone answers this message" checkbox on (right below the editbox for entering the post) so that <'s appear correctly.
As for your problem, which is the behavior you observe? Does the program compile and you get weird results, or if it fails to compile what's the error? With a little more info we'll do a better job trying to help you.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
well, it compiles, and i need to load a string (s)from standard input, but as s is thought as an int, nothing gets loaded in s. And i need a string to be loaded in s so i can call the function toString
thanks!
|
|
|
|
|
Well, I don't think your s is really compiled as an int : sometimes the intellisense feature (by which you guessed the variable was being treated like an int ) gets crazy, that's all.
I'd try the following:
1. Make sure you already have a proper #include<string> .
2. To rule out some problem with getline , replace that line (just for testing purposes) with something like
s="hello world"; or whatever. What happens now? Does this shed some light on your problem?
3. After the getline output the contents of s to cout to see what it has been fed with.
Hopefully, some of these measures will make it clear where the problem lies. Good luck, don't hesitate to come back if you can't come up woth a solution.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
well, nice suggestions!!
i placed s="hello world"; and s loaded succesfully!.
i also did
std::cin >> s;
and i loaded the string succesfully. The toString function worked ok, but the stream i returned was empty, so nothing happened back at the main program
so what doesn't work is
std::getline(stream,s);
after the getline, there's nothing in s, i debugged it.
don't know why tough
thanks for your help
|
|
|
|
|
so what doesn't work is
std::getline(stream,s);
after the getline, there's nothing in s, i debugged it.
OK, I think I know what's the problem. Does your program by chance read from cin with >> before getting to the getline sentence? If so, what's happening is that getline reads the Enter after the last input and returns (quite correctly) an empty string. You may try this theory by invoking getline twice: if I'm right, the second call will get your actual string.
In case this is the problem, you might want to rethink how you do the input: in general, mixing >> and getline can be a little messy to deal with.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That did it!!
muchas gracias!
|
|
|
|
|
Dear All..
I am going to work on build an SMSC (Short Message Service Centers) application (SMS Connector to GSM Server) and i am new with dealing this subject in vc++, i make my own research on this field but i had good idea about the hole process of SMSC but i still need technical information so if there is any one had been worked on something like that to help me with this application or if anyone know web site i can use to guide me in that i will be grateful..
Best Regards,
Rasha
|
|
|
|
|
ask this on the Mobile/eMbedded forum
TOXCCT >>> GEII power
|
|
|
|
|
|
Ok, this is a bit odd to explain, I am trying to create a dialog class that is essentially modal only, and that is dismissed when the user clicks outside of the dialog window.
Furthermore, this dialog can display subdialogs with these same properties. So clicking outside of all nested dialog will dismiss all of them, while clicking on some parent dialog will only dismiss that dialog's subdialogs.
I am a bit lost of as to how to go about implementing this behavior, I have formulated a couple vague solutions using Hooks, CSubclassWnd, or regular messages. None of these are quite there, I think I am missing some key elements.
Any suggestions as to how one should go about this?
Much appreciation,
Jon
|
|
|
|
|
jonathanleebrown wrote:
I am trying to create a dialog...that is dismissed when the user clicks outside of the dialog window.
Is this really your intent? If so, it goes against how most folks perceive a dialog to behave.
What if someone is filling in the blanks on the dialog, but needs to open up another application to find something?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
This is indeed a valid concern, certainly a impediment to the general applicability of this design.
Though this class has to be general enough to use in a few different contexts, the primary usage is selecting options via listboxes, buttons, etc.
|
|
|
|
|
jonathanleebrown wrote:
...the primary usage is selecting options via listboxes, buttons, etc.
Ok, that's what dialog boxes do anyway. So why make it go away when it loses focus?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Below is the rationale for this design, perhaps you can think of a more appropriate way to offer the characteristics described there?
BTW, thanks for the discussion David. I'm very appreciative!
The dialog design allows for a different organization of controls from some typical dialog (or property sheet) layouts.
For instance: if you offer a property sheet for a complex object (in a direct manipulation environment), there can be many controls required to offer full access to those properties. Offering more than just a few controls really necessitates multiple property pages. The problem here is that this can greatly limit visibility of controls (and so properties of the object).
Furthermore, if certain properties relate to control groupings on more than one page, you pretty well have to duplicate that control on multiple pages. Study results on this topic show that new users might not realize that this particular control is duplicated, causing many usability problems.
So what we need is a some control layout that can offer the conceptual grouping of controls while maintaining good visibility that helps maintain the user's understanding of control relationships.
Finally, considering the hierarchical nature of this design; if the dialogs required pressing the OK button for every dialog presented, this can increase task time beyond what is acceptable for the project.
|
|
|
|
|
Thinking about this a bit more, the dialog class would behave much like the VC++ unpinned properties (dialog? Miniframe?) sans caption bar and close button.
|
|
|
|
|
You might want to look at the WM_ACTIVATE and WM_ACTIVATEAPP messages. These are the messages being sent to the unpinned Properties dialog.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hmmm, thanks a lot for the tip. I'll do that.
|
|
|
|
|
I'm trying to broadcast a message using this:
<br />
::SendNotifyMessage(HWND_BROADCAST, WM_MYMSG, 0, 0);<br />
If another app, I've got a handler in my CMainFrame class that handles that message, like so:
In the header file:
<br />
protected:<br />
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);<br />
afx_msg LRESULT OnReadyRemote(WPARAM wParam, LPARAM lParam);<br />
DECLARE_MESSAGE_MAP()<br />
And in the CPP file:
<br />
LRESULT CMainFrame::OnReadyRemote(WPARAM wParam, LPARAM lParam)<br />
{<br />
wParam;<br />
lParam;<br />
AfxMessageBox("Kicker Ding");<br />
return 1L;<br />
}<br />
The message is registered like so (in a common header file used by both apps):
<br />
----------------------
I'm fairly certain that the app braoadcasting the message is actually doing so, but I know for a fact that the other app isn't seeing it.
Anyone have any ideas?
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm
|
|
|
|
|
Are you missing:
ON_REGISTERED_MESSAGE(WM_MYMSG, OnReadyRemote); in the message map?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
ON_MESSAGE won't handle a registered message?
I'll give it a go.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm
|
|
|
|
|