I beleve not many of you had this kind of problem but if anyone knows what shoud I do it would be great. I am writing an application in Serbian language and that includes writing some non-English letters such as: Š, Đ, Ž, Ć and Č. Everything works fine but with the last two. They look fine inside the code but when I compile it they turn into C. I've tryed with different regional options and different encoding but nothing helped. I'm out of ideas and my deadline is coming closer and closer every day, so if anyone knows how to solve this one please help.
In the code I've got this: label = group + '/';
These variables are of type std::string.
At this point group contains "Vehicle". When label contains "name" or "mass" the label is correctly reseted to "Vehicle/". But when it comes to "MountPoints" it just sets it to ??? (According to the watch in VS). If I in the text-file cut down that row to just "MountPo", it works. Why??? Anyone knows?
I wrote a screensaver that mutes the volume using a call to mixerOpen followed by all the other relevant calls to get the ID of the MIXERCONTROL_CONTROLTYPE_MUTE. It works fine on my Windows98 machine, muting the sound perfectly. However it never works on WindowsXP, I believe that the mixerOpen function keeps failing. Does anyone have any ideas of how to mute the sound on XP. Unfortunately I don't have an XP machine that I can develop on.
I am a beginner at Visual C++. I created an editbox with an dword variable. I would like to enter hexadecimal values in the format for example 004FD210 and i want the corresponding variable for the editbox or (maybe with a small code others) to have corresponding decimal value. I thought to read into a string andthen to convert it to integer value. But is there a shorter way. Pls.
converting string to interger: value strtol(), strtoul().
converting interger value to hex string: sprintf(pStr,"%X",nValue).
If you want to convert to hex string with leading 0's:
sprintf(pStr,"%8.8,X",nValue); // 00000000
sprintf(pStr,"%*.*,X",8,8,nValue); // 00000000
I believe those should work for ASCII formated string.
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
I am writing a program that continuously stores data from an external memory.
// Do stuff over here
}// end while
However, when it runs, it takes all the memory (program is not responded).
I have another button (Stop) to call method to set isConnected to False in order to get out of the loop. However, I didn't even have a chance to hit that button because the program is freezed.
Use a worker thread. If you don;t thread the application, then the reason you're locking the program up is because the Message Loop never has the chance to run, and therefore the button press is never noticed. Use a thread for the user interface, and one to do the loop.
I'm writing to ask some explanations on the excellent article "Using Custom Controls in a Dialog Bar" by Douglas R. Keesler, see http://www.codeproject.com/useritems/DerivedDlgBar.asp. Maybe that I did not understand everything, I'm french and my english is not so good.
So my matter is about how to create a menu in a CDialogBar :
I have made a little MDI which has got a CDialogBar with VC++6.0 .
In this class, I want to put a Menu.
So I made that you said :
- create a CDialogBar : IDD_DLGBAR_TEST,
- create a Menu in my ressource : IDD_DLGBAR_TEST,
- create the class MyDlgBar (import files MyDlgBar, remove file.clw and clic on ctrl+w to wizard VC6.0 as he said)
- select to this ressource the classe MyDlgBar
- put in the class CMainFrame the instance : CMyDlgBar m_dlgBarTest
- put the creation of this box in the create function of the CMainFrame with :
since "undo" is a vast and sometimes complex domain, I suggest that you examine the following :
Undoing an operatation depends on the way the operation was done initially.
for example, you do a "create something" operation/command, the undo operation/command might simply be a cut or a remove, or worse, an "uncreate something"; do after that, if you go furher, what is the undo of the undo ( redo ); is it do a "create something" again ? or a paste or something ?
in my opinion, a good undo/redo system depends on the way you handle the different commands ( or actions) in your application.
for example, in a DB, you create a new record, the command that creates the record should contain as much context as possible so that you can recreate the record without any user action.
if you look from the other side.
you remove a record and do an undo, what is the result command ? is it a "create record" or something like a "paste" ?
Im having this wierd problem regarding outputing a file in the same path as the .exe, whenever i save the settings for my app it always save it to the desktop i have no idea why...its suppose to save it in the same path as the exe.. this is the first time ive had this kind of problem, this is almost the same code i always use and yet its not working the way it should be i dont know why..
If you only specify the file name, not the entire path as you are doing, then the file will be opened in the current working directory which is not necessarily the same as app's installed directory. To ensure the file is saved in the directory you want it in always specify the full path.
You can use GetModuleFileName() to get the path to the exe.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Yeah i can use that function, but there must be an explanation why this is happening, and my current working directory isnt my desktop so it wont be that.. there must be some thing else i did wrong just dont know wht it is...
I have no idea
Last Visit: 31-Dec-99 19:00 Last Update: 5-Mar-21 17:04