Click here to Skip to main content
12,356,052 members (68,837 online)

C / C++ / MFC

 
GeneralRe: float into array of bytes Pin
Roger Allen15-Jul-04 3:33
memberRoger Allen15-Jul-04 3:33 
GeneralMFC and Windows.Forms integration Pin
EinarJon15-Jul-04 0:19
memberEinarJon15-Jul-04 0:19 
GeneralEnumFontFamilies Pin
Galisteo15-Jul-04 0:17
memberGalisteo15-Jul-04 0:17 
GeneralRe: EnumFontFamilies Pin
DavidCrow15-Jul-04 4:23
memberDavidCrow15-Jul-04 4:23 
GeneralRe: EnumFontFamilies Pin
Galisteo15-Jul-04 6:23
memberGalisteo15-Jul-04 6:23 
GeneralLinking error ?? y Pin
Zeeshan Bilal15-Jul-04 0:14
memberZeeshan Bilal15-Jul-04 0:14 
GeneralHiding a dialog box of another process Pin
UlrichG15-Jul-04 0:05
memberUlrichG15-Jul-04 0:05 
GeneralC++ Def and Non-Def file - Function Signature - help! Pin
chuawenching14-Jul-04 23:50
memberchuawenching14-Jul-04 23:50 
Hi there,

I had a question.

I just noticed the availability of module definition file *.def. I had a few doubts.

The current scenario:
-------------------------

*The wrapper dll's library and dll is place under the SDK folder. The lib file is included in the project under the visual studio path settings.

SDK -> Wrapper Dll

SDK code:
-------------

#include "wrapper_dll.h"

extern "C" __declspec(dllimport) double TestA(double a, double b);

Wrapper DLL Code:
------------------------

#define extern "C __declspec(dllexport)

EXTERN double WINAPI TestA(double a, double b);

When you built in into a dll, when you view the dll dependecies, you will notice this (example):

Ordinal = 1 (0x0001)
Hint = 0 (0x0000)
Function = _TestA@20
EntryPoint = 0x0000101E

*The build dll, lib and header file is past to the SDK team to call it.

============================================================

Now, I want to implement def file:

SDK (cannot modified, coz done by someone else and different team) but it still calls the Wrapper dll.

SDK code (same with on top):
-----------------------------------

#include "wrapper_dll.h"

extern "C" __declspec(dllimport) double TestA(double a, double b);

New Wrapper Dll code:
---------------------------

wrapper_dll.cpp:

double TestA(double a, double b)
{
return a + b / 10;
}

wrapper_dll.h:

#pragma once // what does pragma means anyway?? any idea???

double TestA(double a, double b);

wrapper_dll.def:

LIBRARY Wrapper_Dll

EXPORTS
TestA

Now, when i view this dll dependencies, it appears to be like this:

Ordinal = 1 (0x0001)
Hint = 0 (0x0000)
Function = TestA
EntryPoint = 0x000128A7

*problem is the Function name is changed, entrypoint number is change... will this cause problem for the SDK when calling.

============================================================

I need to make sure SDK should be recompiled. I just have to replace the new wrapper dll, lib and .h into the existing files that is part of the SDK folder.

Should i be using def or not def? The current old code is using no def file. Means the sdk will have __declspec(dllimport) and the wrapper will have __declspec(dllexport), and the #include "Wrapper_dll.h" is still part of it of the sdk.

Please help! Module definition file is indeed easier for us as a coder to code. But i just want to see what is the advantages of using def over the others.

Thanks.

Regards,
Chua Wen Ching :p
GeneralRe: C++ Def and Non-Def file - Function Signature - help! Pin
va'Lery15-Jul-04 12:16
memberva'Lery15-Jul-04 12:16 
QuestionHow To Display TIFF File in MFC Application.?????? Pin
mahatma_cis14-Jul-04 23:40
membermahatma_cis14-Jul-04 23:40 
AnswerRe: How To Display TIFF File in MFC Application.?????? Pin
KaЯl15-Jul-04 0:19
memberKaЯl15-Jul-04 0:19 
AnswerRe: How To Display TIFF File in MFC Application.?????? Pin
swandream15-Jul-04 0:21
memberswandream15-Jul-04 0:21 
QuestionHow to use extra API for Visual C++ Application. Pin
pubba14-Jul-04 23:02
susspubba14-Jul-04 23:02 
Generalwin32 Pin
uma maheswari14-Jul-04 22:11
memberuma maheswari14-Jul-04 22:11 
GeneralRe: win32 Pin
DavidCrow15-Jul-04 7:41
memberDavidCrow15-Jul-04 7:41 
GeneralHOW: overiding [x] system close button - not working Pin
JabraJabra14-Jul-04 21:39
memberJabraJabra14-Jul-04 21:39 
GeneralRe: HOW: overiding [x] system close button - not working Pin
Papa14-Jul-04 22:11
memberPapa14-Jul-04 22:11 
GeneralRe: HOW: overiding [x] system close button - not working Pin
JabraJabra15-Jul-04 9:21
memberJabraJabra15-Jul-04 9:21 
GeneralRe: HOW: overiding [x] system close button - not working Pin
V.14-Jul-04 22:11
memberV.14-Jul-04 22:11 
GeneralFront page like container Pin
Omar Alvi14-Jul-04 20:58
memberOmar Alvi14-Jul-04 20:58 
Generalminimizing and maximizing a dialog Pin
locoone14-Jul-04 20:35
memberlocoone14-Jul-04 20:35 
GeneralRe: minimizing and maximizing a dialog Pin
Alok the programmer14-Jul-04 20:49
memberAlok the programmer14-Jul-04 20:49 
GeneralRegistry Values Problm Plz hlp me Pin
Zeeshan Bilal14-Jul-04 19:38
memberZeeshan Bilal14-Jul-04 19:38 
GeneralRe: Registry Values Problm Plz hlp me Pin
Alok the programmer14-Jul-04 21:21
memberAlok the programmer14-Jul-04 21:21 
GeneralRe: Registry Values Problm Plz hlp me Pin
Zeeshan Bilal14-Jul-04 21:47
memberZeeshan Bilal14-Jul-04 21: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.


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 29 Jun 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid