Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB6.exe Application Error caused by using DLL

VB6.exe Application Error caused by using DLL

Scheduled Pinned Locked Moved Visual Basic
c++helpvisual-studiodata-structures
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SanShou
    wrote on last edited by
    #1

    My problem is both simple and complex... I am writing an RS232 protocol layer that was meant for Visual C++, however now the boss man wants me to integrate it in to Visual Basic. So I decided to convert the static library to a DLL. Everything seems to work fine, and from the outside the IDE all the visual basic apps run well. However inside the IDE, after running, the VB IDE has many problems. On my machine it only causes an application error on exit. On others, it causes application errors at random times. I thought maybe I was trashing the stack, but my DLL is not doing it. I am thinking it is the arguement passing... These are my definitions in the DLL.. [code] #define INCOMMSTACK_API extern "C" INCOMMSTACK_API long WINAPI Initialize (long lHwndOwner); INCOMMSTACK_API long WINAPI ExpediteMessageByte (LPBYTE pbMsg, DWORD cBytes); INCOMMSTACK_API long WINAPI ExpediteMessageText (LPCTSTR szMsg, DWORD cChars); INCOMMSTACK_API long WINAPI SendMessageByte (LPBYTE pbMsg, DWORD cBytes); INCOMMSTACK_API long WINAPI SendMessageText (LPCTSTR szMsg, DWORD cChars); INCOMMSTACK_API long WINAPI SetRetryCount (DWORD dwRetryCount); INCOMMSTACK_API long WINAPI SetTimeout (DWORD dwTimeout); INCOMMSTACK_API long WINAPI SetProtocol (DWORD dwProtocol); INCOMMSTACK_API long WINAPI ConnectRS232 (int iCommPort, int iBaudRate); INCOMMSTACK_API long WINAPI ConnectUDP (LPCTSTR szAddress, int iPort); INCOMMSTACK_API long WINAPI CloseConnection (); INCOMMSTACK_API long WINAPI GetReceivedMessage (LPBYTE pbByte, DWORD cBytes, DWORD wParam, long lParam); [/code] and these are the declaration in VB... [code] Private Declare Function CreateWindowEx _ Lib "user32" Alias "CreateWindowExA" _ (ByVal dwExStyle As Long, _ ByVal lpClassName As String, _ ByVal lpWindowName As String, _ ByVal dwStyle As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal nWidht As Long, _ ByVal nHeight As Long, _ ByVal hWndParent As Long, _ ByVal hMenu As Long, _ ByVal hInstance As Long, _ lpParam As Any) As Long Public Const GWL_WNDPROC = (-4) Public Declare Function SetWindowLongApi _ Lib "user32" Alias "SetWindowLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Public Declare Functio

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups