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

C / C++ / MFC

 
AnswerRe: conversion error Pin
Jochen Arndt14-Jan-18 21:19
professionalJochen Arndt14-Jan-18 21:19 
AnswerRe: conversion error Pin
Richard MacCutchan14-Jan-18 21:36
mveRichard MacCutchan14-Jan-18 21:36 
QuestionI couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 7:37
Emrah Duatepe14-Jan-18 7:37 
AnswerRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt14-Jan-18 21:37
professionalJochen Arndt14-Jan-18 21:37 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 21:44
Emrah Duatepe14-Jan-18 21:44 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt14-Jan-18 22:18
professionalJochen Arndt14-Jan-18 22:18 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 23:37
Emrah Duatepe14-Jan-18 23:37 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:20
professionalJochen Arndt15-Jan-18 0:20 
Don't add the macro to a Qt class function.

You have two choices:

  1. Use the existing header and source files from the examples and add them to your project. Then call the function using the name and include the header file in the source files where you call it.
  2. Convert the examples by implementing all the code in Qt classes (source and header).

I would go for the first option. Than there is no need to implement a similar function as Qt class member. You might do so, but then the Qt function must not use the macro:
C++
// MainWindow.h
 class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    // No calling convention here because this is a Qt based C++ class member
    void CliCompletion(void *usrPtr, int opCode, int opResult);
    // ...
};

//MainWindow.cpp
#include "snap7.h"
#include "MainWindow.h"
// Other includes

void MainWindow::CliCompletion(void *usrPtr, int opCode, int opResult)
{
    // Call the global implementation from other source file or library
    ::CliCompletion(usrPtr, opCode, opResult);
}

GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe15-Jan-18 0:30
Emrah Duatepe15-Jan-18 0:30 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:48
professionalJochen Arndt15-Jan-18 0:48 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe15-Jan-18 0:39
Emrah Duatepe15-Jan-18 0:39 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:54
professionalJochen Arndt15-Jan-18 0:54 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe15-Jan-18 1:10
Emrah Duatepe15-Jan-18 1:10 
AnswerRe: I couldn't think a good title for this.Simple question Pin
Richard MacCutchan14-Jan-18 21:39
mveRichard MacCutchan14-Jan-18 21:39 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 21:45
Emrah Duatepe14-Jan-18 21:45 
Questionfinding longest word Pin
Anonygeeker10-Jan-18 22:05
Anonygeeker10-Jan-18 22:05 
AnswerRe: finding longest word Pin
Richard MacCutchan10-Jan-18 22:25
mveRichard MacCutchan10-Jan-18 22:25 
GeneralRe: finding longest word Pin
Anonygeeker10-Jan-18 22:40
Anonygeeker10-Jan-18 22:40 
GeneralRe: finding longest word Pin
Richard MacCutchan10-Jan-18 22:46
mveRichard MacCutchan10-Jan-18 22:46 
GeneralRe: finding longest word Pin
Anonygeeker10-Jan-18 23:00
Anonygeeker10-Jan-18 23:00 
AnswerRe: finding longest word Pin
Jochen Arndt10-Jan-18 22:45
professionalJochen Arndt10-Jan-18 22:45 
AnswerRe: finding longest word Pin
CPallini10-Jan-18 23:31
mveCPallini10-Jan-18 23:31 
QuestionCString to CByteArray Pin
_Flaviu9-Jan-18 0:16
_Flaviu9-Jan-18 0:16 
AnswerRe: CString to CByteArray Pin
Jochen Arndt9-Jan-18 1:11
professionalJochen Arndt9-Jan-18 1:11 
AnswerRe: CString to CByteArray Pin
Victor Nijegorodov9-Jan-18 1:15
Victor Nijegorodov9-Jan-18 1:15 

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.