Click here to Skip to main content
16,010,268 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Convert long to SYSTEMTIME Pin
_moved3-May-04 2:39
_moved3-May-04 2:39 
GeneralLogin into msn Pin
?!?3-May-04 1:20
?!?3-May-04 1:20 
GeneralRe: Login into msn Pin
Alexander M.,3-May-04 1:52
Alexander M.,3-May-04 1:52 
GeneralRe: Login into msn Pin
?!?3-May-04 2:27
?!?3-May-04 2:27 
GeneralRe: Login into msn Pin
Alexander M.,3-May-04 2:44
Alexander M.,3-May-04 2:44 
GeneralRe: Login into msn Pin
?!?3-May-04 2:49
?!?3-May-04 2:49 
GeneralRe: Login into msn Pin
jmkhael3-May-04 2:58
jmkhael3-May-04 2:58 
GeneralSetting Data in a DLL Pin
Grahamfff3-May-04 0:52
Grahamfff3-May-04 0:52 
I need to modify a library that is used by a C-Scripting application to allow a MFC application to stop and start the processing.

The DLL builds OK, but both the application which loads the dll and the script that checks the flag always see the flag a false (0).

However I get the abortFlag is always 0 (false); see code snips below:-


First the Modifed section of th DLL project:-

#define DLLDIR __declspec(dllexport) // export DLL information

// The extern "C" declaration allows mixed languages compactability, it prevents
// the C++ compiler from using decorated (modified) names for the functions
extern "C" { <-------- Error here !!!!!!!!!!!
void DLLDIR APPSetAbortFlag(int);
int DLLDIR APPGetAbortFlag(void);
};
static int abortFlag; /* The flag to abort the test */
static int contiuneFlag; /* The flag to schedule the test to continue */
static int enterFlag; /* The flag to schedule data entry the test */


int APPGetAbortFlag()
{
return abortFlag;
}

void APPSetAbortFlag(int a)
{
if(a == 1)
abortFlag = 1;
else
abortFlag = 0;
}

Next the section of code for the application that uses the DLL:-

typedef void (*APPSETABORTFLAG)(int); // Pointer to APPSetAbortFlag(int)
typedef int (*APPGETABORTFLAG)(void); // Pointer to function int APPGetAbortFlag()

hMod = LoadLibrary("WHLLib.dll");

pGetAbortFlag = (APPGETABORTFLAG) GetProcAddress(hMod, "APPGetAbortFlag");

pSetAbortFlag = (APPSETABORTFLAG) GetProcAddress(hMod, "APPSetAbortFlag");

I set the flag like:-
UINT value = 1;
(pSetAbortFlag)(value);

and read the flag like:-

int result = (pGetAbortFlag) ();

Are they a problem with the use of the item of data in the DLL?



grahamfff
GeneralRe: Setting Data in a DLL Pin
jmkhael3-May-04 3:00
jmkhael3-May-04 3:00 
GeneralRe: Setting Data in a DLL Pin
sweep1233-May-04 23:10
sweep1233-May-04 23:10 
GeneralDisplaying dynamic XML in IE which is translated by xslt Pin
chabster3-May-04 0:32
chabster3-May-04 0:32 
Generalabout directsound / getting instantaneous frequency of the sound playing Pin
dipum2-May-04 22:51
dipum2-May-04 22:51 
GeneralRe: about directsound / getting instantaneous frequency of the sound playing Pin
Anonymous31-May-04 21:36
Anonymous31-May-04 21:36 
GeneralC++ -&gt; Camera project, (mjpeg, jpeg to avi ... ?) Pin
Qualvis2-May-04 22:23
Qualvis2-May-04 22:23 
GeneralRe: C++ -&gt; Camera project, (mjpeg, jpeg to avi ... ?) Pin
Andrew Walker3-May-04 0:14
Andrew Walker3-May-04 0:14 
GeneralRe: C++ -&gt; Camera project, (mjpeg, jpeg to avi ... ?) Pin
Qualvis3-May-04 1:39
Qualvis3-May-04 1:39 
GeneralRe: C++ -&gt; Camera project, (mjpeg, jpeg to avi ... ?) Pin
Andrew Walker3-May-04 1:46
Andrew Walker3-May-04 1:46 
GeneralRe: C++ -&gt; Camera project, (mjpeg, jpeg to avi ... ?) Pin
Qualvis3-May-04 3:28
Qualvis3-May-04 3:28 
GeneralInvalidate() - Erasing background Pin
AJ1232-May-04 22:11
AJ1232-May-04 22:11 
GeneralRe: Invalidate() - Erasing background Pin
AJ1232-May-04 23:38
AJ1232-May-04 23:38 
QuestionHow to make a .lib ? Pin
Anonymous2-May-04 21:12
Anonymous2-May-04 21:12 
AnswerRe: How to make a .lib ? Pin
nguyenvhn2-May-04 23:17
nguyenvhn2-May-04 23:17 
GeneralRe: How to make a .lib ? Pin
Anonymous3-May-04 2:16
Anonymous3-May-04 2:16 
GeneralProblems with Mfc-Program: black screen Pin
Brennivin2-May-04 21:04
sussBrennivin2-May-04 21:04 
GeneralRe: Problems with Mfc-Program: black screen Pin
Alexander M.,3-May-04 1:54
Alexander M.,3-May-04 1:54 

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.