home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4169 < prev    next >
Encoding:
Text File  |  1992-12-11  |  1.5 KB  |  42 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!demos!news-server
  3. From:  Fyodor@msoft.msk.su (Fyodor Zubanov)
  4. Subject: Re: VB calling DLL function returning void*
  5. Date: Wed, 9 Dec 1992 17:18:32 GMT
  6. Reply-To: Fyodor@msoft.msk.su
  7. Organization: Microsoft Moscow
  8. Sender: news-server@kremvax.hq.demos.su
  9. Message-ID: <AAefY9hm-8@msoft.msk.su>
  10. Lines: 30
  11.  
  12. >   Okay all you experts!  Has anyone done this?  I need to know how to
  13. >   correctly DECLARE the dll function.  Right now we get a protection
  14. >   violation on the call.  We've tested the dll with a C program, and it
  15. >   works just fine.
  16. >
  17. Of course the best thing to me is to have function prototype.
  18. But right now i can say that this error happens as usual
  19. after wrong type declaration. Suppose that the following
  20. table will help you:
  21. type of           C          VBasic
  22. parameter        int         integer
  23.                  uint        integer
  24.                  WORD        integer
  25.                  LONG        long
  26.                  LPSTR       string
  27.  
  28. Be careful and do not use char type in your function. This will
  29. cause an error too. Do not forget to pass parameters by value.
  30. And be careful with function type declaration. If you function
  31. returns void you should declare it as Sub.
  32.  
  33. Hope this can help you.
  34. Fyodor.
  35.  
  36. -- 
  37. =================================================================
  38.         Fyodor Zubanov          fyodor@msoft.msk.su
  39.         Moscow, Russia
  40. =================================================================
  41.  
  42.