943,515 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 553
  • C++ RSS
Oct 14th, 2008
0

exporting functions from debugged dll

Expand Post »
Hi everyone,

I have a problem with a dll file. I have a 32 bit dll file and a program (x86 debugged) which uses the functions exported from the dynamic link library file and working well. I changed my program codes to 64 bit along time ago without an error and without changing the codes of calling functions. I also found the source code of the dll file and debugged the 64 bit dll file (x64 debug) without any error or warning. But when I call a function from the dll file, it does nothing. No error or warning messages instead! The declaration of the functions in the dll file are listed below:
C++ Syntax (Toggle Plain Text)
  1. #pragma once
  2.  
  3. #include "stdafx.h"
  4. #define DLLEXPORT __declspec(dllexport)
  5.  
  6. // --- Define the EPANET toolkit constants
  7.  
  8. #define EN_ELEVATION 0
  9. #define EN_BASEDEMAND 1
  10. #define EN_PATTERN 2
  11. #define EN_EMITTER 3
  12. #define EN_INITQUAL 4
  13. #define EN_SOURCEQUAL 5
  14. #define EN_SOURCEPAT 6
  15. #define EN_SOURCETYPE 7
  16. #define EN_TANKLEVEL 8
  17. #define EN_DEMAND 9
  18. #define EN_HEAD 10
  19. #define EN_PRESSURE 11
  20. #define EN_QUALITY 12
  21. #define EN_SOURCEMASS 13
  22. #define EN_INITVOLUME 14
  23. #define EN_MIXMODEL 15
  24. #define EN_MIXZONEVOL 16
  25.  
  26. #define EN_DIAMETER 0
  27. #define EN_LENGTH 1
  28. #define EN_ROUGHNESS 2
  29. #define EN_MINORLOSS 3
  30. #define EN_INITSTATUS 4
  31. #define EN_INITSETTING 5
  32. #define EN_KBULK 6
  33. #define EN_KWALL 7
  34. #define EN_FLOW 8
  35. #define EN_VELOCITY 9
  36. #define EN_HEADLOSS 10
  37. #define EN_STATUS 11
  38. #define EN_SETTING 12
  39. #define EN_ENERGY 13
  40.  
  41. #define EN_DURATION 0
  42. #define EN_HYDSTEP 1
  43. #define EN_QUALSTEP 2
  44. #define EN_PATTERNSTEP 3
  45. #define EN_PATTERNSTART 4
  46. #define EN_REPORTSTEP 5
  47. #define EN_REPORTSTART 6
  48. #define EN_RULESTEP 7
  49. #define EN_STATISTIC 8
  50. #define EN_PERIODS 9
  51.  
  52. #define EN_NODECOUNT 0
  53. #define EN_TANKCOUNT 1
  54. #define EN_LINKCOUNT 2
  55. #define EN_PATCOUNT 3
  56. #define EN_CURVECOUNT 4
  57. #define EN_CONTROLCOUNT 5
  58.  
  59. #define EN_JUNCTION 0
  60. #define EN_RESERVOIR 1
  61. #define EN_TANK 2
  62.  
  63. #define EN_CVPIPE 0
  64. #define EN_PIPE 1
  65. #define EN_PUMP 2
  66. #define EN_PRV 3
  67. #define EN_PSV 4
  68. #define EN_PBV 5
  69. #define EN_FCV 6
  70. #define EN_TCV 7
  71. #define EN_GPV 8
  72.  
  73. #define EN_NONE 0
  74. #define EN_CHEM 1
  75. #define EN_AGE 2
  76. #define EN_TRACE 3
  77.  
  78. #define EN_CONCEN 0
  79. #define EN_MASS 1
  80. #define EN_SETPOINT 2
  81. #define EN_FLOWPACED 3
  82.  
  83. #define EN_CFS 0
  84. #define EN_GPM 1
  85. #define EN_MGD 2
  86. #define EN_IMGD 3
  87. #define EN_AFD 4
  88. #define EN_LPS 5
  89. #define EN_LPM 6
  90. #define EN_MLD 7
  91. #define EN_CMH 8
  92. #define EN_CMD 9
  93.  
  94. #define EN_TRIALS 0
  95. #define EN_ACCURACY 1
  96. #define EN_TOLERANCE 2
  97. #define EN_EMITEXPON 3
  98. #define EN_DEMANDMULT 4
  99.  
  100. #define EN_LOWLEVEL 0
  101. #define EN_HILEVEL 1
  102. #define EN_TIMER 2
  103. #define EN_TIMEOFDAY 3
  104.  
  105. #define EN_AVERAGE 1
  106. #define EN_MINIMUM 2
  107. #define EN_MAXIMUM 3
  108. #define EN_RANGE 4
  109.  
  110. #define EN_NOSAVE 0
  111. #define EN_SAVE 1
  112.  
  113. #define EN_INITFLOW 10
  114.  
  115.  
  116. // --- Declare the EPANET toolkit functions
  117.  
  118. int DLLEXPORT ENepanet(char *, char *, char *, void (*) (char *));
  119. int DLLEXPORT ENopen(char *, char *, char *);
  120. int DLLEXPORT ENsaveinpfile(char *);
  121. int DLLEXPORT ENclose(void);
  122. int DLLEXPORT ENsolveH(void);
  123.  
  124. int DLLEXPORT ENsaveH(void);
  125. int DLLEXPORT ENopenH(void);
  126. int DLLEXPORT ENinitH(int);
  127. int DLLEXPORT ENrunH(long *);
  128. int DLLEXPORT ENnextH(long *);
  129. int DLLEXPORT ENcloseH(void);
  130. int DLLEXPORT ENsavehydfile(char *);
  131. int DLLEXPORT ENusehydfile(char *);
  132.  
  133. int DLLEXPORT ENsolveQ(void);
  134. int DLLEXPORT ENopenQ(void);
  135. int DLLEXPORT ENinitQ(int);
  136. int DLLEXPORT ENrunQ(long *);
  137. int DLLEXPORT ENnextQ(long *);
  138. int DLLEXPORT ENstepQ(long *);
  139. int DLLEXPORT ENcloseQ(void);
  140.  
  141. int DLLEXPORT ENwriteline(char *);
  142. int DLLEXPORT ENreport(void);
  143. int DLLEXPORT ENresetreport(void);
  144. int DLLEXPORT ENsetreport(char *);
  145.  
  146. int DLLEXPORT ENgetcontrol(int, int *, int *, float *,
  147. int *, float *);
  148. int DLLEXPORT ENgetcount(int, int *);
  149. int DLLEXPORT ENgetoption(int, float *);
  150. int DLLEXPORT ENgettimeparam(int, long *);
  151. int DLLEXPORT ENgetflowunits(int *);
  152. int DLLEXPORT ENgetpatternindex(char *, int *);
  153. int DLLEXPORT ENgetpatternid(int, char *);
  154. int DLLEXPORT ENgetpatternlen(int, int *);
  155. int DLLEXPORT ENgetpatternvalue(int, int, float *);
  156. int DLLEXPORT ENgetqualtype(int *, int *);
  157. int DLLEXPORT ENgeterror(int, char *, int);
  158.  
  159. int DLLEXPORT ENgetnodeindex(char *, int *);
  160. int DLLEXPORT ENgetnodeid(int, char *);
  161. int DLLEXPORT ENgetnodetype(int, int *);
  162. int DLLEXPORT ENgetnodevalue(int, int, float *);
  163. int DLLEXPORT ENgetlinkindex(char *, int *);
  164. int DLLEXPORT ENgetlinkid(int, char *);
  165. int DLLEXPORT ENgetlinktype(int, int *);
  166. int DLLEXPORT ENgetlinknodes(int, int *, int *);
  167. int DLLEXPORT ENgetlinkvalue(int, int, float *);
  168.  
  169. int DLLEXPORT ENgetversion(int *);
  170.  
  171. int DLLEXPORT ENsetcontrol(int, int, int, float, int, float);
  172. int DLLEXPORT ENsetnodevalue(int, int, float);
  173. int DLLEXPORT ENsetlinkvalue(int, int, float);
  174. int DLLEXPORT ENsetpattern(int, float *, int);
  175. int DLLEXPORT ENsetpatternvalue(int, int, float);
  176. int DLLEXPORT ENsettimeparam(int, long);
  177. int DLLEXPORT ENsetoption(int, float);
  178. int DLLEXPORT ENsetstatusreport(int);
  179. int DLLEXPORT ENsetqualtype(int, char *, char *, char *);

When I debug the program, there are only ignorable warning messages like:
Possible problem detected while building assembly 'Kalibrasyon': Referenced assembly 'mscorlib.dll' targets a different processor
Possible problem detected while building assembly 'Kalibrasyon': Referenced assembly 'System.Data.dll' targets a different processor

Is this the reason? Codes ran well on x86 debug. Where is the problem? Any idea will be appreciable.

Thanks
Last edited by cscgal; Oct 14th, 2008 at 6:46 pm. Reason: Added code tags
Reputation Points: 10
Solved Threads: 0
Newbie Poster
padawan is offline Offline
2 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: postfix evaluation problem
Next Thread in C++ Forum Timeline: Help with reading bitmap





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC