ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Creating a Windows DLL with Visual Basic
Subject:   Showing forms within API DLL
Date:   2005-05-31 23:10:17
From:   ijwelch
Does anyone know how to show a form/use a class from within the windows dll created above?

Any attempt to dim (and use) a private class or form from within the dll generate a windows error.

add a form 'Form1' to the dll project

add this code to the dll module
Public Function ShowForm1() As Long
Dim f as New Form1
ShowForm1 = 1
End Function

add new line to DEF file
ShowForm1 @5

and compile dll

Any call to ShowForm1 method crashes vb/exe

If I add a public method to the empty class and call that method first then displaying form does not fail (but by then it's a com dll anyway and requires registering and adding to vb references).

Seems that 'something' is not being initialized in the windows dll to allow 'objects'.

1 to 2 of 2
  1. Showing forms within API DLL
    2005-08-01 03:49:36  Hossein.mohammadi [View]

  2. Showing forms within API DLL
    2005-07-08 07:03:14  JohnDrinkall [View]

    • Showing forms within API DLL
      2006-01-16 21:57:54  draftsman [View]

1 to 2 of 2