Click here to Skip to main content
15,907,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to connect mysql database with mfc? Pin
valikac21-May-04 7:03
valikac21-May-04 7:03 
AnswerRe: how to connect mysql database with mfc? Pin
BlackDice21-May-04 7:33
BlackDice21-May-04 7:33 
GeneralRe: how to connect mysql database with mfc? Pin
Chooikw21-May-04 11:11
Chooikw21-May-04 11:11 
GeneralRe: how to connect mysql database with mfc? Pin
BlackDice21-May-04 11:46
BlackDice21-May-04 11:46 
GeneralRe: how to connect mysql database with mfc? Pin
Chooikw22-May-04 3:47
Chooikw22-May-04 3:47 
GeneralSerializing the valarray class(STL) Pin
Cyberizen21-May-04 3:49
Cyberizen21-May-04 3:49 
GeneralFrames in DHTML ED control Pin
Member 52815521-May-04 3:27
Member 52815521-May-04 3:27 
GeneralProblem with ListView API : LVM_ISERTITEM Pin
ravjak21-May-04 2:51
ravjak21-May-04 2:51 
"Hi I'm developing dll which will do some changing stuff with ListView. I have a funny problem I want to change value of iImage in a LV_ITEM according to pszText value. Problem occurs when I want to test value of pszText, exception ouccrs Access Violation 0xC0000005 Frown | :( But I'm testing if pitem and pitem->pszText are not null even if I tryed to use strdup(pitem->pszText) the same exception occurs. There is no problem when I tryed to change value of iItem. Is is somehow connected witch injection dll into some application ?? and its address space ??
"

<br />
(WNDPROC) gfnListProc;<br />
//in some previous called function<br />
gfnListProc = (WNDPROC)SetWindowLong(listview, GWL_WNDPROC,(LONG)ListProc);<br />
<br />
__declspec(dllexport) LRESULT CALLBACK ListProc(HWND hwnd, UINT uiMsg,WPARAM wParam, LPARAM lParam)<br />
{<br />
	<br />
	switch (uiMsg)<br />
	{<br />
		case LVM_INSERTITEM:<br />
			{<br />
				LV_ITEM FAR* pitem = (LV_ITEM FAR*) lParam;<br />
				if(pitem && pitem->pszText)<br />
						MessageBox(0, pitem->pszText,":-)",MB_OK);					<br />
				<br />
				break;<br />
			}<br />
	}<br />
	return CallWindowProc(gfnListProc, hwnd, uiMsg, wParam, lParam);<br />
}<br />
<br />
//from commctr.h<br />
<br />
typedef struct tagLVITEMW<br />
{<br />
    UINT mask;<br />
    int iItem;<br />
    int iSubItem;<br />
    UINT state;<br />
    UINT stateMask;<br />
    LPWSTR pszText;<br />
    int cchTextMax;<br />
    int iImage;<br />
    LPARAM lParam;<br />
#if (_WIN32_IE >= 0x0300)<br />
    int iIndent;<br />
#endif<br />
} LVITEMW, FAR* LPLVITEMW;<br />
<br />
<br />
#define ListView_InsertItem(hwnd, pitem)   \<br />
    (int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))<br />
<br />


Thaks for reading that stuff Smile | :)

Pain is a weakness living the body
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
Andrew Quinn AUS21-May-04 3:12
Andrew Quinn AUS21-May-04 3:12 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
ravjak21-May-04 3:14
ravjak21-May-04 3:14 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
bikram singh21-May-04 3:56
bikram singh21-May-04 3:56 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
ravjak21-May-04 4:18
ravjak21-May-04 4:18 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
bikram singh21-May-04 4:29
bikram singh21-May-04 4:29 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
jmkhael21-May-04 4:39
jmkhael21-May-04 4:39 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
ravjak21-May-04 4:53
ravjak21-May-04 4:53 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
jmkhael21-May-04 4:58
jmkhael21-May-04 4:58 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
ravjak21-May-04 6:14
ravjak21-May-04 6:14 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
ravjak21-May-04 6:30
ravjak21-May-04 6:30 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
jmkhael21-May-04 7:18
jmkhael21-May-04 7:18 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
ravjak22-May-04 2:29
ravjak22-May-04 2:29 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
bikram singh21-May-04 7:28
bikram singh21-May-04 7:28 
GeneralRe: Problem with ListView API : LVM_ISERTITEM Pin
ravjak22-May-04 2:33
ravjak22-May-04 2:33 
GeneralDisable shift key in pretranslate when shift key is pressed Pin
Member 52815521-May-04 2:48
Member 52815521-May-04 2:48 
GeneralRe: Disable shift key in pretranslate when shift key is pressed Pin
ravjak21-May-04 2:54
ravjak21-May-04 2:54 
GeneralCreateNamedPipe Pin
Anonymous21-May-04 2:31
Anonymous21-May-04 2:31 

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.