dll problems
This commit is contained in:
parent
01515a4d2d
commit
4cab44063d
|
@ -76,34 +76,59 @@ void SetStdOutToNewConsole()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
typedef Oyster::Graphics::API::State (*Init)(HWND Window, bool MSAA_Quality, bool Fullscreen, Oyster::Math::Float2 StartResulotion);
|
||||||
|
typedef struct tagLOADPARMS32 {
|
||||||
|
LPSTR lpEnvAddress; // address of environment strings
|
||||||
|
LPSTR lpCmdLine; // address of command line
|
||||||
|
LPSTR lpCmdShow; // how to show new program
|
||||||
|
DWORD dwReserved; // must be zero
|
||||||
|
} LOADPARMS32;
|
||||||
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
|
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
|
||||||
{
|
{
|
||||||
SetDllDirectory(L"..\\DLL\\");
|
wchar_t buff[255];
|
||||||
typedef struct tagLOADPARMS32 {
|
_wgetcwd(buff, 255);
|
||||||
LPSTR lpEnvAddress; // address of environment strings
|
BOOL success = SetDllDirectory(L"..\\..\\DLL");
|
||||||
LPSTR lpCmdLine; // address of command line
|
if (success == 0)
|
||||||
LPSTR lpCmdShow; // how to show new program
|
{
|
||||||
DWORD dwReserved; // must be zero
|
return 0;
|
||||||
} LOADPARMS32;
|
}
|
||||||
|
|
||||||
LOADPARMS32 p;
|
LOADPARMS32 p;
|
||||||
p.lpEnvAddress = "";
|
p.lpEnvAddress = "";
|
||||||
p.lpCmdLine = "";
|
p.lpCmdLine = "";
|
||||||
p.lpCmdShow = "";
|
p.lpCmdShow = "";
|
||||||
p.dwReserved = 0;
|
p.dwReserved = 0;
|
||||||
DWORD ret = 1;
|
DWORD ret = 1;
|
||||||
ret = LoadModule("OysterGraphics_x86D.dll", &p);
|
|
||||||
|
|
||||||
|
ret = LoadModule("OysterGraphics_x86D.dll", &p);
|
||||||
|
HMODULE temp = LoadLibrary(L"OysterGraphics_x86D.dll");
|
||||||
if( ret == 0)
|
if( ret == 0)
|
||||||
{
|
{
|
||||||
// error
|
// error
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = LoadModule("GameLogic_x86D.dll", &p);
|
ret = LoadModule("GameLogic_x86D.dll", &p);
|
||||||
if( ret == 0)
|
if( ret == 0)
|
||||||
{
|
{
|
||||||
// error
|
// error
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
//HINSTANCE hGetProcIDDLL = LoadLibrary(L"C:\\Users\\Linda Andersson\\Desktop\\spel\\git\\Bin\\DLL\\OysterGraphics_x86D.dll");
|
||||||
|
|
||||||
|
//if (hGetProcIDDLL == NULL) {
|
||||||
|
// std::cout << "could not load the dynamic library" << std::endl;
|
||||||
|
// return EXIT_FAILURE;
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//// resolve function address here
|
||||||
|
//Init funci = (Init)GetProcAddress(hGetProcIDDLL, "Oyster::Graphics::API::Init");
|
||||||
|
//if (!funci) {
|
||||||
|
// std::cout << "could not locate the function" << std::endl;
|
||||||
|
// return EXIT_FAILURE;
|
||||||
|
//}
|
||||||
|
|
||||||
if( FAILED( InitWindow( hInstance, nCmdShow ) ) )
|
if( FAILED( InitWindow( hInstance, nCmdShow ) ) )
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -120,6 +145,7 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdL
|
||||||
|
|
||||||
//debug window
|
//debug window
|
||||||
//SetStdOutToNewConsole();
|
//SetStdOutToNewConsole();
|
||||||
|
|
||||||
// Main message loop
|
// Main message loop
|
||||||
MSG msg = {0};
|
MSG msg = {0};
|
||||||
while(WM_QUIT != msg.message)
|
while(WM_QUIT != msg.message)
|
||||||
|
|
|
@ -195,6 +195,7 @@
|
||||||
<ClCompile Include="Player.cpp" />
|
<ClCompile Include="Player.cpp" />
|
||||||
<ClCompile Include="RefManager.cpp" />
|
<ClCompile Include="RefManager.cpp" />
|
||||||
<ClCompile Include="StaticObject.cpp" />
|
<ClCompile Include="StaticObject.cpp" />
|
||||||
|
<ClCompile Include="TestGLMain.cpp" />
|
||||||
<ClCompile Include="Weapon.cpp" />
|
<ClCompile Include="Weapon.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
|
|
@ -71,5 +71,8 @@
|
||||||
<ClCompile Include="RefManager.cpp">
|
<ClCompile Include="RefManager.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="TestGLMain.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue