Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linker error when adding Ole to my application, what am I missing? Pin
charlieg6-Jan-23 5:07
charlieg6-Jan-23 5:07 
QuestionRe: Linker error when adding Ole to my application, what am I missing? Pin
Randor 5-Jan-23 16:41
professional Randor 5-Jan-23 16:41 
AnswerRe: Linker error when adding Ole to my application, what am I missing? Pin
charlieg6-Jan-23 10:17
charlieg6-Jan-23 10:17 
GeneralRe: Linker error when adding Ole to my application, what am I missing? Pin
Randor 6-Jan-23 10:40
professional Randor 6-Jan-23 10:40 
Questionhow to interact with access control and open the door from My c++ desktop application Pin
Zouaoui Billel31-Dec-22 4:58
Zouaoui Billel31-Dec-22 4:58 
AnswerRe: how to interact with access control and open the door from My c++ desktop application Pin
Richard MacCutchan31-Dec-22 5:11
mveRichard MacCutchan31-Dec-22 5:11 
QuestionMessage Closed Pin
27-Dec-22 9:31
Member 1496877127-Dec-22 9:31 
AnswerRe: How to link C code to which Bluetooth library ? ( Linux) Pin
k505427-Dec-22 10:30
mvek505427-Dec-22 10:30 
AnswerRe: How to link C code to which Bluetooth library ? ( Linux) Pin
Richard MacCutchan27-Dec-22 22:03
mveRichard MacCutchan27-Dec-22 22:03 
QuestionInsert a Container App Pin
Glenn Meadows 202227-Dec-22 5:07
Glenn Meadows 202227-Dec-22 5:07 
AnswerRe: Insert a Container App Pin
Richard MacCutchan27-Dec-22 22:06
mveRichard MacCutchan27-Dec-22 22:06 
SuggestionRe: Insert a Container App Pin
David Crow28-Dec-22 4:49
David Crow28-Dec-22 4:49 
QuestionHaving trouble with a function in C Pin
BuilderboiYT26-Dec-22 15:38
BuilderboiYT26-Dec-22 15:38 
AnswerRe: Having trouble with a function in C Pin
Victor Nijegorodov26-Dec-22 20:12
Victor Nijegorodov26-Dec-22 20:12 
AnswerRe: Having trouble with a function in C Pin
Richard MacCutchan26-Dec-22 22:10
mveRichard MacCutchan26-Dec-22 22:10 
AnswerRe: Having trouble with a function in C Pin
Mircea Neacsu26-Dec-22 22:34
Mircea Neacsu26-Dec-22 22:34 
GeneralRe: Having trouble with a function in C Pin
Richard MacCutchan26-Dec-22 23:39
mveRichard MacCutchan26-Dec-22 23:39 
QuestionInvalid comparator for STL map Pin
ForNow25-Dec-22 18:08
ForNow25-Dec-22 18:08 
AnswerRe: Invalid comparator for STL map Pin
Daniel Pfeffer25-Dec-22 19:36
professionalDaniel Pfeffer25-Dec-22 19:36 
GeneralRe: Invalid comparator for STL map Pin
ForNow25-Dec-22 21:33
ForNow25-Dec-22 21:33 
GeneralRe: Invalid comparator for STL map Pin
ForNow26-Dec-22 5:14
ForNow26-Dec-22 5:14 
GeneralRe: Invalid comparator for STL map Pin
Graham Breach26-Dec-22 6:15
Graham Breach26-Dec-22 6:15 
JokeRe: Invalid comparator for STL map Pin
ForNow26-Dec-22 6:51
ForNow26-Dec-22 6:51 
GeneralRe: Invalid comparator for STL map Pin
ForNow26-Dec-22 7:39
ForNow26-Dec-22 7:39 
GeneralRe: Invalid comparator for STL map solution Pin
ForNow26-Dec-22 8:31
ForNow26-Dec-22 8:31 
Since my data was 12 bytes long I was lucky there happened to be a data type 16 bytes long a "long double" I just filled the first 4 bytes with zeros and

C++
;
struct usingrange
{
	ESDID esdid;
	int start;
	int end;
	
	usingrange() { start = 0; end = 0; return; }
  bool operator<(const usingrange& x) const {
	  union
	  {
		  long double a;
		  char str1[16];
	  }c;
	  union
	  {
		  long double b;
		  char str2[16];
	  }d;
	
	  ::memset(&c.str1, 0x00, 16);
	  ::memset(&d.str2, 0x00, 16);
	  ::memcpy(&c.str1[4], &esdid, 4);
	  ::memcpy(&c.str1[8],&start,4);
	  ::memcpy(&c.str1[12], &end, 4);
	  ::memcpy(&d.str2[4], &x.esdid, 4);
	  ::memcpy(&d.str2[8], &x.start, 4);
	  ::memcpy(&d.str2[12], &x.end, 4);

	  return c.a < d.b;

	//	  return usingrange  < x;
	//	  if (start < x.start) 
     //   return start < x.start;
//		  return x.end < end;

 }
 
};

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.