Click here to Skip to main content
15,886,578 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: Application crashes on calling OnPaint() function!? Pin
David Crow8-Mar-16 3:40
David Crow8-Mar-16 3:40 
GeneralRe: Application crashes on calling OnPaint() function!? Pin
Kiran Satish8-Mar-16 4:31
Kiran Satish8-Mar-16 4:31 
Questionhow execute query in access database with CRecordset file? Pin
Le@rner4-Mar-16 18:05
Le@rner4-Mar-16 18:05 
AnswerRe: how execute query in access database with CRecordset file? Pin
Victor Nijegorodov5-Mar-16 4:51
Victor Nijegorodov5-Mar-16 4:51 
QuestionRe: how execute query in access database with CRecordset file? Pin
David Crow5-Mar-16 16:55
David Crow5-Mar-16 16:55 
QuestionAT command serially via C code Pin
Member 123621671-Mar-16 6:57
Member 123621671-Mar-16 6:57 
AnswerRe: AT command serially via C code Pin
Jochen Arndt1-Mar-16 7:48
professionalJochen Arndt1-Mar-16 7:48 
QuestionPassing macro parameters via function Pin
Vaclav_1-Mar-16 4:48
Vaclav_1-Mar-16 4:48 
<pre lang="


I am stumped again.
I have this macro which expect the parameter registerSAM to be a symbol , for example PIO_ODSR.
I like to pass such symbol to a function and just have no idea how to convert char* to such symbol.

The compiler is not much of a help, just flags an error.

This is how the macro is used now

P_CB[iIndex] = portREGISTER(digitalPinToPort(*TFT_LCD_ControlPins), PIO_OWER);
B_CB[iIndex] = digitalPinToBitMask(*TFT_LCD_ControlPins);

Like to replace the second paramater "registerSAM" symbol with a variable.


Here is a part of the compiler output with me using incorrect way to place the char* as a paramater:

sketch\A.h: In member function 'int TFT_LCD::TFT_LCD_AccessRegister(byte, char*, boolean, boolean, char*)':
sketch\A.h:31683:75: error: expected unqualified-id before '&' token
P_CB[iIndex] = portREGISTER(digitalPinToPort(*TFT_LCD_ControlPins),&(cRegisterType)); // PIO_ODSR); // STATUS register PIO_ODSR
^
sketch\AAA_SAMRegisters.h:21:49: note: in definition of macro 'portREGISTER'
#define portREGISTER(port,registerSAM) (&(port->registerSAM))



Any help would be appreciated.


"></pre>
AnswerRe: Passing macro parameters via function Pin
Richard Andrew x641-Mar-16 5:58
professionalRichard Andrew x641-Mar-16 5:58 
GeneralRe: Passing macro parameters via function Pin
Vaclav_1-Mar-16 6:08
Vaclav_1-Mar-16 6:08 
AnswerRe: Passing macro parameters via function Pin
Richard MacCutchan1-Mar-16 10:52
mveRichard MacCutchan1-Mar-16 10:52 
GeneralRe: Passing macro parameters via function Pin
Vaclav_2-Mar-16 4:09
Vaclav_2-Mar-16 4:09 
GeneralRe: Passing macro parameters via function Pin
Richard MacCutchan2-Mar-16 5:06
mveRichard MacCutchan2-Mar-16 5:06 
GeneralRe: Passing macro parameters via function Pin
Vaclav_3-Mar-16 4:34
Vaclav_3-Mar-16 4:34 
GeneralRe: Passing macro parameters via function Pin
Richard MacCutchan3-Mar-16 5:29
mveRichard MacCutchan3-Mar-16 5:29 
QuestionImage size and location change at time of printing Pin
Le@rner1-Mar-16 1:12
Le@rner1-Mar-16 1:12 
AnswerRe: Image size and location change at time of printing Pin
Richard MacCutchan1-Mar-16 1:49
mveRichard MacCutchan1-Mar-16 1:49 
GeneralRe: Image size and location change at time of printing Pin
Le@rner1-Mar-16 17:32
Le@rner1-Mar-16 17:32 
GeneralRe: Image size and location change at time of printing Pin
Le@rner22-Mar-16 19:09
Le@rner22-Mar-16 19:09 
GeneralRe: Image size and location change at time of printing Pin
Richard MacCutchan22-Mar-16 23:01
mveRichard MacCutchan22-Mar-16 23:01 
QuestionAssert failure when I comment SetRegistryKey(_T("Local AppWizard-Generated Applications")) Pin
shanmugarajaa27-Feb-16 6:23
shanmugarajaa27-Feb-16 6:23 
AnswerRe: Assert failure when I comment SetRegistryKey(_T("Local AppWizard-Generated Applications")) Pin
Richard MacCutchan27-Feb-16 21:08
mveRichard MacCutchan27-Feb-16 21:08 
JokeRe: Assert failure when I comment SetRegistryKey(_T("Local AppWizard-Generated Applications")) Pin
David Crow28-Feb-16 16:19
David Crow28-Feb-16 16:19 
GeneralRe: Assert failure when I comment SetRegistryKey(_T("Local AppWizard-Generated Applications")) Pin
Richard MacCutchan28-Feb-16 21:25
mveRichard MacCutchan28-Feb-16 21:25 
QuestionRe: Assert failure when I comment SetRegistryKey(_T("Local AppWizard-Generated Applications")) Pin
David Crow28-Feb-16 16:20
David Crow28-Feb-16 16:20 

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.