Click here to Skip to main content
15,888,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCListView Custom Drawing: drop target icon Pin
bitpusher23-Jan-04 7:49
bitpusher23-Jan-04 7:49 
GeneralProblem Vith ADO-FoxPro Pin
Srdjan Mladenovic23-Jan-04 7:40
Srdjan Mladenovic23-Jan-04 7:40 
Generalnewbie having error LNK2005 problem Pin
skletty23-Jan-04 7:23
skletty23-Jan-04 7:23 
GeneralRe: newbie having error LNK2005 problem Pin
David Crow23-Jan-04 9:49
David Crow23-Jan-04 9:49 
GeneralRe: newbie having error LNK2005 problem Pin
skletty23-Jan-04 10:06
skletty23-Jan-04 10:06 
GeneralRe: newbie having error LNK2005 problem Pin
David Crow23-Jan-04 10:17
David Crow23-Jan-04 10:17 
GeneralRe: newbie having error LNK2005 problem Pin
skletty23-Jan-04 10:20
skletty23-Jan-04 10:20 
GeneralRe: newbie having error LNK2005 problem Pin
Jörgen Sigvardsson24-Jan-04 6:12
Jörgen Sigvardsson24-Jan-04 6:12 
A better solution to the macro XYSWAP would be a templated function such as this:
<template typename T>
void XYSWAP(T& left, T& right) { 
    T tmp(left);
    left = right;
    right = tmp;
}
There you have a function which
1) is type safe: you can't swap an int with a float
2) is type polymorphic (you can use it to swap other types than int
3) is reusable, thanks to 2)
4) does not rely on global variables

The template function simply replaces the macro in the header file.

--
C'est normal!
GeneralRe: newbie having error LNK2005 problem Pin
Michael Dunn23-Jan-04 12:46
sitebuilderMichael Dunn23-Jan-04 12:46 
GeneralDialog from CHTMLView Pin
Frank Deo23-Jan-04 6:50
Frank Deo23-Jan-04 6:50 
GeneralServer 2003 DDK, ZMODEM Pin
Shahin7723-Jan-04 6:41
Shahin7723-Jan-04 6:41 
GeneralRe: Server 2003 DDK, ZMODEM Pin
Alexander M.,24-Jan-04 7:49
Alexander M.,24-Jan-04 7:49 
GeneralRe: Server 2003 DDK, ZMODEM Pin
Shahin7724-Jan-04 8:30
Shahin7724-Jan-04 8:30 
GeneralMFC main thread return codes Pin
Dominik Reichl23-Jan-04 6:23
Dominik Reichl23-Jan-04 6:23 
GeneralRe: MFC main thread return codes Pin
Michael Dunn23-Jan-04 6:27
sitebuilderMichael Dunn23-Jan-04 6:27 
GeneralRe: MFC main thread return codes Pin
J. Eric Vaughan23-Jan-04 8:54
J. Eric Vaughan23-Jan-04 8:54 
GeneralRe: MFC main thread return codes Pin
Antti Keskinen23-Jan-04 22:49
Antti Keskinen23-Jan-04 22:49 
GeneralSQL and Windows Database Programming Pin
valikac23-Jan-04 6:11
valikac23-Jan-04 6:11 
GeneralRe: SQL and Windows Database Programming Pin
Michael P Butler23-Jan-04 7:05
Michael P Butler23-Jan-04 7:05 
GeneralRe: SQL and Windows Database Programming Pin
l a u r e n23-Jan-04 14:36
l a u r e n23-Jan-04 14:36 
Generalvoice masking ...plz help Pin
30jenny23-Jan-04 4:01
30jenny23-Jan-04 4:01 
GeneralRe: voice masking ...plz help Pin
Xander8023-Jan-04 4:10
Xander8023-Jan-04 4:10 
GeneralUsing a RecordView in Dialog Pin
Calder23-Jan-04 4:01
Calder23-Jan-04 4:01 
GeneralRe: Using a RecordView in Dialog Pin
David Crow23-Jan-04 7:22
David Crow23-Jan-04 7:22 
GeneralRe: Using a RecordView in Dialog Pin
Calder23-Jan-04 7:38
Calder23-Jan-04 7:38 

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.