Click here to Skip to main content
15,904,156 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Migration to C++.NET Pin
ahmed_adel_farid5-May-06 19:43
ahmed_adel_farid5-May-06 19:43 
GeneralRe: Migration to C++.NET Pin
Stephen Hewitt5-May-06 23:33
Stephen Hewitt5-May-06 23:33 
AnswerRe: Migration to C++.NET Pin
Phil C5-May-06 21:28
Phil C5-May-06 21:28 
GeneralRe: Migration to C++.NET Pin
Stephen Hewitt5-May-06 23:01
Stephen Hewitt5-May-06 23:01 
GeneralRe: Migration to C++.NET Pin
Phil C6-May-06 6:19
Phil C6-May-06 6:19 
GeneralRe: Migration to C++.NET Pin
Stephen Hewitt6-May-06 18:29
Stephen Hewitt6-May-06 18:29 
GeneralRe: Migration to C++.NET Pin
Phil C6-May-06 19:42
Phil C6-May-06 19:42 
QuestionRevisiting calling a function in another dll Pin
LuckyCarl5-May-06 15:08
LuckyCarl5-May-06 15:08 
I have a function that is returning an integer, with a few strings being passed by reference. After running the debugger, it seems to run till I call the actual function that resides in a different dll. At that point I receive a window stating:
Unhandled exception at 0x0a30f6da in PCTest.exe: 0xC0000005: Access violation reading location 0xcccccccc.
The value of the external function in the debugger is 0x0a34310c and not 0xcccccccc.
I've set the permissions in the security to allow everyone, all access, (even the directory) but still access violation.

Here's my code, it seems simple enough, but I can not see it...

#include <stdlib.h>
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

int main()
{
typedef int(* PExportedFn)(char*,char*,char*);
HMODULE hmod;
PExportedFn ExFunc;
char char1ref[10],char2rev[10],char3ref[10];
int ReturnValue;
hmod = LoadLibrary("C:\\MYDIR\\EXTDLL.DLL");
if (hmod != NULL)
{
printf("Succeeded loading library");
ExFunc = (PExportedFn)GetProcAddress(hmod,"FUNC");
if ( ExFunc != NULL)
{
printf("Succeeded loading library");
wcscpy(char1ref, "1234");
ReturnValue = ExFunc(char1ref,char2ref,char3ref);
printf("Succeeded, return value is:%f",ReturnVal);
}
}
else
{
printf("Did Not succeeded loading library");
}
return 0;
}

Any help would be greatly appreciated.
Carl


Lucky_Carl

AnswerRe: Revisiting calling a function in another dll Pin
Michael Dunn5-May-06 16:03
sitebuilderMichael Dunn5-May-06 16:03 
AnswerRe: Revisiting calling a function in another dll Pin
Stephen Hewitt5-May-06 18:27
Stephen Hewitt5-May-06 18:27 
AnswerRe: Revisiting calling a function in another dll Pin
Laxman Auti5-May-06 18:40
Laxman Auti5-May-06 18:40 
AnswerRe: Revisiting calling a function in another dll Pin
Laxman Auti5-May-06 19:02
Laxman Auti5-May-06 19:02 
QuestionCSocket timeout Pin
JBAK_CP5-May-06 14:17
JBAK_CP5-May-06 14:17 
AnswerRe: CSocket timeout Pin
led mike5-May-06 17:43
led mike5-May-06 17:43 
QuestionHiding a data file from users Pin
chasetoys5-May-06 12:17
chasetoys5-May-06 12:17 
AnswerRe: Hiding a data file from users Pin
Maxwell Chen5-May-06 17:20
Maxwell Chen5-May-06 17:20 
AnswerRe: Hiding a data file from users Pin
Stephen Hewitt5-May-06 18:34
Stephen Hewitt5-May-06 18:34 
GeneralRe: Hiding a data file from users Pin
Maxwell Chen5-May-06 19:12
Maxwell Chen5-May-06 19:12 
GeneralRe: Hiding a data file from users Pin
Hamid_RT5-May-06 19:22
Hamid_RT5-May-06 19:22 
GeneralRe: Hiding a data file from users Pin
Maxwell Chen5-May-06 19:29
Maxwell Chen5-May-06 19:29 
GeneralRe: Hiding a data file from users Pin
Hamid_RT5-May-06 19:40
Hamid_RT5-May-06 19:40 
GeneralRe: Hiding a data file from users Pin
Maxwell Chen5-May-06 20:00
Maxwell Chen5-May-06 20:00 
GeneralRe: Hiding a data file from users Pin
Hamid_RT5-May-06 20:12
Hamid_RT5-May-06 20:12 
GeneralRe: Hiding a data file from users Pin
Maxwell Chen5-May-06 20:16
Maxwell Chen5-May-06 20:16 
AnswerRe: Hiding a data file from users Pin
led mike5-May-06 20:55
led mike5-May-06 20:55 

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.