CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Assembly
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Assembly Questions and Answers for Assembly here!

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old January 11th, 2005, 03:10 AM
    lepricaun's Avatar
    lepricaun lepricaun is offline
    Member
     
    Join Date: Sep 2004
    Location: The Netherlands
    Posts: 30
    lepricaun is on a distinguished road (10+)
    problem with lstrcmp (masm32)

    Hi all,

    i'm trying to get the following program to work, i need this option for a program i am writing, but it only works when i use the following line to read into the buffer:
    Code:
    invoke StdIn,addr buffer,4
    as soon as i change the '4' into a longer value it won't work anymore...

    is there a workaround for this?

    program:
    Code:
    .386 
    .model flat,stdcall
    option casemap:none
    
    include \masm32\include\windows.inc
    include \masm32\include\kernel32.inc
    include \masm32\include\user32.inc
    include \masm32\include\masm32.inc
    
    includelib \masm32\lib\kernel32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\masm32.lib
    
    .data
    
    string1 db "Enter: ",0
    string2 db 13,10,"equal",0
    string3 db 13,10,"not equal",0
    teststring db "exit",0
    test2 db "exit",0
    buffer db 50 dup (?)
    vier db "4",0
    .code
    
    start:
    
    invoke StdOut,addr string1
    invoke StdIn,addr buffer,6
    invoke lstrcmpA,addr test2,addr buffer
    .if eax==0
    invoke StdOut,addr string2
    invoke ExitProcess,0
    .endif
    invoke StdOut,addr string3
    invoke ExitProcess,0
    
    end start
    i've tried adding the ending [color=blue 13 and 10 (CR and LF)[/color] to the buffer and then it works. but this will not work for my program since i need to compare the userinput with the strings generated by the Process32Next API...

    piece of my real program code:
    Code:
    invoke Process32Next,[Snap],offset proc32
    
    ;if we have finished the last process listing
    ;------------------------------------------------------
    .if eax!=TRUE
    jmp again
    .endif
    ;------------------------------------------------------
    
    invoke lstrcmpA, addr ProcToKill,addr proc32.szExeFile
    .if eax == 0
    jmp contin
    .endif
    thanks in advance,
    __________________
    http://www.white-scorpion.nl
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Assembly


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 04:20 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009