|
Please is Easy...
You need to read the string until the first space....
Regards...
At the source of every error which is blamed on the computer, you will find at least two human errors, including the error of blaming it on the computer
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
That should be pretty straightforward. If the char array where you have the input is pStr1 then pStr1[0] would be the first character in your string. Now use a switch-case construct.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
does this help?
char buffer[200];
gets(buffer); // get the whole line of user input
trimfrontspaces(buffer);// get rid of any spaces before the first character
swich(*buffer)
{
case 'B': break;
case 'S': break;
case 'C': break;
default: break;
}
|
|
|
|
|
I've got an SDI app with the usual status bar.
But I've also added another status bar, which is placed above the ordinary one. The second one also has the "size grip" in the bottom right corner to resize it with.
How do I get rid of this resizing feature?
I do not want the user to resize the status bar.
Cheers,
/Fredrik
Sonork ID: 100.11430:PhatBoy
|
|
|
|
|
take a look at CBRS_SIZE_DYNAMIC and CBRS_SIZE_FIXED when you create the second status bar. You might need to take care to give it an unique ID too, but probably only if you are using LoadBarState().
|
|
|
|
|
mcsellski wrote:
take a look at CBRS_SIZE_DYNAMIC and CBRS_SIZE_FIXED when you create the second status bar.
But then it does not display at all?
Cheers,
/Fredrik
Sonork ID: 100.11430:PhatBoy
|
|
|
|
|
Hi,
I'm playing with an explorer like app (SDI), which has a ListView in a splitter window. I need to handle the notification messages from the list control.
Where do the handlers for list view notifications belong? In the Main Frame, or the View? Does it matter? The listview notifications don't see to be directly supported by ClassWizard, so I guess I'll need to add the entry to the message map manually.
Thanks
|
|
|
|
|
Aaron Schaefer wrote:
Where do the handlers for list view notifications belong? In the Main Frame, or the View?
View
Aaron Schaefer wrote:
The listview notifications don't see to be directly supported by ClassWizard
Class wizard support it,search,you'll find it;)
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
I tried over-riding the OnNotify method of the CMainFrame class and managed to get the notification messages OK. Then I commented out the OnNotify in the Main Frame and tried overriding it in the View class, but never got anything.
So how do you handle the listview notification in the view? Does the frame handler have to forward it or something?
|
|
|
|
|
Sorry ,it's not clear for me ,if you mean you overriden it in both of them,
it'll not wotk ,only overriden it in view.
I have VC7 and I forget about VC6,the interface of VC7 has changed a lot,and
in VC7 there is nothing like calss wizard in vc6.I can ONLY add notification
of listview in view class not in frameclass,so if is possible there too only overriden it in view class.
And think about it a little....,you are talking about ListVIEW,of course its notification will be in VIEW too not in MAINFRAME.(You said your view class is CListView,don't you?)
I've got confused about what are you talking about ,maybe another person can help.
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
well, the listview is embedded in a splitter window inside the main frame. The actual view class for the app is just a generic CView derived class. But, I was trying to override in the main frame, which worked, so then removed all of the override code in the main frame and tried to move it to the view, and nothing . . .
Oh well, no big deal, just trying to figure out how the notification messages are supposed to get passed around. They don't seem to make it all the way to the view after I comment out the override in the frame.
Thanks
|
|
|
|
|
I'm new to database programming in Visual C++
and have a few questions. Is the only way to get
data from the database to use CRecordset?
How can I get data by executing SQL directly?
|
|
|
|
|
Here is very good ebook for begginer in database:
http://lnrpc2.irb.hr/ebooks/0672313502/index.htm
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
I know what a string table is and how to use it. My question is -- is it worth it? Do those strings remain on disk and LoadString() reads them from there, or are they really loaded into ram memory during program startup?
|
|
|
|
|
Strings table are embedded inside the executable image (the .EXE file), that gets loaded to virtual memory at program startup. It is the processor's responsibility to bring virtual memory pages to RAM or store them in the disk cache (the swapping file) depending on whether the pages are being referred to or not (and some other optimization policies); so the question of whether the string table is loaded into memory or not is a fuzzy subject --probably it won't get loaded if you don't use resource at all.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín:
very educative!!!
I am surprised!!!
CLAP, CLAP, CLAP!!!
Regards....
The programmer's national anthem is 'AAAAAAAARRRRGHHHHH!!'.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
You'll make me blush
Actually, there are inaccuracies in my explanation --read only sections of the executable probably won't ever do it to the swapping file (they're retrieved directly from the .EXE file itself and simply dismissed when not needed), and stuff like that.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to represent some data from a database to the user.
Is it most convenient to use a table. What kind of
table should I use. There is no table available in the
standard controls. Is MSFlexGrid from the ActiveX controls
a good choice?
|
|
|
|
|
MSFlexGrid is for DAO,and it is old technology,It is better to use ADO.
For this you can use MS Datagrid(I think it is in visual studio6 not v7) or you can find very nice datagrids in codeproject
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
You can find several samples of datagrid in CP.
Look here
Regards...
A printer consists of three main parts: the case, the jammed paper tray and the blinking red light.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I am using a FindWindow call and supplying the window class name and sure enough when an app is running with that class, I get a handle to the window returned to me. But suppose there are several instances of the app running and so I use the handle to GetWindowText to search for a specific instance. What API call is available to 'walk through' all windows with a given class name? Does such an animal exist or do I need to put something together myself? Suggestions welcomed.
Thanks.
Chris Meech
|
|
|
|
|
I don't if it can help you:"GetWindowThreadProcessId"
Also check "Window Functions" in MSDN
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Look up EnumWindows
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Thanks Nish and Mazdak for your suggestions.
I ended up doing the following and it has tested out fine.
HWND hWnd = ::GetDesktopWindow();
HWND hSessionA = NULL;
do
{
if ( hSessionA == NULL )
hSessionA = ::GetWindow(hWnd, GW_CHILD);
if ( IsWindowVisible(hSessionA) )
{
CString strWindowText;
char* pWindowText = strWindowText.GetBufferSetLength(sizeof(szSessionA));
GetWindowText(hSessionA, pWindowText, sizeof(szSessionA));
strWindowText.ReleaseBuffer();
strWindowText.MakeUpper();
if ( strWindowText.Compare(szSessionA) == 0 )
break;
}
hSessionA = GetWindow(hSessionA, GW_HWNDNEXT);
}
while ( (hSessionA) || AfxMessageBox("Please start your SESSIONA and then click OK to search for this session again or you may click Cancel in order to quit.", MB_ICONQUESTION|MB_OKCANCEL) == IDOK );
When I drop out of the while loop, hSessionA is either NULL or contains a value that is the HWND for the window I'm looking for.
Thanks again.
Chris Meech
|
|
|
|
|
Hi,
Can anyone tell me how to change the exponent from the type double? Basicly what I want to do is to extract the exponent form:
<--------------------all the bytes(8 total)------------------->
(SXXX XXXX) (XXXX MMMM) (MMMM MMMM) (MMMM MMMM) ... (MMMM MMMM)
(where x represents the exponent)
do some calculations and place it back in. I want to this with a large amount of numbers so I seek a pretty fast way to do it. Anyone got an idea? thx already.
greetings,
Filip Govaerts
Belgium
|
|
|
|