Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIs PnP Device ID unique Pin
champ2328-Apr-11 2:42
champ2328-Apr-11 2:42 
AnswerRe: Is PnP Device ID unique Pin
Hans Dietrich28-Apr-11 4:12
mentorHans Dietrich28-Apr-11 4:12 
QuestionBitmap in List control Pin
Anu_Bala28-Apr-11 0:28
Anu_Bala28-Apr-11 0:28 
QuestionRe: Bitmap in List control Pin
David Crow28-Apr-11 3:16
David Crow28-Apr-11 3:16 
QuestionC++ program and my __asm Pin
francesco.s27-Apr-11 23:51
francesco.s27-Apr-11 23:51 
AnswerRe: C++ program and my __asm Pin
Richard MacCutchan28-Apr-11 1:27
mveRichard MacCutchan28-Apr-11 1:27 
AnswerRe: C++ program and my __asm Pin
Hans Dietrich28-Apr-11 7:12
mentorHans Dietrich28-Apr-11 7:12 
AnswerRe: C++ program and my __asm Pin
Andrew Phillips30-Apr-11 4:49
Andrew Phillips30-Apr-11 4:49 
There are several issues here:

a. As already mentioned there is no point in using inline assembler for a function call. Inline assembler is occasionally (but very rarely nowadays) used for efficiency or for doing some low-level hardware things. But even if you have to use assmebler for something you can move results to local variable(s) for passing to functions in normal C/C++ code.

b. You can't just do a "call" to an arbitrary memory location (as in your 1 and 2 examples). You have to use some sort of symbolic name so the linker can resolve the addres and the loader can adjust addresses when the program is run.

c. Your example 3 looks like it could work but I think you are pushing the parameters onto the stack in the wrong order.

d. Where does the code crash? I suspect in the call to WinExec but you can step through the code in the debugger to see exactly where it goes wrong. (Use Debug/Windows/Disassembly menu item to get the assembler code in the debugger.)

e. Check what registers you can use in an _asm {} block. I think eax is safe but you may have to save (ie push and later pop) others like ebp before using them.
Andrew Phillips
http://www.hexedit.com
andrew @ hexedit.com

QuestionHow to use the mysql in the child thread ? Pin
wangningyu27-Apr-11 21:42
wangningyu27-Apr-11 21:42 
AnswerRe: How to use the mysql in the child thread ? Pin
_AnsHUMAN_ 27-Apr-11 23:58
_AnsHUMAN_ 27-Apr-11 23:58 
QuestionHow do i get a InterlockedCompare ? Pin
cl_gamer27-Apr-11 15:52
cl_gamer27-Apr-11 15:52 
AnswerRe: How do i get a InterlockedCompare ? Pin
Luc Pattyn27-Apr-11 17:08
sitebuilderLuc Pattyn27-Apr-11 17:08 
QuestionHow to set EM_SETCUEBANNER in a Edit Control Pin
vishalgpt27-Apr-11 9:13
vishalgpt27-Apr-11 9:13 
AnswerRe: How to set EM_SETCUEBANNER in a Edit Control Pin
krmed27-Apr-11 9:47
krmed27-Apr-11 9:47 
GeneralRe: How to set EM_SETCUEBANNER in a Edit Control Pin
vishalgpt27-Apr-11 17:05
vishalgpt27-Apr-11 17:05 
AnswerRe: How to set EM_SETCUEBANNER in a Edit Control Pin
«_Superman_»28-Apr-11 0:08
professional«_Superman_»28-Apr-11 0:08 
GeneralRe: How to set EM_SETCUEBANNER in a Edit Control Pin
krmed28-Apr-11 3:36
krmed28-Apr-11 3:36 
QuestionSleep in Button Click Pin
varunpandeyengg27-Apr-11 0:20
varunpandeyengg27-Apr-11 0:20 
AnswerRe: Sleep in Button Click Pin
_AnsHUMAN_ 27-Apr-11 0:42
_AnsHUMAN_ 27-Apr-11 0:42 
GeneralRe: Sleep in Button Click Pin
varunpandeyengg27-Apr-11 1:19
varunpandeyengg27-Apr-11 1:19 
GeneralRe: Sleep in Button Click Pin
_AnsHUMAN_ 27-Apr-11 1:50
_AnsHUMAN_ 27-Apr-11 1:50 
GeneralRe: Sleep in Button Click Pin
varunpandeyengg27-Apr-11 1:56
varunpandeyengg27-Apr-11 1:56 
GeneralRe: Sleep in Button Click PinPopular
_AnsHUMAN_ 27-Apr-11 2:02
_AnsHUMAN_ 27-Apr-11 2:02 
GeneralRe: Sleep in Button Click Pin
Albert Holguin27-Apr-11 18:26
professionalAlbert Holguin27-Apr-11 18:26 
GeneralRe: Sleep in Button Click Pin
Albert Holguin27-Apr-11 18:25
professionalAlbert Holguin27-Apr-11 18:25 

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.