Click here to Skip to main content
15,915,094 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Code for Hibernate and turn of monitor Pin
geo_m27-Jan-05 21:49
geo_m27-Jan-05 21:49 
Generalgamma Pin
viliam27-Jan-05 21:39
viliam27-Jan-05 21:39 
GeneralHelp to debug Error!! Pin
Anonymous27-Jan-05 21:13
Anonymous27-Jan-05 21:13 
GeneralRe: Help to debug Error!! Pin
James R. Twine28-Jan-05 2:44
James R. Twine28-Jan-05 2:44 
GeneralRe: Help to debug Error!! Pin
Anonymous28-Jan-05 13:43
Anonymous28-Jan-05 13:43 
GeneralRe: Help to debug Error!! Pin
James R. Twine28-Jan-05 13:55
James R. Twine28-Jan-05 13:55 
Generalpopulate list view in VB from VC++ dll using SendMessage Api Pin
Mohamed Jaffar Sagir27-Jan-05 21:05
Mohamed Jaffar Sagir27-Jan-05 21:05 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
S Douglas27-Jan-05 23:33
professionalS Douglas27-Jan-05 23:33 
I don’t know how much this will help or not but here is how I accomplished a similar task with a list box. This is a snippet of the real code, just for example sake.
<br />
CPP<br />
#define AddListText(hwnd, txt) \<br />
	( int )SendMessage( ( hwnd ), LB_ADDSTRING, 0, ( LPARAM ) (LPCTSTR) txt)<br />
<br />
<br />
void AddListString(long lhwnd, LPCTSTR sAdd)<br />
{<br />
	HWND hwnd = (HWND) lhwnd;<br />
	AddListText (hwnd, sAdd);<br />
}<br />
<br />
VB<br />
Private Declare Sub AddListString Lib "SCC_DLL.dll" (ByVal lhwnd As Long, ByVal sAdd As String)<br />
<br />
Private Sub cmdAddString_Click()<br />
Dim sText As String<br />
	sText = "Text"<br />
	AddListString List1.hWnd, sText<br />
End Sub<br />

In a few hours I will be in front of my workstation and be able to try something similar with a list view if yea like.



Mohamed Jaffar Sagir wrote:
Hi,

I am trying to insert items in VB List View control from VC++ dll using SendMessage API. its in the same process and even the handle of list view is proper. I am using this code.. but it does not insert the item ...

TCHAR msgString[512];
TCHAR tempString[128];
wsprintf(tempString, _TEXT(" MsgId: %03d "), message->buffer[8] );
_tcscpy(msgString, tempString );
_tcscat(msgString, _T("sadsadsdsad "));

LVITEMW LvItem;
LvItem.mask=LVIF_TEXT; // Text Style
LvItem.cchTextMax = 256; // Max size of test
LvItem.iItem=0; // choose item
LvItem.iSubItem=0; // Put in first coluom
LvItem.pszText=msgString; // Text to display (can be from a char variable) (Items)

SendMessage(hwndMsgRqst,LVM_INSERTITEM,0,(LPARAM)&LvItem); // Send info to the Listview

I am able to get the item count using LVM_GETITEMCOUNT

Any help is really appreciated





Social Engineering Specialist.

Because there is no patch for human stupidity.
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
Mohamed Jaffar Sagir28-Jan-05 1:54
Mohamed Jaffar Sagir28-Jan-05 1:54 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
S Douglas28-Jan-05 3:52
professionalS Douglas28-Jan-05 3:52 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
Mohamed Jaffar Sagir28-Jan-05 4:15
Mohamed Jaffar Sagir28-Jan-05 4:15 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
S Douglas31-Jan-05 1:07
professionalS Douglas31-Jan-05 1:07 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
James R. Twine28-Jan-05 2:58
James R. Twine28-Jan-05 2:58 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
Mohamed Jaffar Sagir28-Jan-05 4:01
Mohamed Jaffar Sagir28-Jan-05 4:01 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
James R. Twine28-Jan-05 13:48
James R. Twine28-Jan-05 13:48 
GeneralMX query through NSlookup Pin
Ankit Aneja27-Jan-05 20:21
Ankit Aneja27-Jan-05 20:21 
GeneralRe: MX query through NSlookup Pin
ThatsAlok27-Jan-05 20:28
ThatsAlok27-Jan-05 20:28 
GeneralRe: MX query through NSlookup Pin
Ankit Aneja27-Jan-05 20:34
Ankit Aneja27-Jan-05 20:34 
GeneralRe: MX query through NSlookup Pin
22491727-Jan-05 21:27
22491727-Jan-05 21:27 
GeneralRe: MX query through NSlookup Pin
Ankit Aneja27-Jan-05 22:12
Ankit Aneja27-Jan-05 22:12 
GeneralImageList Control Pin
Rajmathi27-Jan-05 19:57
Rajmathi27-Jan-05 19:57 
QuestionHow to split pcl data file to print separate page Pin
hunghn27-Jan-05 19:40
hunghn27-Jan-05 19:40 
Generalproblem in dns query Pin
Ankit Aneja27-Jan-05 19:08
Ankit Aneja27-Jan-05 19:08 
Questionhow to make word so that it doesnt create .tmp Pin
Jetli Jerry27-Jan-05 18:11
Jetli Jerry27-Jan-05 18:11 
AnswerRe: how to make word so that it doesnt create .tmp Pin
shaveyourhead27-Jan-05 18:27
shaveyourhead27-Jan-05 18:27 

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.