Click here to Skip to main content
15,868,349 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 22:37
cofounderChris Maunder12-Jul-09 22:37 
PinnedHOW TO ASK A QUESTION PinPopular
Chris Maunder12-Feb-09 17:19
cofounderChris Maunder12-Feb-09 17:19 
QuestionNecesito ayuda para un código para este programa -- I need help with a code for this program Pin
Member 162330666hrs 45mins ago
Member 162330666hrs 45mins ago 
QuestionVariable types in ASM Pin
Calin Negru27-Mar-24 3:22
Calin Negru27-Mar-24 3:22 
AnswerRe: Variable types in ASM Pin
Maximilien27-Mar-24 3:49
Maximilien27-Mar-24 3:49 
AnswerRe: Variable types in ASM Pin
Mircea Neacsu27-Mar-24 3:59
Mircea Neacsu27-Mar-24 3:59 
GeneralRe: Variable types in ASM Pin
Richard MacCutchan27-Mar-24 4:02
mveRichard MacCutchan27-Mar-24 4:02 
AnswerRe: Variable types in ASM Pin
Richard MacCutchan27-Mar-24 4:01
mveRichard MacCutchan27-Mar-24 4:01 
GeneralRe: Variable types in ASM Pin
jeron127-Mar-24 4:52
jeron127-Mar-24 4:52 
GeneralRe: Variable types in ASM Pin
Calin Negru27-Mar-24 5:26
Calin Negru27-Mar-24 5:26 
GeneralRe: Variable types in ASM Pin
Richard MacCutchan27-Mar-24 6:09
mveRichard MacCutchan27-Mar-24 6:09 
AnswerRe: Variable types in ASM Pin
Calin Negru27-Mar-24 5:27
Calin Negru27-Mar-24 5:27 
Questioncommunication from library to application Pin
utcode21-Mar-24 16:23
utcode21-Mar-24 16:23 
AnswerRe: communication from library to application Pin
jschell21-Mar-24 16:26
jschell21-Mar-24 16:26 
GeneralRe: communication from library to application Pin
utcode21-Mar-24 16:42
utcode21-Mar-24 16:42 
AnswerRe: communication from library to application Pin
Richard MacCutchan21-Mar-24 22:55
mveRichard MacCutchan21-Mar-24 22:55 
GeneralRe: communication from library to application Pin
utcode22-Mar-24 20:53
utcode22-Mar-24 20:53 
GeneralRe: communication from library to application Pin
Richard MacCutchan22-Mar-24 22:57
mveRichard MacCutchan22-Mar-24 22:57 
GeneralRe: communication from library to application Pin
utcode24-Mar-24 12:31
utcode24-Mar-24 12:31 
GeneralRe: communication from library to application Pin
Dave Kreskowiak24-Mar-24 15:29
mveDave Kreskowiak24-Mar-24 15:29 
GeneralRe: communication from library to application Pin
Richard MacCutchan24-Mar-24 22:26
mveRichard MacCutchan24-Mar-24 22:26 
QuestionWhats reason of error: LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl NS::A::A Pin
Oscar K.16-Mar-24 19:58
Oscar K.16-Mar-24 19:58 
//TestDll2.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl NS::A::A(int (__cdecl*)(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >))" (__imp_??0A@NS@@QEAA@P6AHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z@Z) referenced in function main

=====file TestDll2.cpp=====
C++
#include <iostream>
#include "..\\MyDll\\MyDll.h"

using namespace std;
using namespace NS;

int Print(string str);
int main()
{
  NS::A* a = new NS::A(Print);
  NS::printDlgt("Hello World!"); 
}

int Print(string str)
{
  cout << str << endl;
  return 0;
}
MyDll project files
=====MyDll.cpp=====
C++
#include "pch.h"
#include "MyDll.h"
namespace NS
{
  PrintDelegate printDlgt;
  A::A(PrintDelegate print_Dlgt)
  {
    NS::printDlgt = print_Dlgt;
  }
}

=====MyDll.h=====
C++
#include <iostream>
#ifndef MYDLL_H
#define MYDLL_H

//MYDLL_EXPORTS is set in C++\Preprocessor
#ifdef MYDLL_EXPORTS
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif


using namespace std;
typedef int (*PrintDelegate)(string str);

namespace  NS
{
  extern PrintDelegate printDlgt;
  class MYDLL_API A
  {
  public:
     A(PrintDelegate print_Dlgt);
  };
}
#endif

AnswerRe: Whats reason of error: LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl NS::A::A Pin
Richard MacCutchan16-Mar-24 22:50
mveRichard MacCutchan16-Mar-24 22:50 
GeneralRe: Whats reason of error: LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl NS::A::A Pin
Oscar K.17-Mar-24 2:53
Oscar K.17-Mar-24 2:53 
GeneralRe: Whats reason of error: LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl NS::A::A Pin
Richard MacCutchan17-Mar-24 3:28
mveRichard MacCutchan17-Mar-24 3:28 

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.