Click here to Skip to main content
15,914,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSegmentation fault?! Pin
Whiphub12-Sep-04 9:39
Whiphub12-Sep-04 9:39 
GeneralRe: Segmentation fault?! Pin
Antti Keskinen12-Sep-04 10:44
Antti Keskinen12-Sep-04 10:44 
GeneralSwitching mainframe menu (solution) Pin
Ravi Bhavnani12-Sep-04 8:23
professionalRavi Bhavnani12-Sep-04 8:23 
GeneralRe: Switching mainframe menu (solution) Pin
KaЯl13-Sep-04 3:55
KaЯl13-Sep-04 3:55 
QuestionHOw to convert from EMF to SWF. Pin
Azghar Hussain12-Sep-04 7:49
professionalAzghar Hussain12-Sep-04 7:49 
AnswerRe: HOw to convert from EMF to SWF. Pin
Christian Graus12-Sep-04 11:52
protectorChristian Graus12-Sep-04 11:52 
QuestionLink/C-calling convention ? Pin
0v3rloader12-Sep-04 6:46
0v3rloader12-Sep-04 6:46 
AnswerRe: Link/C-calling convention ? Pin
Antti Keskinen12-Sep-04 9:38
Antti Keskinen12-Sep-04 9:38 
I must ask, however inconvinient it sounds, what is the situation you wish to prevent ?

Are you, per chance, failing to retrieve the address of the function, unless you name the parameter of GetProcAddress to "_Setup@0" ?

How did you export the function from the DLL ? Or was it built by someone else ? Was it built with Visual Studio ? These questions are imperative, mostly because if the last answer is positive, there are two ways of exporting functions from a DLL.

If you have access to the DLL code, you should add a __declspec(dllexport) calling convention in front of the setup function. Also, create a module definition file (.DEF) inside the DLL project. Paste the following text into it
LIBRARY    "MyDLL.DLL"
EXPORTS
     Setup   @0
When you now build the DLL, the GetProcAddress will not fail if you use "Setup" as the function name. Before, you built the DLL using the default settings. In such a case, the exported routines are added with the underscore in front of them. It is called 'behaviour by default' in Microsoft's terms. The only way to remedy it is to use a module definition file. The __declspec definition is added for increased compatibility, as in, fail-safe exporting.

Also, if you're using dynamic loading (LoadLibrary), the library file is useless. Library files generated for DLL's are only usable if static linking is used, or if the DLL contains a registered COM component (DirectX applications, for an example).

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Link/C-calling convention ? Pin
0v3rloader12-Sep-04 22:59
0v3rloader12-Sep-04 22:59 
GeneralRe: Link/C-calling convention ? Pin
Antti Keskinen13-Sep-04 4:15
Antti Keskinen13-Sep-04 4:15 
GeneralRe: Link/C-calling convention ? Pin
0v3rloader14-Sep-04 1:47
0v3rloader14-Sep-04 1:47 
GeneralEnvironment macro Pin
Rome Singh12-Sep-04 6:31
Rome Singh12-Sep-04 6:31 
GeneralRe: Environment macro Pin
Andrew Walker12-Sep-04 14:46
Andrew Walker12-Sep-04 14:46 
GeneralRe: Environment macro Pin
Rome Singh13-Sep-04 5:12
Rome Singh13-Sep-04 5:12 
GeneralRe: Environment macro Pin
Andrew Walker13-Sep-04 12:52
Andrew Walker13-Sep-04 12:52 
QuestionWarning: no message line prompt for ID *???? Pin
jettocrack12-Sep-04 6:13
jettocrack12-Sep-04 6:13 
AnswerRe: Warning: no message line prompt for ID *???? Pin
Ravi Bhavnani12-Sep-04 7:13
professionalRavi Bhavnani12-Sep-04 7:13 
GeneralProblem Regarding Tree in DOTNET Pin
eshban28412-Sep-04 6:08
eshban28412-Sep-04 6:08 
GeneralRe: Problem Regarding Tree in DOTNET Pin
Antti Keskinen12-Sep-04 10:12
Antti Keskinen12-Sep-04 10:12 
GeneralDouble buffering in MFC Pin
amigaguy12-Sep-04 6:07
amigaguy12-Sep-04 6:07 
GeneralRe: Double buffering in MFC Pin
Antti Keskinen12-Sep-04 10:33
Antti Keskinen12-Sep-04 10:33 
GeneralRe: Double buffering in MFC Pin
Anonymous12-Sep-04 11:50
Anonymous12-Sep-04 11:50 
GeneralCDaoDatabase connection string in Windows XP Pin
olis12-Sep-04 5:36
olis12-Sep-04 5:36 
GeneralProcess help Pin
swarup12-Sep-04 4:40
swarup12-Sep-04 4:40 
GeneralToolbar in views Pin
Jens Christiansen12-Sep-04 3:26
Jens Christiansen12-Sep-04 3:26 

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.