<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=153140315-05122008>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=153140315-05122008> Can you send us a sample test program that fails
?</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=153140315-05122008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=153140315-05122008>Regards,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=153140315-05122008>Jayesh</SPAN></FONT></DIV><FONT face=Arial
color=#0000ff size=2></FONT><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mpich-discuss-bounces@mcs.anl.gov
[mailto:mpich-discuss-bounces@mcs.anl.gov] <B>On Behalf Of
</B>Vivian<BR><B>Sent:</B> Friday, December 05, 2008 12:05 AM<BR><B>To:</B>
mpich-discuss@mcs.anl.gov<BR><B>Subject:</B> [mpich-discuss] problem of calling
.dll in mpich<BR></FONT><BR></DIV>
<DIV></DIV>Hi,<BR> I met some problems when I was
trying to call a dll in a mpich program (Language:VS
2005).<BR> (1) MPICH seems to only support calling
convention _cdecl. <BR> When I change
the project setting to _stdcall, the code cannot be successfully
built.<BR> So I set the
project setting back to _cdecl and force the calling convention of the function
pointer to my function on the DLL to be "_stdcall". This time the program is
built. <BR> Under
debugging mode or directly run in command window ( c:>test.ext), there is no
problem to call dll in the code.<BR> Here is
the code:<BR>
--------------------------------------------------------------------------------
<BR> typedef char (__stdcall *AVRUN) (char[100]);
<BR> HINSTANCE ArcviewDLL;
<BR> AVRUN AVRun;<BR>
ArcviewDLL= LoadLibraryA("Avhelp.dll");
<BR> AVRun = (AVRUN) GetProcAddress(ArcviewDLL,
"AVRun");<BR><BR>
AVRun("av.run(\"HAO_script3\",\"\")");<BR>
-------------------------------------------------------------------------------<BR><BR>
(2) However, the program fails to call dll when I use "mpiexec" to run it.
(c:>mpiexec -n 1
test.exe).<BR> It
seems to "stop" right before this line<BR>
-------------------------------------------------------------<BR>
AVRun("av.run(\"HAO_script3\",\"\")");<BR>
-------------------------------------------------------------<BR>
Is there anyone having any idea why this happens?<BR
clear=all><BR>--<BR>Vivian<BR></BODY></HTML>