|
-
Jul 13th, 2001, 07:48 AM
#1
Thread Starter
Member
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
-
Jul 13th, 2001, 07:54 AM
#2
Addicted Member
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...
-
Jul 13th, 2001, 08:09 AM
#3
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|