|
-
Jul 13th, 2001, 07:49 AM
#1
Thread Starter
Member
DirectX 8.0 Problem
if i create a function in a Actieve dll (Its for my 3d 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, 09:32 AM
#2
Change the first line to "Public Function Initialise(hWnd as Long) as Boolean". Then, when you call it, pass whatever project's hWnd Property to the function. In your problem line, just change "FrmMain.Hwnd" to "hWnd". Then, everything should work fine.
Z.
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
|