Click here to Skip to main content
14,640,095 members
Home » Discussions » Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Run exe resource from memory. Pin
Richard Andrew x6426-Mar-14 5:41
professionalRichard Andrew x6426-Mar-14 5:41 
Newscursor problem Pin
neterfari26-Mar-14 1:10
Memberneterfari26-Mar-14 1:10 
GeneralRe: cursor problem Pin
Richard MacCutchan26-Mar-14 1:38
mveRichard MacCutchan26-Mar-14 1:38 
GeneralRe: cursor problem Pin
neterfari26-Mar-14 3:17
Memberneterfari26-Mar-14 3:17 
GeneralRe: cursor problem Pin
neterfari26-Mar-14 3:19
Memberneterfari26-Mar-14 3:19 
GeneralRe: cursor problem Pin
John Schroedl26-Mar-14 5:06
professionalJohn Schroedl26-Mar-14 5:06 
GeneralRe: cursor problem Pin
Richard MacCutchan26-Mar-14 5:35
mveRichard MacCutchan26-Mar-14 5:35 
GeneralRe: cursor problem Pin
neterfari26-Mar-14 10:02
Memberneterfari26-Mar-14 10:02 
Hello thank you for your help.I have 4 function.

Term.h
bool stateCursor; // Clignote du curseur
void CreateCursor(PaintEA e);

Term.cpp
void Term::CreateCursor(PaintEA e){

SolidBrush^ blackBrush = gcnew SolidBrush( Color::Black );
SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

if(CurPointCurrent!=CurPointPrevious) {

		int deltaX=CurPointCurrent.X-CurPointPrevious.X;
		int deltaY=CurPointCurrent.Y-CurPointPrevious.Y;
		float distance= sqrt(pow((float)deltaX,2)+pow((float)deltaY,2));
		float vectorX=deltaX/distance*polygoneLength;
		float vectorY=deltaY/distance*polygoneLength;
		// Creation des points de polygone 
		Point point1 = Point(CurPointCurrent.X+vectorX,CurPointCurrent.Y+vectorY);
		Point point2 = Point(CurPointCurrent.X+vectorX*-0.866-vectorY*0.5,CurPointCurrent.Y+vectorX*0.5+vectorY*-0.866);
		Point point3 = CurPointCurrent;
		Point point4 = Point(CurPointCurrent.X+vectorX*-0.866-vectorY*-0.5,CurPointCurrent.Y+vectorX*-0.5+vectorY*-0.866);

		// Dessine (clignoter noir <-> rouge)
		array<Point>^ curvePoints = {point1,point2,point3,point4};
		if(stateCursor==false) {
				e->Graphics->FillPolygon( blackBrush , curvePoints );
				stateCursor=true;
		}
		else {
				e->Graphics->FillPolygon( redBrush, curvePoints );
				stateCursor=false;
			}
}
else{
		if(stateCursor==false) {
			e->Graphics->FillEllipse( blackBrush , CurPointCurrent.X-circleRadius,CurPointCurrent.Y-circleRadius,circleRadius*2,circleRadius*2);
			stateCursor=true;
		}
		else {
			e->Graphics->FillEllipse( redBrush , CurPointCurrent.X-circleRadius,CurPointCurrent.Y-circleRadius,circleRadius*2,circleRadius*2 );
			stateCursor=false;
		}
}
}

FormD.h

private: System::Void picB_MainMap_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) {

	if(!first_time) {
		ptr_Term->CreateCursor(e);
	}
}

private: System::Void picB_SubZone_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) {

if(!first_time) {

	ptr_Term->CreateCursor(e);

}
}


Thanks
GeneralRe: cursor problem Pin
Richard MacCutchan26-Mar-14 22:48
mveRichard MacCutchan26-Mar-14 22:48 
GeneralRe: cursor problem Pin
neterfari26-Mar-14 23:08
Memberneterfari26-Mar-14 23:08 
GeneralRe: cursor problem Pin
Richard MacCutchan26-Mar-14 23:18
mveRichard MacCutchan26-Mar-14 23:18 
GeneralRe: cursor problem Pin
neterfari27-Mar-14 0:38
Memberneterfari27-Mar-14 0:38 
QuestionConvert a C# WinSCP program to C++/CLI Pin
biop.codeproject19-Mar-14 23:06
Memberbiop.codeproject19-Mar-14 23:06 
AnswerRe: Convert a C# WinSCP program to C++/CLI Pin
Richard MacCutchan19-Mar-14 23:31
mveRichard MacCutchan19-Mar-14 23:31 
GeneralRe: Convert a C# WinSCP program to C++/CLI Pin
biop.codeproject20-Mar-14 17:24
Memberbiop.codeproject20-Mar-14 17:24 
AnswerRe: Convert a C# WinSCP program to C++/CLI Pin
sunshine@work.20-Mar-14 0:03
professionalsunshine@work.20-Mar-14 0:03 
GeneralRe: Convert a C# WinSCP program to C++/CLI Pin
biop.codeproject20-Mar-14 15:43
Memberbiop.codeproject20-Mar-14 15:43 
QuestionC++ to Managed CLI Pin
sunshine@work.19-Mar-14 5:01
professionalsunshine@work.19-Mar-14 5:01 
AnswerRe: C++ to Managed CLI Pin
Richard MacCutchan19-Mar-14 7:33
mveRichard MacCutchan19-Mar-14 7:33 
GeneralRe: C++ to Managed CLI Pin
sunshine@work.19-Mar-14 23:30
professionalsunshine@work.19-Mar-14 23:30 
GeneralRe: C++ to Managed CLI Pin
sunshine@work.2-Apr-14 3:38
professionalsunshine@work.2-Apr-14 3:38 
GeneralRe: C++ to Managed CLI Pin
Richard MacCutchan2-Apr-14 5:34
mveRichard MacCutchan2-Apr-14 5:34 
GeneralRe: C++ to Managed CLI Pin
sunshine@work.2-Apr-14 21:41
professionalsunshine@work.2-Apr-14 21:41 
GeneralRe: C++ to Managed CLI Pin
Richard MacCutchan2-Apr-14 23:17
mveRichard MacCutchan2-Apr-14 23:17 
GeneralRe: C++ to Managed CLI Pin
sunshine@work.3-Apr-14 22:44
professionalsunshine@work.3-Apr-14 22:44 

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.