[mpich-discuss] problem of calling .dll in mpich

Jayesh Krishna jayesh at mcs.anl.gov
Fri Dec 5 09:03:52 CST 2008

 Can you send us a sample test program that fails ?


From: mpich-discuss-bounces at mcs.anl.gov
[mailto:mpich-discuss-bounces at mcs.anl.gov] On Behalf Of Vivian
Sent: Friday, December 05, 2008 12:05 AM
To: mpich-discuss at mcs.anl.gov
Subject: [mpich-discuss] problem of calling .dll in mpich

      I met some problems when I was trying to call a dll in a mpich
program (Language:VS 2005).
      (1) MPICH seems to only support calling convention  _cdecl. 
          When I change the project setting to _stdcall, the code cannot
be successfully built.
          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. 
          Under debugging mode or directly run in command window (
c:>test.ext), there is no problem to call dll in the code.
          Here is the code:
     typedef char (__stdcall *AVRUN) (char[100]);  
     HINSTANCE ArcviewDLL;  
     AVRUN AVRun;
     ArcviewDLL= LoadLibraryA("Avhelp.dll");    
     AVRun = (AVRUN) GetProcAddress(ArcviewDLL, "AVRun");


      (2) However, the program fails to call dll when I use "mpiexec" to
run it. (c:>mpiexec -n 1 test.exe).
           It seems to "stop" right before this line
          Is there anyone having any idea why this happens?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20081205/063eaead/attachment.htm>

More information about the mpich-discuss mailing list