Results 1 to 3 of 3

Thread: Problem: Wrong expression return??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    Posts
    130
    Goodday everybody...

    Igot another problem, which is very weird to me...
    Well, I created a DLL using VB. In the DLL, there's one expression statement, which is in a loop and I wanted to run the loop until the expression is FALSE. When I link the DLL with a VB written program, it run ok, meaning the expression will give the right value when tested. But when I link the DLL using VC++ written program, the expression always return TRUE even when it's suppose to be FALSE.

    All I want to ask is... What really happen in the DLL code? Why can't it test the expression correctly? And how do I solve it?

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Well, post the loop with the expression so we can see what's wrong.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    Posts
    130
    well this is the loop part of the program:

    Do
    sFileLine = f.ReadLine
    sTextLine = Left(sFileLine, 9)
    Loop While (sDBName <> sTextLine)

    NOTE: sDBName is a string parameter received from calling statement. sFileLine is a line read from a text file.

    For the expression (sDBName <> sTextLine), it always return TRUE even when both values are the same. That why I can't get out of the loop.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width