Results 1 to 4 of 4

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
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Im waiting for a Guru to jump in here.....

    But I think this might be a case of the difference in the Boolean representation of TRUE and FALSE between VB and C++?
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662
    Since i don't have vc++ i can't be certain. Why not try having the dll return the integer data type (instead of boolean) and set it up like this:

    If the expression is true then return 1
    Otherwise return 0

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    Posts
    130
    That's the problem, agent.
    The expression always return TRUE even though it's FALSE.

    Thanks to both of you guys, anyway.

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