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

C / C++ / MFC

 
AnswerRe: DLL creation problem Pin
Richard MacCutchan16-Nov-09 0:24
mveRichard MacCutchan16-Nov-09 0:24 
GeneralRe: DLL creation problem Pin
Game-point16-Nov-09 0:34
Game-point16-Nov-09 0:34 
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 
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include <iostream>
#include <windows.h>

void MyFunc(int argc,char**argv);
void MyFunc(int argc,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] = "Hello";
	argv[2] = (char*)malloc(sizeof(char)*20);
	argv[2] = "Cpp";
    MyFunc(5,argv);		
	
	return TRUE;
}



This is dll creation successfully sir,

but i test that dll its throwing

Unhandled exception at 0x00000000 in Test.exe: 0xC0000005: Access violation reading location 0x00000000.

this is my testing dll code sir

#include "stdafx.h"
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
	
	typedef void (*MYFUN)();
	MYFUN pFun;
	HMODULE hmod; // Handle to declare dll 
	hmod = ::LoadLibrary(L"DLLcomExe.dll");	
	pFun = (MYFUN)GetProcAddress(hmod,"DllMain");	
	(pFun)();
	return 0;
}


Raju !!!


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 
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 

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.