Click here to Skip to main content
15,890,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHELP!!!!!!!!!!!!!!!! Pin
27-Jun-01 11:03
suss27-Jun-01 11:03 
GeneralRe: HELP!!!!!!!!!!!!!!!! Pin
Tomasz Sowinski27-Jun-01 11:10
Tomasz Sowinski27-Jun-01 11:10 
GeneralRe: HELP!!!!!!!!!!!!!!!! Pin
Joan M27-Jun-01 23:29
professionalJoan M27-Jun-01 23:29 
GeneralCStatic WS_VISIBLE how to repaint ? (newbies) Pin
27-Jun-01 11:01
suss27-Jun-01 11:01 
GeneralRe: CStatic WS_VISIBLE how to repaint ? (newbies) Pin
27-Jun-01 16:07
suss27-Jun-01 16:07 
GeneralRe: CStatic WS_VISIBLE how to repaint ? (newbies) Pin
27-Jun-01 17:38
suss27-Jun-01 17:38 
GeneralRe: CStatic WS_VISIBLE how to repaint ? (newbies) Pin
28-Jun-01 9:32
suss28-Jun-01 9:32 
GeneralUsing a template to copy data Pin
27-Jun-01 10:49
suss27-Jun-01 10:49 
After looking in several places for example code and not finding any, this is the result: (please ignore any extraneous quotation marks)

#pragma pack(1)
typedef struct {
int A;
int B;
} myType1;

typedef struct {
char A;
char B;
} myType2;
#pragma pack()

template "<"typename T">"
void copydata(T* dst, char* src)
{
char* ptr = (char*)dst;
for (int i=0; i < sizeof(T); i++) {
*ptr = *src;
ptr++;
src++;
}
}

I know it isn't very type-safe. Does anyone have suggestions for improving this? Thanx

>>>-----> MikeO
GeneralRe: Using a template to copy data Pin
Tomasz Sowinski27-Jun-01 10:55
Tomasz Sowinski27-Jun-01 10:55 
GeneralRe: Using a template to copy data Pin
27-Jun-01 11:10
suss27-Jun-01 11:10 
GeneralRe: Using a template to copy data Pin
Tomasz Sowinski27-Jun-01 11:16
Tomasz Sowinski27-Jun-01 11:16 
GeneralRe: Using a template to copy data Pin
27-Jun-01 11:25
suss27-Jun-01 11:25 
QuestionHow does CListCtrl manage its scrollbars? Pin
Michael Carruth27-Jun-01 10:43
Michael Carruth27-Jun-01 10:43 
AnswerRe: How does CListCtrl manage its scrollbars? Pin
27-Jun-01 17:23
suss27-Jun-01 17:23 
QuestionHow to enable/disable a menu item in the system tray Pin
Anubha Khurana27-Jun-01 10:14
Anubha Khurana27-Jun-01 10:14 
AnswerRe: How to enable/disable a menu item in the system tray Pin
Bret Faller27-Jun-01 12:36
Bret Faller27-Jun-01 12:36 
GeneralRe: How to enable/disable a menu item in the system tray Pin
Anubha Khurana27-Jun-01 14:08
Anubha Khurana27-Jun-01 14:08 
QuestionHow to upload a file to a php file that normally handle a html form ?? Pin
27-Jun-01 9:11
suss27-Jun-01 9:11 
AnswerRe: How to upload a file to a php file that normally handle a html form ?? Pin
Tomasz Sowinski27-Jun-01 9:40
Tomasz Sowinski27-Jun-01 9:40 
GeneralMy registry won't register Pin
Joe Moldovan27-Jun-01 9:03
Joe Moldovan27-Jun-01 9:03 
GeneralRe: My registry won't register Pin
Tomasz Sowinski27-Jun-01 9:34
Tomasz Sowinski27-Jun-01 9:34 
GeneralRe: My registry won't register Pin
Joe Moldovan27-Jun-01 12:49
Joe Moldovan27-Jun-01 12:49 
GeneralNew User C++ help Pin
Rob Frymire27-Jun-01 8:58
Rob Frymire27-Jun-01 8:58 
GeneralRe: New User C++ help Pin
Tomasz Sowinski27-Jun-01 9:45
Tomasz Sowinski27-Jun-01 9:45 
GeneralDynamically allocate an array of an array Pin
Zach27-Jun-01 7:16
Zach27-Jun-01 7:16 

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.