Click here to Skip to main content
15,906,094 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SendMessageTimeOut( ) fails in Vista Pin
SandipG 9-Sep-08 20:38
SandipG 9-Sep-08 20:38 
GeneralRe: SendMessageTimeOut( ) fails in Vista Pin
V K 29-Sep-08 20:59
V K 29-Sep-08 20:59 
GeneralRe: SendMessageTimeOut( ) fails in Vista [modified] Pin
SandipG 9-Sep-08 21:04
SandipG 9-Sep-08 21:04 
GeneralRe: SendMessageTimeOut( ) fails in Vista Pin
V K 29-Sep-08 21:45
V K 29-Sep-08 21:45 
QuestionRe: SendMessageTimeOut( ) fails in Vista Pin
Mark Salsbery10-Sep-08 5:15
Mark Salsbery10-Sep-08 5:15 
QuestionEdit box problem......... Pin
ani_ikram9-Sep-08 17:32
ani_ikram9-Sep-08 17:32 
AnswerRe: Edit box problem......... Pin
Naveen9-Sep-08 17:48
Naveen9-Sep-08 17:48 
QuestionArrays and Enums in an extended control Pin
poppabaggins9-Sep-08 16:31
poppabaggins9-Sep-08 16:31 
Hi, I'm completely new to C++ as a whole, so there might be a simple answer to my question, so here goes.

I'm trying to write a program that will have the screen broken up into zones, or areas, each with a Point (location) a Size, an Image, and an array of terrain types (an enum). Trying to include a bitmap in my class made the compiler tell me that I couldn't mix managed and unmanaged types. To try to work around this, I tried extending the PictureBox control, but this has given me even more headaches.

Basically, I can't figure out how to declare/use an array in an extended control.
#pragma once

using namespace System::Drawing;
using namespace System::Windows::Forms;
using namespace cli;  //something I think MSDN said I had to do

namespace MapEdit
{
	//better than a "magic number".  there can only be 3 different types of terrain per square
	//used in the TerrainTypes array
	const int MAX_TERRAIN = 3;

	public ref class Zone : public System::Windows::Forms::PictureBox
	{
		
	public:
		enum Terrain //says I can't mix types
		{
			Plain,
			Hill,
			Wood,
			Marsh,
			Stream,
			River,
			ShoreLine,
			Impassable
		};
		
		array<byte^> ^TerrainTypes; //this doesn't work
		int TerrainTypes[3]; //neither does this.
...


All of my errors (except the parts where I try to use these faulty enum/ array) come from this block. Frankly, I'm at a loss as to how to fix this.

Also, if someone could tell me how to include a Bitmap in an unmanged class, that would be nice too.

Thanks,
Christian
AnswerRe: Arrays and Enums in an extended control Pin
Naveen9-Sep-08 16:44
Naveen9-Sep-08 16:44 
GeneralRe: Arrays and Enums in an extended control Pin
poppabaggins10-Sep-08 4:05
poppabaggins10-Sep-08 4:05 
Questionhow draw semi transparent object Pin
nattyting9-Sep-08 15:54
nattyting9-Sep-08 15:54 
AnswerRe: how draw semi transparent object Pin
SandipG 9-Sep-08 20:35
SandipG 9-Sep-08 20:35 
GeneralRe: how draw semi transparent object Pin
nattyting9-Sep-08 21:08
nattyting9-Sep-08 21:08 
GeneralRe: how draw semi transparent object Pin
SandipG 9-Sep-08 21:18
SandipG 9-Sep-08 21:18 
GeneralRe: how draw semi transparent object Pin
nattyting9-Sep-08 21:35
nattyting9-Sep-08 21:35 
GeneralRe: how draw semi transparent object Pin
nattyting10-Sep-08 20:47
nattyting10-Sep-08 20:47 
GeneralRe: how draw semi transparent object Pin
SandipG 10-Sep-08 23:05
SandipG 10-Sep-08 23:05 
Questionhow to remove border of web browser object Pin
only_jack9-Sep-08 10:34
only_jack9-Sep-08 10:34 
AnswerRe: how to remove border of web browser object Pin
Naveen9-Sep-08 14:04
Naveen9-Sep-08 14:04 
GeneralRe: how to remove border of web browser object Pin
only_jack10-Sep-08 6:08
only_jack10-Sep-08 6:08 
QuestionWM_SETTEXT and Virtual Address Space [modified] Pin
sawerr9-Sep-08 10:26
sawerr9-Sep-08 10:26 
AnswerRe: WM_SETTEXT and Virtual Address Space Pin
Mark Salsbery9-Sep-08 12:13
Mark Salsbery9-Sep-08 12:13 
GeneralRe: WM_SETTEXT and Virtual Address Space Pin
sawerr9-Sep-08 12:27
sawerr9-Sep-08 12:27 
GeneralRe: WM_SETTEXT and Virtual Address Space Pin
Mark Salsbery9-Sep-08 12:48
Mark Salsbery9-Sep-08 12:48 
GeneralRe: WM_SETTEXT and Virtual Address Space Pin
sawerr9-Sep-08 13:00
sawerr9-Sep-08 13:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.