I'm writing my own program which uses Half-Life client and server DLLs.

I started with loading client.dll and call Initialize function passing
pointer to cl_enginefunc_s filled completely with zeros and then I
call HUD_Init.

Then I watched where does client.dll crash trying to call engine
funcs, and I started implementing these funcs in my program one by
one... These funcs are now implemented:

pfnHookUserMsg - stub, returns 0
pfnHookEvent - stub, returns 0
GetClientTime - implemented, returns time since program startup
pfnAddCommand - stub, returns 0
pfnRegisterVariable - implemented, addt new crar_s to list and returns
pointer to it
CheckParm - stub, returns 0
Con_DPrintf - implemented, prints to log file
pfnGetCvarPointer - implemented, looks for cvar_s in the list
pfnGetGameDirectory - implemented, returns FULL path to my "mod" directory :)
pfnGetScreenInfo - implemented as:

int CLEF_GetScreenInfo( SCREENINFO *pscrinfo )
{
        pscrinfo->iWidth = 1024;
        pscrinfo->iHeight = 768;
        pscrinfo->iSize = 1;
        pscrinfo->iFlags = 0;
        pscrinfo->iCharHeight = 1;
        for ( int i = 0; i < 256; i++ )
                pscrinfo->charWidths[i] = 1;
        return 1;
}

pfnSPR_GetList - implemented, loads sprite list from my mod or valve directory
pfnSPR_Load - stub, returns 1
COM_LoadFile - implemented, reads whole file to buffer
COM_FreeFile - implemented, frees the passed buffer

My program crashes in voice_status.cpp CVoiceStatus::Init on line 220:

pLabel->m_pBackground = new Label("");

It seems like stack going corrupted here because debugger then shows
like program crashed in status_icons.cpp CHudStatusIcon::Init on line
38:

return 1;

The program most likely crashes somewhere in vgui.dll. Do I need
perform any initialization of VGUI before loading client?

I'm using Half-Life SDK 2.3 and Half-Life 1.1.2.0

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to