|
how is your string stored ? char* ( or equivalent ), CString or std::string ?
with char* : stricmp
with CString : CString::CompareNoCase
with std::string : I don't know
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
My string is stored as char*.
It seems that stricmp can only determine the compared value of two string, isn't it?
Moreover, if I decide to change the design and use Cstring, do I need to include any header file? Is there any limitation I shoud pay attention to?
Thanks for your help.
|
|
|
|
|
This is written in C, but should work just fine in C++.
/*************************************************************************************************/
#define TO_LOWER(letter) ((letter) >= 'A' && (letter) <= 'Z' ? (letter)+'a'-'A' : (letter))
bool string_cmp(const char *StringA, const char *StringB)
{
/* If either string is NULL, they don't match */
if (StringA == NULL || StringB == NULL)
return false;
for (; *StringA || *StringB; StringA++, StringB++)
{
if (TO_LOWER(*StringA) != TO_LOWER(*StringB))
return false;
}
return true;
}
/*************************************************************************************************/
Rapture2k4
-- modified at 6:56 Saturday 25th March, 2006
|
|
|
|
|
Helen Chang wrote: Moreover, if I decide to change the design and use Cstring, do I need to include any header file? Is there any limitation I shoud pay attention to?
if you are using Visual C++.net as your compiler then include atlstr.h for using CString in your project otherwise if you are using VS6 then you have to download WTL package for Cstring Class
|
|
|
|
|
I am using MDI application.
I have one integer variable in a document.
How to get the value of the value of variable in child frame.
Could any one let me know?
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
From the MDI Frame call GetActiveFrame()
From the active frame call GetActiveDocument()
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
like RegisterHotKey a hotkey, if keydown the hotkey, system will send WM_HOTKEY to your window. not need wait the message or sign.
How to do?(or how let some windows respond the RegisterHotKey same hotkey?)
Thanks.
|
|
|
|
|
If you installed a keyboard hook, then you could have each of your windows 'subscribe' to your keyboard hook. When you saw a key come through, post the message to each of your subscribed windows. That way, a single keyboard event, normally only targeting a specific window, can appear in multiple windows.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
sorry for the request, it is too urgent for me, if anybody's got such template,could u just share with me as a example ... i would be appreciated
|
|
|
|
|
Build Catalog.
User Query Catalog.
User Select Video
if ( Video available )
- User Gets Video and give a deposit.
- Video is marked as beeing away.
- Goto "User Query Catalog"
else
- Warn the user.
- Ask if user wants to reserve the video
- Goto "User Query Catalog"
User Leaves the Store.
...
User returns the Video.
- Video marked as available
- if Video Late
keep deposit.
...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Elementary, my dear Watson.
--
Rog
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Actually my final project in that class in college went a step farther. Yes we had to do all that you did above (pretty much), but I also valued the number of rentals until replacement. Then you take your rented videos and sell them as used, but all the results are profit because you already went past your number of rentals to pay for the tape. The manager could select how much profit he had to achieve before moving the rentals to used sales (he might want to rent n number of times past breaking even point). Overhead for the store was distributed to the tape market and could be distributed linearly, or based on popularity or any percentage between the two.
It was a pretty cool project all together. Since it went well above the requirements of the final project (which was just rental sales, cashier type stuff -- even had to determine change to the customer)... well, I modified the terminal during the late night shift so I could up the baud rate on the terminal to well beyond the limited 9600 the other students had... also upped my priority for cpu time such that debugging and processing of the rental library went faster... though I did experiment with 4D data structures to store the data in, pretty fun assignment!
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
hi,i have one dialog called "main" and another "login", when the program starts, "main" starts and in the OnInitDialog() it calls another dialog called "login" and the main is hidden using ShowWindow(SW_HIDE). From the "login" dialog how can i show the "main" dialog without restarting it and hence the OnInitDialog() starting again.
or how do i pass a variable from "login" to "main" to use in an if statment in the OnInitDialog() to indicated the "login" has previously been called
hope i make some bit of sense!!
thanks
|
|
|
|
|
If you display the "login"-dialog with a call to DoModal() from the "main"-dialog's OnInitDialog(), the "main"-dialog won't be displayed until the user have dismissed the "login"-dialog.
Save the status depending on whether the login procedure was successful or not in a member of the "login"-dialog so that it can be retrieved when the execution continues in the "main"-dialog's OnInitDialog().
If the login procedure failed, simply use PostQuitMessage() to close the application or take whatever action you like.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
thanks for the reply
PostQuitMessage(0); does the job alright that i was looking for.
but for future reference i would still like to know how to pass variables between dialogs
say declare a int in "main" and pass it to "login" and "login" sends it back with a value inside it.
thanks
-- modified at 11:14 Friday 24th March, 2006
|
|
|
|
|
It depens on the type of dialog you are using. For non-modal dialogs you can send a message the same as you would send any other message, using SendMessage() specifying your own paramaters for lParam and wParam.
But with Modal dialogs, the main dialog is halted until the child dialog is closed. You are able to send a message from the child to the parent using PostMessage().
Another method is through the use of global pointers. I'm sure there are other methods, but the above 2 have always fulfilled my needs.
|
|
|
|
|
catch the return value like this :
CMainDlg::OnInitDialog() {
CDialog::OnInitDialog();
CLoginDlg dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDCANCEL) {
this->EndDialog(IDCANCEL);
}
return TRUE;
}
|
|
|
|
|
Does anyone know if it is possible for cold fusion to access a c++ dll.
I am specifically trying to use cold fusion to access a blowfish(encryption algorithm C++ dll).
1. Is it possible within the cold fusion framework
2. If so, can someone tell me or point me in the right direction?
|
|
|
|
|
Hello,
i need to get a Date object from one single data type, wich is a unsigned long, representing hundreds of seconds.
EFACEC.SE
Paulo RS Ferreira
|
|
|
|
|
see CTime[^] and CTimeSpan classes
|
|
|
|
|
Hello everybody,
A week ago or so I have posted a message with the same title. I have solved this problem. But now I ve got a new one. I do the following:
Start recording with the wave audio input device.
Using the function waveInStart()
During recording all waveheaders that are returned to the application are processed and added to the wave audio input device again.
Using the function waveInAddBuffer()
Driver messages are processed using a dedicated thread. (Using the flag CALLBACK_THREAD in the function waveInOpen)
After recording for a while the recording is stopped.
Using the function waveInStop()
Now I need to mark the last waveheader with a time stamp. Before I stop the wave audio input device I query the current sample
using the function waveInGetPosition() (All waveheaders are of the same size)
dwLastWaveHeader=(dwCurrentSample-1)/nSamplesInEachWaveHeader;
Oke this works. But in some very very rare cases the current data record is not returned to the application. (Happens when the current buffer is only filled for say 200 samples and less)
My question is how to make sure that the current buffer is returned to the application?
Thank you
|
|
|
|
|
waveInReset
The waveInReset function stops input on the given waveform-audio input device and resets the current position to zero. All pending buffers are marked as done and returned to the application.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hello Blake Miller,
Thank you for your reply!
I know that waveInReset returns all pending buffers to the application. But it returns all buffers with the dwBufferLength member marked to 0 on my system. Even the buffer that contains say 200 samples. (The buffer that was not returned using waveInStop) I am sorry but I don't think this would solve the problem. (I ve tryed it on my PC and on another PC)
Thank you
|
|
|
|
|
I'm writing a user interface with Visual C++ 6 on a computer with English as the working environment.
I have Chinese script that I can see in Excel and RTF files. It uses a SimSun font. I want the same script to appear on a button using SetTitle. I compile successfully with UNICODE defined. However, I can't figure out how to get the characters into the code. Any ideas?
ie wnd.SetTitle(_T("????"));
Mortie
|
|
|
|
|
I often have problems writing Chinese into my code using VC6, though for me each character takes up the space of 2. ie. the caret is able to position itself in the center of a character. It's annoying sometimes, especially when trying to edit the end of a line which has Chinese at the beginning.
A work around I often use is to write the function in notepad or something similar, then copy the whole thing over to MSVC.
I have just downloaded the 2005 edition, I hope this has been fixed.
|
|
|
|