Results 1 to 4 of 4

Thread: Newly compiled DLL & VB

  1. #1
    Destined Soul
    Guest

    Newly compiled DLL & VB

    Hi everyone. I hope I have the right forum to put this in. This may seem like a simple question, but I'm not sure what's going on.

    When I recompile a DLL (using Bloodshed C++), but keep a VB project open that links to that DLL, VB crashes everytime I run the program again when it tries to call the DLL.

    My declaration to the DLL (in VB) is:
    VB Code:
    1. Private Declare Function MLCFn Lib "c:\test\transdll\transdll.dll" _
    2. Alias "TestOfReadFile@8" (ByVal a As String, ByVal i As Long) As Long
    Normally, it works fine if I've just opened VB after recompiling the DLL.

    Does anyone how to get around this problem? It's somewhat annoying to have to restart VB again. (I'm working on a P166..)

    Thanx in advance,

    Destined

  2. #2
    Fanatic Member
    Join Date
    Jan 2001
    Location
    Vietnam
    Posts
    613
    I haven't used Boloodshed C++ before. However, I think you have version conflict problem. Try to comfile the DLL and make sure it is binary compatibility. (ie. the same PROGID is kept)

    Regards.

  3. #3
    Destined Soul
    Guest
    I'm not sure how to check if the same PROGID is kept... How would I ensure that it's binary compatible? (I know that I have to use "__stdcall" when declaring the function that I'm accessing..)

    Destined

  4. #4
    Destined Soul
    Guest
    Just an update for anybody who might read this (ya, right!)... it seems that there was some serious memory leaks.. Half of the code I've been using was made by someone else - I put the 'loose' code into a general class. This seemed to have "fixed" the problem with running the DLL multiple times. (After much frustration, of course.)

    One last question - is there ANY way to manually load/unload a DLL in VB?

    Destined

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