Click here to Skip to main content
15,916,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionUsing #define with a dll Pin
Waldermort18-Aug-06 11:32
Waldermort18-Aug-06 11:32 
AnswerRe: Using #define with a dll Pin
Chris Losinger18-Aug-06 11:37
professionalChris Losinger18-Aug-06 11:37 
AnswerRe: Using #define with a dll Pin
cmk19-Aug-06 13:11
cmk19-Aug-06 13:11 
Questionfindresource xpsp2res.dll Pin
fx920018-Aug-06 7:09
fx920018-Aug-06 7:09 
Questionerror LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup [modified] Pin
sea200618-Aug-06 7:01
sea200618-Aug-06 7:01 
AnswerRe: error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup Pin
David Crow18-Aug-06 7:09
David Crow18-Aug-06 7:09 
AnswerRe: error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup Pin
Rule 7.6225-Dec-06 7:21
Rule 7.6225-Dec-06 7:21 
Questionreading and sending errors to serial port [modified] Pin
cahit2318-Aug-06 5:58
cahit2318-Aug-06 5:58 
Hello,

I am trying to send serial port a double value as 8 sets of uint8 by means of union and receiving in the same manner.

For that, im calling read and write functions from an external '.cpp'file through class-object implementation as you see in my code.I use that implementation seperately in transmit and receive functions.


int transmit (double x)
{ union ifas
{
double d;
unsigned char u8value[8]; //uint8
};

union ifas member;

CSyncSerialComm *ObjectCSyncSerialComm; //Object in class from ext.file
ObjectCSyncSerialComm = new CSyncSerialComm("0x3F8");

member.d = x;
printf("\nmember.d=%f\n",member.d);

ObjectCSyncSerialComm.WriteFile(m_hSerialComm, member.u8value, 8, &dwNumberOfBytesWritten, NULL);

delete ObjectCSyncSerialComm ;

return (int) member.u8value;
}

double receive(unsigned char)
{
union aachen
{ double c;
unsigned char u8value[8];
};

union aachen team;

CSyncSerialComm *ObjectCSyncSerialComm;
ObjectCSyncSerialComm = new CSyncSerialComm("0x3F8");

ObjectCSyncSerialComm.ReadFile(m_hSerialComm, &szBuf, 10, &dwIncommingReadSize, NULL);

delete ObjectCSyncSerialComm ;

return (double)team.c ;

}

int main(int argc, char* argv[])

{
double var;
unsigned char z;
scanf("%lf",&var);
transmit(var);
receive(z);
return 0;
}

What i want to ask you is, in writing and reading commands i'm receiving syntax errors. If I type both in reading and writing (bold lines),

ObjectCSyncSerialComm.ReadFile(m_hSerialComm, &szBuf, 10, &dwIncommingReadSize, NULL);

Error==> On the left side of the structure . or .* is required

If I type as follows,

ObjectCSyncSerialComm.*ReadFile(m_hSerialComm, &szBuf, 10, &dwIncommingReadSize, NULL);

Error==> Invalid pointer used.

By the way, im using C++ Builder 6.0 Compiler.

What could be the problem? Any other problem can cause this? I could not find any solution.

Any comment and/or suggestion will be appreciated.Thank you.

Regards,
Cahit








-- modified at 12:01 Friday 18th August, 2006
AnswerRe: reading and sending errors to serial port Pin
cje22-Aug-06 10:43
cje22-Aug-06 10:43 
QuestionPrint Preview Orientation & many pages problems [modified] Pin
mikobi18-Aug-06 5:42
mikobi18-Aug-06 5:42 
Questionchar* to OLECHAR* ? Pin
great_tommy18-Aug-06 5:41
great_tommy18-Aug-06 5:41 
AnswerRe: char* to OLECHAR* ? Pin
David Crow18-Aug-06 6:22
David Crow18-Aug-06 6:22 
GeneralRe: char* to OLECHAR* ? Pin
great_tommy18-Aug-06 6:53
great_tommy18-Aug-06 6:53 
GeneralRe: char* to OLECHAR* ? Pin
David Crow18-Aug-06 7:08
David Crow18-Aug-06 7:08 
GeneralRe: char* to OLECHAR* ? Pin
great_tommy18-Aug-06 7:14
great_tommy18-Aug-06 7:14 
GeneralRe: char* to OLECHAR* ? Pin
flippydeflippydebop21-Aug-06 11:48
flippydeflippydebop21-Aug-06 11:48 
AnswerRe: char* to OLECHAR* ? Pin
tanvon malik18-Aug-06 7:12
tanvon malik18-Aug-06 7:12 
QuestionDoubt about ioctlsocket Pin
afpr18-Aug-06 5:24
afpr18-Aug-06 5:24 
QuestionClasses and dlls Pin
Waldermort18-Aug-06 5:02
Waldermort18-Aug-06 5:02 
AnswerRe: Classes and dlls Pin
Zac Howland18-Aug-06 5:17
Zac Howland18-Aug-06 5:17 
GeneralRe: Classes and dlls Pin
Waldermort18-Aug-06 5:50
Waldermort18-Aug-06 5:50 
GeneralRe: Classes and dlls Pin
Wes Aday18-Aug-06 6:10
professionalWes Aday18-Aug-06 6:10 
GeneralRe: Classes and dlls Pin
Zac Howland18-Aug-06 6:12
Zac Howland18-Aug-06 6:12 
GeneralRe: Classes and dlls Pin
Waldermort18-Aug-06 7:02
Waldermort18-Aug-06 7:02 
AnswerRe: Classes and dlls Pin
David Crow18-Aug-06 6:24
David Crow18-Aug-06 6:24 

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.