|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
[C/C++]problema msvcr90d.dll
provo a spiegarvi senza stampare il codice
ho esteso una semplicissima applicazione win32 con una funzione di render in pratica il loop dei messaggi prima era un ciclo GetMessage, ora contiene il PeekMessage che non appena restituisce il controllo al programma nel caso non abbia trovato nulla nella coda messaggi richiama la funzione render() nella quale le uniche funzioni d3d9 usate dei relativi device sono : Clear e Present(e la funzione di cleanup Release dopo essere uscito dal ciclo in seguito ad un messaggio WM_QUIT) appena ho implementato questa funzione la compilazione va a buon fine ma appena tento di eseguire l'applicazione mi da errore di DLL non trovata >.> la dll esatta e' : Codice:
msvcr90d.dll il compilatore che uso e' Visual Studio 2008 grazie in anticipo ^_^ Ultima modifica di m.distrutti : 31-03-2008 alle 22:35. |
|
|
|
|
|
#2 |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
scusate l'up
ma sono bloccato ancora in questo programma Q_Q vi riporto il codice cmq magari provate a eseguirlo voi :S(con directX 9.0 sdk installate pero) non capisco proprio :S se dovessi provare a cambiare ed interfacciarmi alle librerie in C# quella dll viene richiamata lo stesso vero? Codice:
#include <windows.h>
#include <d3d9.h>
//header
bool initWindow(HINSTANCE hInstance);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
bool initDirect3D(void);
void render(void);
void cleanUp(void);
//global variables
HINSTANCE hInst;
HWND wndHandle;
//variables
LPDIRECT3D9 pD3D; //the Direct3D object
LPDIRECT3DDEVICE9 pd3dDevice;//the Direct3D device
/*...Entry Point Application...*/
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow){
//body of window form
if(!initWindow(hInstance)){
return false;
}
if(!initDirect3D())//this function creates a direct3D object & device
return false;
MSG msg;
ZeroMemory(&msg, sizeof(msg));
while(true){
if(PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE)){
if(msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}else//if there is no message render all
render();
}
cleanUp();
return (int) msg.wParam;
}
bool initWindow(HINSTANCE hInstance){
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = 0;
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = TEXT("DirectXExample");
wcex.hIconSm = 0;
RegisterClassEx(&wcex);
wndHandle = CreateWindow(TEXT("DirectXExample"),
TEXT("DirectXExample"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
640,
480,
NULL,
NULL,
hInstance,
NULL);
if(!wndHandle)
return false;
//Display the window on the Screen
ShowWindow(wndHandle, SW_SHOW);
UpdateWindow(wndHandle);
return true;
}
//window procedure
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message){
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
bool initDirect3D(void){
pD3D = NULL;
pd3dDevice = NULL;
if((pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL)
return false;
//fill the presentation parametre structure
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.BackBufferCount = 1;
d3dpp.BackBufferHeight = 480;
d3dpp.BackBufferWidth = 640;
d3dpp.hDeviceWindow = wndHandle;
if(FAILED( pD3D->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_REF,
wndHandle,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&pd3dDevice)))
return false;
return true;
}
void render (void){
//check to make sure you have a valid Direct3D device
if(pd3dDevice == NULL)
return;
//clear the back buffer to a blue color and presents it into the main screen
pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 255), 1.0f, 0);
pd3dDevice->Present(NULL, NULL, NULL, NULL);
}
void cleanUp(void){
//Release the device and the Direct3D object
if(pd3dDevice != NULL)
pd3dDevice->Release();
if(pD3D != NULL)
pD3D->Release();
}
|
|
|
|
|
|
#4 | |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
Quote:
riporta degli errori durante il Link(la compilazione sempre corretta) Codice:
------ Build started: Project: winF, Configuration: Release Win32 ------ Linking... winmain.obj : error LNK2001: unresolved external symbol _Direct3DCreate9@4 C:\Documents and Settings\Kayne\Documenti\Visual Studio 2008\Projects\Project1\Project1\winF\Release\winF.exe : fatal error LNK1120: 1 unresolved externals Build log was saved at "file://c:\Documents and Settings\Kayne\Documenti\Visual Studio 2008\Projects\Project1\Project1\winF\winF\Release\BuildLog.htm" winF - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
|
|
|
|
|
|
#5 |
|
Member
Iscritto dal: Apr 2007
Messaggi: 263
|
Si, dovrebbe essere la dll di runtime(debug) di visual c++ 9 (2008)
|
|
|
|
|
|
#7 |
|
Member
Iscritto dal: Apr 2007
Messaggi: 263
|
|
|
|
|
|
|
#8 |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
appena fatto ma non funziona, la dll esiste nelle sottodir
di VS \VC\cl\dll\<in tutte le sotto dir di questa directory> e di Windows \WINDOWS\WinSxS\<nelle cartelle di Debug CRT> >_<' EDIT:ho riprovato nelle due compilazioni con la dll nella stessa dir ma nulla... Ultima modifica di m.distrutti : 05-04-2008 alle 12:45. |
|
|
|
|
|
#9 |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
|
|
|
|
|
|
#10 |
|
Member
Iscritto dal: Apr 2007
Messaggi: 263
|
Copiala sotto C:\windows\system32\
|
|
|
|
|
|
#11 |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
|
|
|
|
|
|
#12 |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
no adesso e' identico al precedente errore postato io non ci sto piu capendo nulla >_<'
|
|
|
|
|
|
#13 | |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
Quote:
Codice:
not found or not built by the last incremental link; performing full link |
|
|
|
|
|
|
#14 |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
sta facendo di tutto per non farmi usare le librerie sto compilatore
|
|
|
|
|
|
#15 |
|
Member
Iscritto dal: Sep 2007
Messaggi: 207
|
disinstallo il compilatore che metto il 2005, cosi ho la scusa di mettere XNA >.>'
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 07:54.



















