Click here to Skip to main content
15,901,914 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMail Server Project Pin
saood swar7-Jul-05 2:29
saood swar7-Jul-05 2:29 
GeneralRe: Mail Server Project Pin
ThatsAlok7-Jul-05 2:40
ThatsAlok7-Jul-05 2:40 
GeneralRe: Mail Server Project Pin
saood swar7-Jul-05 3:27
saood swar7-Jul-05 3:27 
GeneralRe: Mail Server Project Pin
Ravi Bhavnani7-Jul-05 10:36
professionalRavi Bhavnani7-Jul-05 10:36 
GeneralMSXML ( HELP ) Pin
Anonymous7-Jul-05 2:16
Anonymous7-Jul-05 2:16 
GeneralSorting and searching a CSV file Pin
Sree_india7-Jul-05 0:55
Sree_india7-Jul-05 0:55 
GeneralRe: Sorting and searching a CSV file Pin
Christian Graus7-Jul-05 1:54
protectorChristian Graus7-Jul-05 1:54 
GeneralCall function via inline assembler Pin
georg waechter7-Jul-05 0:49
georg waechter7-Jul-05 0:49 
Hello,

i am currently trying to call a C++ function from inline assembler code. This works fine. But I habe a problem with getting the return value of the called function.

Here my code:
float func(float h)<br />
{<br />
   std::cout << h;<br />
   return 78.0f;<br />
}<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
   float par = 67.5f;<br />
   int adr = reinterpret_cast<int>(&func);<br />
   _asm<br />
   {<br />
      push par;   // Paramter pushen<br />
      call adr;   // Funktion aufrufen<br />
      add esp, 4; // Stackzeiger verschieben<br />
      mov par, eax;  // Returnwert aus eax Register in Variable<br />
   }<br />
<br />
   std::cout << par;<br />
   std::cin.get();<br />
   return 0;<br />
}<br />


Normally par should store 78.0f now. But that's not the case.
Somebody is seeing my fault?

Thanks
Georg
GeneralRe: Call function via inline assembler Pin
Trollslayer7-Jul-05 1:24
mentorTrollslayer7-Jul-05 1:24 
GeneralRe: Call function via inline assembler Pin
georg waechter7-Jul-05 1:53
georg waechter7-Jul-05 1:53 
QuestionCan a DLL is built by VB 6.0 use in VC 6.0? Pin
Member 21004816-Jul-05 22:59
Member 21004816-Jul-05 22:59 
AnswerRe: Can a DLL is built by VB 6.0 use in VC 6.0? Pin
Michael P Butler6-Jul-05 23:34
Michael P Butler6-Jul-05 23:34 
GeneralUser Breakpoint called from code Pin
micutzu6-Jul-05 22:10
micutzu6-Jul-05 22:10 
GeneralRe: User Breakpoint called from code Pin
lfrequency6-Jul-05 22:18
lfrequency6-Jul-05 22:18 
GeneralRe: User Breakpoint called from code Pin
Atul Dwivedi6-Jul-05 23:03
Atul Dwivedi6-Jul-05 23:03 
GeneralRe: User Breakpoint called from code Pin
ThatsAlok6-Jul-05 23:54
ThatsAlok6-Jul-05 23:54 
GeneralRe: User Breakpoint called from code Pin
micutzu7-Jul-05 0:14
micutzu7-Jul-05 0:14 
GeneralRe: User Breakpoint called from code Pin
ThatsAlok7-Jul-05 0:17
ThatsAlok7-Jul-05 0:17 
GeneralRe: User Breakpoint called from code Pin
micutzu7-Jul-05 0:34
micutzu7-Jul-05 0:34 
GeneralRe: User Breakpoint called from code Pin
Ravi Bhavnani7-Jul-05 10:40
professionalRavi Bhavnani7-Jul-05 10:40 
GeneralRe: User Breakpoint called from code Pin
Blake V. Miller7-Jul-05 16:41
Blake V. Miller7-Jul-05 16:41 
GeneralRe: User Breakpoint called from code Pin
Anonimous010121-Sep-05 22:35
sussAnonimous010121-Sep-05 22:35 
GeneralRe: User Breakpoint called from code Pin
micutzu21-Sep-05 22:45
micutzu21-Sep-05 22:45 
GeneralScroll bars in CWnd derived classes Pin
lfrequency6-Jul-05 22:02
lfrequency6-Jul-05 22:02 
GeneralRe: Scroll bars in CWnd derived classes Pin
Budric B.7-Jul-05 4:00
Budric B.7-Jul-05 4:00 

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.