Click here to Skip to main content
15,890,995 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DLL creation problem Pin
Richard MacCutchan16-Nov-09 0:53
mveRichard MacCutchan16-Nov-09 0:53 
AnswerRe: DLL creation problem Pin
Iain Clarke, Warrior Programmer16-Nov-09 0:41
Iain Clarke, Warrior Programmer16-Nov-09 0:41 
AnswerRe: DLL creation problem Pin
CPallini16-Nov-09 0:43
mveCPallini16-Nov-09 0:43 
GeneralRe: DLL creation problem Pin
Richard MacCutchan16-Nov-09 0:50
mveRichard MacCutchan16-Nov-09 0:50 
GeneralRe: DLL creation problem Pin
CPallini16-Nov-09 0:56
mveCPallini16-Nov-09 0:56 
AnswerRe: DLL creation problem Pin
Game-point16-Nov-09 0:57
Game-point16-Nov-09 0:57 
GeneralRe: DLL creation problem Pin
Richard MacCutchan16-Nov-09 1:08
mveRichard MacCutchan16-Nov-09 1:08 
GeneralRe: DLL creation problem Pin
Game-point16-Nov-09 1:16
Game-point16-Nov-09 1:16 
#include "stdafx.h"
#include <iostream>
#include <windows.h>
extern "C" __declspec(dllexport) void MyFunc(char**argv);

void MyFunc(char** argv)
{
	std::cout<<argv[1] << "\n" <<argv[2] <<std::endl;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	int argc;
	char** argv;
	argv = (char**) malloc(3*sizeof(char));
	argv[1] = (char*)malloc(sizeof(char)*20);
	argv[1] = "Maples";
	argv[2] = (char*)malloc(sizeof(char)*20);
	argv[2] = "esm";
    MyFunc(argv);		
	
	return TRUE;
}




// DLLcomexeTesting.cpp : Defines the entry point for the console application.
//



#include "stdafx.h"
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
	
	typedef void (*MYFUN)(char**);
	MYFUN pFun;
	HMODULE hmod; // Handle to declare dll 
	hmod = ::LoadLibrary(L"DLLcomExe.dll");	
	pFun = (MYFUN)GetProcAddress(hmod,"MyFunc");
	int argc;
	char** argv;
	argv = (char**) malloc(3*sizeof(char));
	argv[1] = (char*)malloc(sizeof(char)*20);
	argv[1] = "Hello";
	argv[2] = (char*)malloc(sizeof(char)*20);
	argv[2] = "cpp";	
	(pFun)(argv);
	return 0;
}


this is working ..but its print 3 times

Raju !!!


GeneralRe: DLL creation problem Pin
Richard MacCutchan16-Nov-09 1:31
mveRichard MacCutchan16-Nov-09 1:31 
GeneralRe: DLL creation problem Pin
Cedric Moonen16-Nov-09 1:13
Cedric Moonen16-Nov-09 1:13 
GeneralRe: DLL creation problem Pin
Rozis16-Nov-09 9:40
Rozis16-Nov-09 9:40 
GeneralRe: DLL creation problem Pin
Richard MacCutchan16-Nov-09 21:27
mveRichard MacCutchan16-Nov-09 21:27 
QuestionHow to stop pop-up window save or not when closing childFrame in MDI of MFC Pin
jianzhuhuai16-Nov-09 0:14
jianzhuhuai16-Nov-09 0:14 
AnswerRe: How to stop pop-up window save or not when closing childFrame in MDI of MFC Pin
krmed16-Nov-09 0:25
krmed16-Nov-09 0:25 
GeneralRe: How to stop pop-up window save or not when closing childFrame in MDI of MFC Pin
jianzhuhuai18-Nov-09 2:35
jianzhuhuai18-Nov-09 2:35 
Questionplease help !!generation of uniform random numbers Pin
Archer justice15-Nov-09 23:57
Archer justice15-Nov-09 23:57 
AnswerRe: please help !!generation of uniform random numbers Pin
CPallini16-Nov-09 0:08
mveCPallini16-Nov-09 0:08 
AnswerRe: please help !!generation of uniform random numbers Pin
Ahmed Charfeddine16-Nov-09 0:09
Ahmed Charfeddine16-Nov-09 0:09 
GeneralRe: please help !!generation of uniform random numbers Pin
Archer justice16-Nov-09 0:33
Archer justice16-Nov-09 0:33 
GeneralRe: please help !!generation of uniform random numbers Pin
CPallini16-Nov-09 0:45
mveCPallini16-Nov-09 0:45 
GeneralRe: please help !!generation of uniform random numbers Pin
Archer justice16-Nov-09 0:54
Archer justice16-Nov-09 0:54 
QuestionRe: please help !!generation of uniform random numbers Pin
CPallini16-Nov-09 1:01
mveCPallini16-Nov-09 1:01 
AnswerRe: please help !!generation of uniform random numbers Pin
Archer justice16-Nov-09 1:06
Archer justice16-Nov-09 1:06 
QuestionHelp: How to autofit CListCtrl's background? Pin
Symfund15-Nov-09 22:49
Symfund15-Nov-09 22:49 
AnswerRe: Help: How to autofit CListCtrl's background? Pin
Ahmed Charfeddine16-Nov-09 0:12
Ahmed Charfeddine16-Nov-09 0:12 

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.