Click here to Skip to main content
13,735,540 members

C / C++ / MFC

 
AnswerRe: conversion error Pin
Jochen Arndt14-Jan-18 21:19
mvpJochen Arndt14-Jan-18 21:19 
AnswerRe: conversion error Pin
Richard MacCutchan14-Jan-18 21:36
protectorRichard MacCutchan14-Jan-18 21:36 
QuestionI couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 7:37
memberEmrah Duatepe14-Jan-18 7:37 
AnswerRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt14-Jan-18 21:37
mvpJochen Arndt14-Jan-18 21:37 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 21:44
memberEmrah Duatepe14-Jan-18 21:44 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt14-Jan-18 22:18
mvpJochen Arndt14-Jan-18 22:18 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 23:37
memberEmrah Duatepe14-Jan-18 23:37 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:20
mvpJochen 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:
// 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
memberEmrah Duatepe15-Jan-18 0:30 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:48
mvpJochen Arndt15-Jan-18 0:48 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe15-Jan-18 0:39
memberEmrah Duatepe15-Jan-18 0:39 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Jochen Arndt15-Jan-18 0:54
mvpJochen Arndt15-Jan-18 0:54 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe15-Jan-18 1:10
memberEmrah Duatepe15-Jan-18 1:10 
AnswerRe: I couldn't think a good title for this.Simple question Pin
Richard MacCutchan14-Jan-18 21:39
protectorRichard MacCutchan14-Jan-18 21:39 
GeneralRe: I couldn't think a good title for this.Simple question Pin
Emrah Duatepe14-Jan-18 21:45
memberEmrah Duatepe14-Jan-18 21:45 
Questionfinding longest word Pin
Anonygeeker10-Jan-18 22:05
memberAnonygeeker10-Jan-18 22:05 
AnswerRe: finding longest word Pin
Richard MacCutchan10-Jan-18 22:25
protectorRichard MacCutchan10-Jan-18 22:25 
GeneralRe: finding longest word Pin
Anonygeeker10-Jan-18 22:40
memberAnonygeeker10-Jan-18 22:40 
GeneralRe: finding longest word Pin
Richard MacCutchan10-Jan-18 22:46
protectorRichard MacCutchan10-Jan-18 22:46 
GeneralRe: finding longest word Pin
Anonygeeker10-Jan-18 23:00
memberAnonygeeker10-Jan-18 23:00 
AnswerRe: finding longest word Pin
Jochen Arndt10-Jan-18 22:45
mvpJochen Arndt10-Jan-18 22:45 
AnswerRe: finding longest word Pin
CPallini10-Jan-18 23:31
mvpCPallini10-Jan-18 23:31 
QuestionCString to CByteArray Pin
_Flaviu9-Jan-18 0:16
member_Flaviu9-Jan-18 0:16 
AnswerRe: CString to CByteArray Pin
Jochen Arndt9-Jan-18 1:11
mvpJochen Arndt9-Jan-18 1:11 
AnswerRe: CString to CByteArray Pin
Victor Nijegorodov9-Jan-18 1:15
memberVictor 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.


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180920.1 | Last Updated 18 Oct 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid