Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Late Binding Concept Pin
Chris Meech24-Sep-12 2:19
Chris Meech24-Sep-12 2:19 
GeneralRe: Late Binding Concept Pin
pasztorpisti24-Sep-12 2:37
pasztorpisti24-Sep-12 2:37 
AnswerRe: Late Binding Concept Pin
Chuck O'Toole24-Sep-12 5:16
Chuck O'Toole24-Sep-12 5:16 
GeneralRe: Late Binding Concept Pin
pasztorpisti24-Sep-12 6:00
pasztorpisti24-Sep-12 6:00 
GeneralRe: Late Binding Concept Pin
pasztorpisti24-Sep-12 6:19
pasztorpisti24-Sep-12 6:19 
GeneralRe: Late Binding Concept Pin
Chuck O'Toole24-Sep-12 7:53
Chuck O'Toole24-Sep-12 7:53 
QuestionCallBack Function Pin
Smart Arab23-Sep-12 4:47
Smart Arab23-Sep-12 4:47 
AnswerRe: CallBack Function Pin
Mohibur Rashid23-Sep-12 6:06
professionalMohibur Rashid23-Sep-12 6:06 
You have mixed up a lot, specially with typedef and function pointer definition and usage. To understand function pointer definition clearly read about Function Pointer[^]. Also look at wiki link[^] to learn about typedef in detail.

To solve your problem
1. write include of windows.h as
#include <windows.h>
and it has nothing to do with your problem

2. If you have the .lib file then it is great just include the header file as below:
#include "the_header_file.h"

and also include the library file with your project.


if you dont have then follow the code it might help:


C++
#include <cstdlib>
#include <iostream>
#include <windows.h>
 
using namespace std;
 
typedef bool  (*cbtype)  (char *what, int, int, char *str);
 
bool SomeCallback( char *c1 , int i1 , int i2, char *c2)
{
     printf("%s\r\n" , c1);
     printf("%d\r\n" , i1);
     printf("%d\r\n" , i2);
     printf("%s\r\n" , c2);
     return true;
}
 
void ArcExtract ()
{  
	
	HINSTANCE GetProcDLL = LoadLibrary("unarc.dll");
	if(GetProcDLL==NULL)
        {
		//handle error
	}
 
	typedef int (__cdecl * CallingFun)(cbtype, ...);
 
    	CallingFun FreeArcExtract;
    FreeArcExtract =(CallingFun) GetProcAddress(HMODULE (GetProcDLL), "FreeArcExtract");
	if(FreeArcExtract==NULL)
	{
		//handle error
	}
	FreeArcExtract((cbtype)SomeCallback,
"l", "--", "d:\\test.arc", "", "", "", "", "", "", "");
    FreeLibrary(GetProcDLL);
}
 
int main(int argc, char *argv[])
{
    ArcExtract ();
    //system("pause");

    return EXIT_SUCCESS;
}

I wish I could believe there is an after life.

GeneralRe: CallBack Function Pin
Smart Arab24-Sep-12 1:39
Smart Arab24-Sep-12 1:39 
QuestionQuestion about MFC implementation Pin
Jian Jun Liu23-Sep-12 2:33
Jian Jun Liu23-Sep-12 2:33 
AnswerRe: Question about MFC implementation Pin
pasztorpisti23-Sep-12 3:20
pasztorpisti23-Sep-12 3:20 
GeneralRe: Question about MFC implementation Pin
Jian Jun Liu24-Sep-12 15:01
Jian Jun Liu24-Sep-12 15:01 
GeneralRe: Question about MFC implementation Pin
pasztorpisti24-Sep-12 15:23
pasztorpisti24-Sep-12 15:23 
GeneralRe: Question about MFC implementation Pin
Jian Jun Liu26-Sep-12 16:59
Jian Jun Liu26-Sep-12 16:59 
AnswerRe: Question about MFC implementation Pin
Chris Meech23-Sep-12 4:57
Chris Meech23-Sep-12 4:57 
GeneralRe: Question about MFC implementation Pin
pasztorpisti23-Sep-12 7:34
pasztorpisti23-Sep-12 7:34 
GeneralRe: Question about MFC implementation Pin
Chris Meech23-Sep-12 12:03
Chris Meech23-Sep-12 12:03 
Generalsource code Pin
pei0825010321-Sep-12 15:51
pei0825010321-Sep-12 15:51 
GeneralRe: source code Pin
Richard MacCutchan21-Sep-12 21:13
mveRichard MacCutchan21-Sep-12 21:13 
QuestionWhat makes C and C++ a "good" language? Pin
Brandon-X1200018-Sep-12 16:06
Brandon-X1200018-Sep-12 16:06 
AnswerRe: What makes C and C++ a "good" language? PinPopular
Richard Andrew x6418-Sep-12 16:20
professionalRichard Andrew x6418-Sep-12 16:20 
AnswerRe: What makes C and C++ a "good" language? Pin
Chris Losinger18-Sep-12 16:37
professionalChris Losinger18-Sep-12 16:37 
AnswerRe: What makes C and C++ a "good" language? Pin
Stephen Hewitt18-Sep-12 18:46
Stephen Hewitt18-Sep-12 18:46 
AnswerRe: What makes C and C++ a "good" language? PinPopular
CPallini18-Sep-12 21:27
mveCPallini18-Sep-12 21:27 
AnswerRe: What makes C and C++ a "good" language? Pin
pasztorpisti19-Sep-12 2:47
pasztorpisti19-Sep-12 2:47 

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.