15,606,118 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Python questions
View Javascript questions
View C++ questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by merano (Top 34 by date)
merano
3-Aug-15 13:35pm
View
(1)Note that the background is not filled when the CMFCButton::m_bTransparent member variable is TRUE.
https://msdn.microsoft.com/de-de/library/Bb983413.aspx
(2)SetFaceColor() is ignored by modern theme engines. The wizard greates something like:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
You can comment this line out to disable custom MFC themes. This works, but the button
will not look good because of classic theme.
Possibly you can Load a Color-Bitmap to get the color you want.
Another solution would be to do an ownerdraw button - handling the OnDrawItem() or WM_DRAWITEM
message and do the painting yourself.
merano
4-Feb-15 18:11pm
View
5.
merano
4-Feb-15 17:41pm
View
There is no need to store mWindowTitle, mWidth and mHeight at all. They can be easy accessed over mHwnd.
For several Windows it would be better to store mHwnd as a vector.
merano
19-Apr-14 14:52pm
View
Have the Invaders a strategie, do they come down per random or something else ?
You can do all that in AnimateAlienBullets; just write a AlienMove() Funktion and add it below "case '@':"
You are far away from your initial question. Please close this Question, dont forget to vote.
If you have new Questions open a new Question and show your actual code. Bye.
merano
18-Apr-14 2:30am
View
1. The Levels ARE implemented, just add it to the menu yourself (its your work,easy)
2. You can add a Timer like this:
// Create a waitable timer.
HANDLE hTimer = CreateWaitableTimer(NULL, TRUE, "WaitableTimer");
LARGE_INTEGER liDueTime;
liDueTime.QuadPart=-100000000;
// Set a timer to wait for 10 seconds.
SetWaitableTimer(hTimer, &liDueTime, 0, NULL, NULL, 0))
// Wait for the timer.
WaitForSingleObject(hTimer, INFINITE);
Note that no Errorhandling is included, but should be!
3. Cant belive that my gotoxy does not work for windows, if you have
another OS you have to look for a solution for that.
By the Way - what Compiler and OS do you use ? My code is testet with VisualStudio.
merano
15-Apr-14 20:37pm
View
What is the problem to change the position of the Invaders ?
Just delete it at the current position an redraw on a neigbour position.
merano
14-Apr-14 20:20pm
View
Deleted
You should post the code with code-tags.
The Funktion game() is missing. ClearScreen() is not defined. After inserting a simple
ClearScreen() and an empty game() the screen is flickering.
Its no good idea to clear the screen without need - just draw the differences.
I would also suggest an function drawgame() to draw all the stuff.
The menu should be coded with switch case.
main should call menu. The menu should also be displayed when leaving
the game e.g. ESC-Key should work.
merano
10-Mar-14 11:53am
View
Thanks for the hint.
merano
9-Mar-14 20:11pm
View
Easy to find informations. Start here for example:
http://msdn.microsoft.com/en-us/library/5w2h2y4y.aspx
merano
7-Mar-14 18:11pm
View
You are right, something is wrong with the shift. But your comment does not catch the facts.
He tries to shift 176 Bits, converted to hex-text into a 50 char output buffer.
Both datatypes are to small for this action. See Solution 3.
value: 11 * 2 * 8 Bit = 176 Bit
formatString: 2 + 44 + 10 + 1 = 57 chars
The shift is strange and the buffer to small.
merano
7-Mar-14 17:59pm
View
You need at least 57 chars for output buffer, but before that you need
11 * 2 * 8 Bit = 176 Bit datatype for value, but i think there are only 64 Bit.
The shift is strange.
merano
15-Feb-14 18:34pm
View
ourStruct args[Chunks];
for (j = 0; j <= numOfChunks; j=j+2) {
rc = pthread_create(&thread[0], NULL, Method_Encryption, &args[j]);
rc = pthread_create(&thread[1], NULL, Method_Encryption, &args[j+1]);
The Field args has to be bigger (not equal) than numOfChunks because of [j+1]
Cant see where numOfChunks is calculated.
merano
14-Nov-13 17:15pm
View
1048575 = 0xFFFFF Means everything is supported.
if(result == 0) {
// dwFormats: Standard formats that are supported. Can be a combination of the following:
if(mywoc.dwFormats & WAVE_FORMAT_1M08)
cout << "11.025 /tkHz, mono, 8-bit" << endl;
if(mywoc.dwFormats & WAVE_FORMAT_1M16)
cout << "11.025 /tkHz, mono, 16-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_1S08)
cout << "11.025 /tkHz, stereo, 8-bit " <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_1S16)
cout << "11.025 /tkHz, stereo, 16-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_2M08)
cout << "22.05 /tkHz, mono, 8-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_2M16)
cout << "22.05 /tkHz, mono, 16-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_2S08)
cout << "22.05 /tkHz, stereo, 8-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_2S16)
cout << "22.05 /tkHz, stereo, 16-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_4M08)
cout << "44.1 /tkHz, mono, 8-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_4M16)
cout << "44.1 /tkHz, mono, 16-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_4S08)
cout << "44.1 /tkHz, stereo, 8-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_4S16)
cout << "44.1 /tkHz, stereo, 16-bit" <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_96M08)
cout << "96 /tkHz, mono, 8-bit " <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_96M16)
cout << "96 kHz, mono, 16-bit " <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_96S08)
cout << "96 kHz, stereo, 8-bit " <<endl;
if(mywoc.dwFormats & WAVE_FORMAT_96S16)
cout << "96 kHz, stereo, 16-bit " <<endl; }
merano
14-Nov-13 12:37pm
View
Did you try waveOutGetDevCaps() ?
merano
13-Nov-13 14:12pm
View
Did you check the Capabilities ?Here are some more hints:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff536383.aspx
WAVEFORMATEX is sufficient for describing formats with sample sizes of 8 or 16 bits,
but WAVEFORMATEXTENSIBLE is necessary to adequately describe formats with a sample
precision of greater than 16 bits.
merano
12-Nov-13 16:19pm
View
The waveformatextensible is working here. Where is the exact error line ?
Do you get an Error Code or Message?
merano
11-Nov-13 18:50pm
View
What is the Problem with your code ? Do you get Compiler-error ?
Can you post essential code snipet ?
merano
8-Nov-13 19:59pm
View
Perhaps you have to handle OnCtlColor() and OnEraseBkgnd()
Here is a Example for the MFC-Way
Dialog Box with gradient background and Color changing progress bar
http://www.codeproject.com/Articles/7866/Dialog-Box-with-gradient-background-and-Color-chan
merano
16-Sep-13 4:57am
View
no problem:
http://msdn.microsoft.com/en-us/library/vstudio/bb983827.aspx
merano
29-Jun-13 18:09pm
View
Solution 1 is based on CLI code - you need .NET
Nothing of this is usable for C++ and pure Win32 API.
merano
22-Apr-13 11:41am
View
Google says: You don't need to call x264_nal_encode because x264_encoder_encode return already encoded nals.
merano
17-Feb-13 16:34pm
View
This Solution does only support a-s-d-w keys no arrow keys, why ?
Here a solution for that:
case SDL_KEYDOWN:
keypressed = event.key.keysym.sym;
// ##########################
// support arrow keys
switch(event.key.keysym.sym){
case SDLK_LEFT:
keypressed = LEFTKEY; // alternate SDLK_a
break;
case SDLK_RIGHT:
keypressed = RIGHTKEY; // alternate SDLK_d
break;
case SDLK_UP:
keypressed = UPKEY; // alternate SDLK_w
break;
case SDLK_DOWN:
keypressed = DOWNKEY; // alternate SDLK_s
break;
default:
break;
}
// ##########################
merano
16-Feb-13 20:56pm
View
What do you mean with "Static DLL" ?
Did you link MFC static ?
You should not link MFC static for a DLL. You are never shure what Version
the Main-application is running with.
merano
5-Feb-13 18:17pm
View
This member does only use the parameter max what about x and y ?
Not able to figure out why you think you need two for loops.
when you calculate the fillpos you can fill with 1 pixel wide sprite
with one for loop
fillpos = (fill * 128)/(max -min);
for(int i=0; i<fillpos; i++) ...
merano
2-Feb-13 16:34pm
View
Managed C++ says that it should be CLR
The first Ref is Win32 or MFC. Code is not UNICODE - see also comments.
merano
2-Feb-13 5:10am
View
Works perfect if only replace lea for adresses, not for e.g. ARRAYSIZE
<asm>
GET_ARRAY:
__asm {
// Get values in arr from the user
// Run Merge Sort on the array
lea EAX, arr //instead of mov EAX, arr
lea EBX, temp_arr //instead of mov EBX, temp_arr
mov ECX, ARRAYSIZE //ARRAYSIZE (no lea!)
call Merge_Sort
jmp finish
}
<asm>
You get 5 from me!
merano
31-Jan-13 19:40pm
View
Read MSDN plase: Typical buttons are the check box, radio button, and pushbutton. A CButton object can become any of these ...
http://msdn.microsoft.com/de-de/library/yf1wax6c
Your Solutions are based on Ownerdrawn Buttons, not compatible with modern GUI.
The "Enhanced Colored Button" from codeguru does work, but its quite old (from 2004)
and does probably not comply with newer requirements.
Another Problem is, that your Solution needs additional header and cpp files not
from Microsoft. I suggest using MFC-Classes supported by Microsoft to solve.
merano
31-Jan-13 16:52pm
View
Only owner-drawn CButtons respond to the parent window processing the WM_CTLCOLORBTN message.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb761849
In this case you have to draw the Button yourself.
See Solution 4 for easier way.
merano
31-Jan-13 16:00pm
View
Only owner-drawn CButtons respond to the parent window processing the WM_CTLCOLORBTN message.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb761849
In this case you have to draw the Button.
See Solution 3 for better way.
merano
25-Jan-13 2:13am
View
virtual const std::string& what(){return std::exception::what() + "--" + s4;}
Does not compile at all. Compiler says "Two Pointer can not be added"
merano
25-Jan-13 2:06am
View
Codefragment does not compile because no "_mainCRTStartup"
Where is the error ?
merano
24-Jan-13 18:50pm
View
Is there a reason why you dont use the MSDN declarations ?
http://msdn.microsoft.com/en-us/library/windows/desktop/dd318229(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183374(v=vs.85).aspx
merano
21-Jan-13 18:22pm
View
Search for Microsoft Redistributable
merano
21-Mar-12 15:23pm
View
The C++ Language does not include Graphics. If you want to code this Functions you have to use System-Calls or a Library that covers this.
When you do not want to use " third party libs" you have to use System-Calls or Librarys that come with the Development Environment. If you use Windows with Visual-Studio you could use GDI for Example, for Unix you have to go other ways.
Show More