|
I've been working with binary behaviors for the last two weeks, but the resource in the net is very poor. Anyone of you already work with binary behaviors?
|
|
|
|
|
Hu?
what behavior, zeros and ones ? or binary files or bit patterns ?!
Max.
|
|
|
|
|
No,
Behavior is a custom TAG that you can do with IE 5.5.
A binary behavior is the code write in a dll.
Take a look at MSDN....
|
|
|
|
|
Can someone tell me what is the easyest way to create a child dialog box from the main window of an SDI project ?
This window should be like a ToolWindow.
Thanks.
|
|
|
|
|
DoModal(this) ???
Just create the dialog in the resource editor, make it a tool window, and create a class for it. In the SDI project, you just create an instance of the class and pass this into DoModal to make it a child.
If you want a toolwindow, I suspect you want to create a modeless dialog ( the main window remains functional ), in which case, do something like this in the constructor of the dialog]
if (Create(IDD, this)) ShowWindow(SW_SHOW);
Then make the dialog a member variable pointer, and call new on it when you want to show the dialog, and either ShowWindow(SW_HIDE) or DestroyObject(I *think*, it's been a while since I did this)/set to NULL when you don't want it anymore.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
what is ToolWindow?
|
|
|
|
|
Undocked CDialogBar?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
It's a window style where the caption bar is half the normal height. So called because the smaller caption uses less space and makes it a better choice for floating 'option' windows in programs.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Tool windows have a narrower title bar.
WS_EX_TOOLWINDOW is an extended window style.
Normally they are used for docking toolbars.
Nish
I am the Keyboard Smasher
|
|
|
|
|
I'm a c++ student trying to move out of crappy black and white console mode to marvelous WindowsLand. I have learned how to write text in the client area using the TextOut api function but don't know how to get data in from the keyboard without using a dialog box. Is there a windows api command that is the equivalent of cin?
A noble spirit embiggins the smallest man
|
|
|
|
|
Nope. Well, kind of nope. Windows programming is not linear, it is event based. So there are three events you can focus on, they are OnKeyDown, OnChar and OnKeyUp. OnChar is the best place to check keyboard input, but you need to be aware of a few things.
1. nothing will happen with the key unless you make it. If you want to put the text into a view, you need to build a string from it and draw it
2. If you have controls or windows that can take the input focus, they will recieve this message instead of your main window.
What you may want to do is have a text input area, which can be easily done with a dialog or form view. An edit or rich edit box will take care of the details of recieving and displaying keyboard input ( such as dealing with backspaces, etc ), and all you need to do is use GetWindowText to recieve the result. You also get messages from these controls when people type stuff, etc.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
not really.
WindowsLand is event driven, so your app mostly justs sits there waiting for things to happen to it. in your case, what you want is to capture keystrokes. unfortunately, this isn't a trivial task (certainly not as easy as cin). the best you can do is get each keystroke, one at a time.
if you're in MFC, try overriding the OnChar function for your window (this captures WM_CHAR messages and lets you get at the incoming character).
-c
Ah, but a programmer's reach should exceed his grasp, or what are late nights for?
Smaller Animals Software, Inc.
|
|
|
|
|
If I type a character in the edit portion of a combo box, Onchar is not called.
though it is called if the combo box is a dropdownlist.
I need to do some validation when a character is typed in the formal case.
Help?
|
|
|
|
|
What *exactly* do you want to do? Do you have a console app and want to get rid of cin? Or you have a GUI app and want to handle keyboard input?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Imho, you're best off creating an edit control and handling the Windows message generated when the user presses <CR>. As others have pointed out, there is no synchronous, blocked "cin" function since Windows is an event driven system.
As you've probably encountered, simply calling TextOut() once won't permanently display your text. You'll need to call the function every time your window needs to be painted - i.e. you'll need to handle the WM_PAINT event.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I think it's clear in his post that he's moving from console to Windows programming and has a window which he's managed to put text into, but wants also to read the keyboard.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
My experience shows that you can't assume *anything* on this board
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Are you assuming that?
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Thanks for the help. I'm going to run all input through a dialog box.
thx
|
|
|
|
|
Hi!
I have added the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProg
with the param value UninstallString="RunDll32 C:\WINDOWS\DOWNLO~1\MyProg.DLL,DllUnregisterServer"
But when I launch Uninstall from the control panel, I get the message :
"Rundll32 has performed an illegal operation and will be shut down"
I put another entry point DllUnregisterServer2 doing nothing in my DLL, but I obtained the same message ...
Could someone help me on how to uninstall a dll from the control panel or what is the right syntax of an entry point called for uninstall?
Thank you!!
|
|
|
|
|
must replace by
UninstallString="regsvr32 -u C:\WINDOWS\DOWNLO~1\MyProg.DLL"
soptest
|
|
|
|
|
Thank you!
Just another thing : Is this implicitly calls the DllUnregisterServer function? ... the problem is that I ould like to add an event while uninstalling, like a message box or a shellexecute command ...
Thank you once again!;)
|
|
|
|
|
Could you please tell me if there is any easy way to do this?
the problem is: I have a dialog, which have 14 radio buttons and 14 edit boxes. The 14 radio buttons are grouped and have an int m_nRadio assigned to it. Each radio button has an edit box to its right, and each edit box has a CString variable associated with them, they are named as m_edit0, m_edit1, m_edit2, ..... , m_edit13.
now, when user press a button on the dialog, I want to get the contents of the edit box next to the selected radio button, that is:
if ( m_nRadio == 0 ), I want contents of m_edit0;
if ( m_nRadio == 1 ), I want contents of m_edit1;
What I can think of now is using a 14 cases switch statement, which is clumsy, and stupid. Is there any good way to do this?
Thank you very much for any input!
|
|
|
|
|
Well, I can think of 2 solutions. The first would be to make your edit variables an array. But I think that would cause MFC's automated dialog junk to get very confused. Another option would be to create an array of pointers and initialize it with the address of each edit field. Then you can still use the MFC automation junk while being able to get the proper edit field using an index.
There really isn't a good clean way of doing it that I know of.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|