Results 1 to 3 of 3

Thread: Big Vb Problem

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2001
    Location
    belguim
    Posts
    61

    Unhappy Big Vb Problem

    if i create a function in a Actieve dll (not related to the truevision engine)
    then i have a problem
    the problem will be in the in this line :
    Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL, FrmMain.Hwnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,D3DWindow

    If i compile the dll and use it into a project then the FrmMain.Hwnd dosnt work cause the dll have no forms so how can i call it into the dll to use a project sort of that please help me out

    :-)
    here is the source
    ------------------------------------
    Public Function Initialise() as Boolean
    On Error Goto ErrHandler:

    Dim DispMode As D3DDISPLAYMODE
    Dim D3DWindow as D3DPRESENT_DEFAULT,DispMode

    Set Dx = New Directx8
    Set D3D = Dx.Direct3DCreate()

    D3D.GetAdapterDisplayMode D3DSWAPEFFECT_COPY_VSYNC,DispMode

    D3DWindow.Windowed = 1
    D3DSwapEffect = D3DSWAPEFFECT_COPY_VSYC
    D3DWindow.BackBufferFormat = DispMode.Format

    Set D3DDevice = D3D.CreateDevice_(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,_ FrmMain.Hwnd,D3DCREATE_SOFTWARE_VERTEXPROCESS_ING,D3DWindow
    Initialise = True
    Exit Function
    ErrHandler:
    Initialise = False
    End Function

  2. #2
    Addicted Member
    Join Date
    Apr 2000
    Location
    England
    Posts
    246
    Code:
    Public Function InitialiseA(byVal Hwnd as long) as Boolean 
    On Error Goto ErrHandler: 
    
    Dim DispMode As D3DDISPLAYMODE 
    Dim D3DWindow as D3DPRESENT_DEFAULT,DispMode 
    
    Set Dx = New Directx8 
    Set D3D = Dx.Direct3DCreate() 
    
    D3D.GetAdapterDisplayMode D3DSWAPEFFECT_COPY_VSYNC,DispMode 
    
    D3DWindow.Windowed = 1 
    D3DSwapEffect = D3DSWAPEFFECT_COPY_VSYC 
    D3DWindow.BackBufferFormat = DispMode.Format 
    
    Set D3DDevice = D3D.CreateDevice_(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,_ Hwnd,D3DCREATE_SOFTWARE_VERTEXPROCESS_ING,D3DWindow 
    InitialiseA = True 
    Exit Function 
    ErrHandler: 
    InitialiseA = False 
    End Function
    When your program calls this, pass the Hwnd of the form they want to use.
    Some Days, i just get this feeling that i'm helping to write dozens of Viruses...

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2001
    Location
    belguim
    Posts
    61

    Yes but it is a direct x function

    like there is FrmMain.hwnd

    and if my form is the name test
    how can a get that then

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