Click here to Skip to main content
15,886,110 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: why CListCtl::InsertItem() would crash? Pin
kcynic26-Dec-07 14:22
kcynic26-Dec-07 14:22 
AnswerRe: why CListCtl::InsertItem() would crash? Pin
peterchen26-Dec-07 0:02
peterchen26-Dec-07 0:02 
GeneralRe: why CListCtl::InsertItem() would crash? Pin
kcynic26-Dec-07 14:26
kcynic26-Dec-07 14:26 
QuestionGDI+ Set Image DPI (win32) Pin
r3dqu33n25-Dec-07 16:22
r3dqu33n25-Dec-07 16:22 
GeneralRe: GDI+ Set Image DPI (win32) Pin
followait25-Dec-07 17:48
followait25-Dec-07 17:48 
GeneralDesktop_.ini file is getting created in InstallShield Pin
AnayKulkarni25-Dec-07 3:11
AnayKulkarni25-Dec-07 3:11 
GeneralRe: Desktop_.ini file is getting created in InstallShield Pin
Kiran Pinjala26-Dec-07 1:38
Kiran Pinjala26-Dec-07 1:38 
GeneralError in MD5Init() Function Pin
Developer61124-Dec-07 23:40
Developer61124-Dec-07 23:40 
Hi there .

I can't call MD5Init() function. in fact i can't initialize MD5 message digest context .

here is my code :
#include <windows.h><br />
<br />
// Declare pattern of function implementation<br />
<br />
int __stdcall		WinMain(HINSTANCE, HINSTANCE, LPSTR, int);<br />
int __stdcall		WndProc(HWND, UINT, WPARAM, LPARAM);<br />
CCoding				clsCoding;<br />
<br />
//<br />
// MD5 structure information<br />
//<br />
typedef struct {<br />
	ULONG i[2];<br />
	ULONG buf[4];<br />
	unsigned char in[64];<br />
	unsigned char digest[16];<br />
} MD5_CTX;<br />
<br />
//<br />
// The MD5Init function initializes an MD5 message digest context.<br />
//<br />
typedef void		(*MD5Init)(MD5_CTX*);<br />
<br />
//<br />
// The MD5Update function updates the MD5 context by using the supplied buffer for the message whose MD5 digest is being generated<br />
//<br />
typedef void		(*MD5Update)(MD5_CTX*, unsigned char* input, unsigned int inlen);<br />
<br />
//<br />
// The MD5Final function ends an MD5 message digest previously started by a call to the MD5Init function<br />
//<br />
typedef	void		(*MD5Final)(MD5_CTX);<br />
// ==============================<br />
<br />
int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)<br />
{<br />
	//<br />
	// Handle to the dll file <br />
	//<br />
	HINSTANCE hinstLib;<br />
<br />
	// ===============================<br />
	// Declare variable of type def <br />
	//<br />
	MD5Init InitializeMD5;<br />
	MD5Update UpdateMD5;<br />
	MD5Final FinalizeMD5;<br />
<br />
	MD5_CTX md5Ctx;<br />
<br />
	// ==============================<br />
<br />
<br />
	hinstLib = LoadLibrary(L"Cryptdll.Dll");<br />
<br />
	// If the handle is valid try to get function address<br />
<br />
	if (hinstLib != NULL)<br />
	{<br />
		InitializeMD5 = (MD5Init) GetProcAddress(hinstLib, ("MD5Init"));<br />
		UpdateMD5 = (MD5Update) GetProcAddress(hinstLib, ("MD5Update"));<br />
		FinalizeMD5 = (MD5Final) GetProcAddress(hinstLib, ("MD5Final"));<br />
<br />
		// If the function address is valid try call function<br />
		if (InitializeMD5 != NULL)<br />
		{	<br />
			(InitializeMD5)(&md5Ctx);<br />
			(UpdateMD5)(&md5Ctx,(unsigned char*) md5Ctx.in, 10);<br />
			(FinalizeMD5)(md5Ctx);<br />
		}<br />
	}<br />
<br />
	DialogBox(hInstance, MAKEINTRESOURCE(IDD_FORMMAIN), NULL, WndProc);<br />
	return 0;<br />
}</windows.h>


Error :
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

Where is the problem ?

DMASTER

GeneralRe: Error in MD5Init() Function Pin
CPallini25-Dec-07 3:21
mveCPallini25-Dec-07 3:21 
GeneralRe: Error in MD5Init() Function Pin
Developer61126-Dec-07 0:48
Developer61126-Dec-07 0:48 
QuestionHow to search a Subitem in list control? Pin
Rad.Krish24-Dec-07 23:32
Rad.Krish24-Dec-07 23:32 
GeneralRe: How to search a Subitem in list control? Pin
CPallini25-Dec-07 2:55
mveCPallini25-Dec-07 2:55 
GeneralLarge File Processing Pin
Sangeetha_J24-Dec-07 23:10
Sangeetha_J24-Dec-07 23:10 
GeneralRe: Large File Processing Pin
CPallini24-Dec-07 23:39
mveCPallini24-Dec-07 23:39 
GeneralRe: Large File Processing Pin
Sangeetha_J24-Dec-07 23:54
Sangeetha_J24-Dec-07 23:54 
GeneralRe: Large File Processing Pin
CPallini25-Dec-07 2:43
mveCPallini25-Dec-07 2:43 
GeneralRe: Large File Processing Pin
Sangeetha_J25-Dec-07 16:34
Sangeetha_J25-Dec-07 16:34 
GeneralRe: Large File Processing Pin
kagdizuber26-Dec-07 5:23
kagdizuber26-Dec-07 5:23 
GeneralRe: Large File Processing Pin
Sangeetha_J26-Dec-07 17:18
Sangeetha_J26-Dec-07 17:18 
QuestionWhat about the efficency of DrawImage and coordinate transformation in GDI+ [modified] Pin
followait24-Dec-07 19:39
followait24-Dec-07 19:39 
QuestionDLLs for MFC Activex Controll Pin
manish.patel24-Dec-07 18:39
manish.patel24-Dec-07 18:39 
GeneralRe: DLLs for MFC Activex Controll Pin
_AnsHUMAN_ 24-Dec-07 20:48
_AnsHUMAN_ 24-Dec-07 20:48 
GeneralRe: DLLs for MFC Activex Controll Pin
manish.patel24-Dec-07 20:52
manish.patel24-Dec-07 20:52 
GeneralRe: DLLs for MFC Activex Controll Pin
_AnsHUMAN_ 24-Dec-07 20:54
_AnsHUMAN_ 24-Dec-07 20:54 
QuestionHow to use GetBitmapBits( ) correctly Pin
Chen-XuNuo24-Dec-07 17:20
Chen-XuNuo24-Dec-07 17:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.