|
Settle down, fella - it's a legitimate question and your answer is not clear.
|
|
|
|
|
|
Basically it means that anything that is 'protected' can only be seen by derived or friend classes.
It's usage is entirely up to the individual.
|
|
|
|
|
Hi,
Is there any code I can use in vc++/MFC to make turn off and Hibernate of monitor.?
Regards
rajesh
|
|
|
|
|
look at SetSystemPowerState API function.
|
|
|
|
|
Does anyone know some way how to programaly retrieve and set
Gamma correctin options?
I mean value from Display setting option for whole computer.
I tried GetDeviceGammaRamp() but i guess it is not
what i am looking for or I dont know how to use it right.
thank you
viliam
|
|
|
|
|
hi all, i'm currently working on a PIM project. I've constructed a propertypage within a form view; on one of the tabs, i tried to put a CListCtrl member variable to a list control on my dialog template, however the below error popped up:
Debug Assertion failed
Program: my.exe
File: dbgheap.c
Line: 1017
Expression:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
i tried various controls (e.g. button) but they all returned the same result.
However, all would be fine if i just had the control on my dialog template without declaring the member variable.
Can anyone help me out of this one?
|
|
|
|
|
At first glance, that looks like a problem with using delete on an invalid pointer value. For example, doing a "double-delete", or passing a plain old fashioned uninitialized pointer to delete .
These kinds of problems are very hard to locate without some of the code involved...
Peace!
-=- James
Tip for inexperienced drivers: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
Thanks for your reply!
To be more precise, i only get the error when i am exiting the main application. My project is a SDI project. When i compile and link in Release mode, there's no problem at all. From what i understand about MFC, when we use the keyword new for allocation purposes, we should use delete in conjunction with it right?
i only used new when i am initializing my form view.i use a pictutre control to reserve a place on my form view for my property sheet(ie. a place holder). my code goes like this:
/********************************************************/
// create and associate the property sheet with
//the "place holder" window
/********************************************************/
CMySheet *pMySheet;<br />
<br />
CWnd* pPlaceHolder = GetDlgItem(IDC_PLACEHOLDER);<br />
<br />
pMySheet = new CMySheet(pPlaceHolder);<br />
<br />
if (!pMySheet->Create(pPlaceHolder, WS_CHILD | WS_VISIBLE, 0))<br />
{<br />
delete pMySheet;<br />
pMySheet = NULL;<br />
return;<br />
}
// fit the property sheet into the place holder window
// and show it
CRect m_PlaceSheet;<br />
<br />
GetDlgItem( IDC_PLACEHOLDER )->GetWindowRect( &m_PlaceSheet );<br />
<br />
ScreenToClient( &m_PlaceSheet );<br />
<br />
pMySheet->SetWindowPos( NULL, 0, 0, m_PlaceSheet.Width(), m_PlaceSheet.Height(), SWP_NOZORDER | SWP_NOACTIVATE );
Thanks for any help in advance!!
|
|
|
|
|
Are you Attach ing another CWnd-based object to one of your windows controls?
The reason it works in release mode is likely not because the error/problem goes away, it is because there is no diagnostic code to report on it. There are very few errors that are a true result of the Debug mode of the Compiler/Linker.
The only thing that jumps out at me is that you are allocating into pMySheet , which is a local variable. That means that you are either really leaking it, or deleting it later in the same function, when it looks like the CMySheet object is supposed to have a longer lifetime. Either way, it looks like that pointer is being mismanaged.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites
|
|
|
|
|
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
Jaffar
|
|
|
|
|
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.
|
|
|
|
|
Hi thanks for the code...
It works fine if we are sending string or string pointer.
But if we pass structure( in case of list view), it does not work out. could u pls try with listview
|
|
|
|
|
No problem, if you can send me the snippet of code (it will make it easier) that would be great.
I'm no C++ expert / guru. But I do enjoy a challenge.
[edit]
I can’t guarantee I will get to it this weekend (the Girlfriend has barred me from working on the weekends, something about being bored watching me sit in front of the computer for > 12 hrs)
[/edit]
Social Engineering Specialist.
Because there is no patch for human stupidity.
|
|
|
|
|
enjoy the weekend
please find the snippet..
VC++ code:
**************************************************
DLL_EXPORT_VB void __stdcall RegisterLogWindow(HWND hwndMsgLog, HWND hwndMsgRqst )
{
TCHAR msgString[512];
memset(msgString, 0, sizeof (msgString));
SYSTEMTIME st;
GetLocalTime(&st);
wsprintf(tempString, _TEXT(" Dt: %02d:%02d:%04d - %02d:%02d:%02d:%03d "), st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds );
_tcscat(msgString, tempString );
int iItem=SendMessage(hwndMsgRqst,LVM_GETITEMCOUNT,0,0);
//LVITEMW LvItem;
LVITEMW LvItem1;
LvItem1.mask=LVIF_TEXT; // Text Style
LvItem1.cchTextMax = 256; // Max size of test
LvItem1.iItem=iItem ; // choose item
LvItem1.iSubItem=0; // Put in first coluom
LvItem1.pszText= msgString; // Text to display (can be from a char variable) (Items)
int hr = SendMessage(hwndMsgRqst,LVM_INSERTITEM,0,(LPARAM)&LvItem1); // Send info to the Listview
int err = GetLastError() ;
}
**** hr and rr returns 0.... itemcount got is correct
************************************
VB snippet
Declare Function RegisterLogWindow Lib "ToolsEng.dll" (ByVal hLogWindow As Long, ByVal hMsgWindow As Long) As Long
RegisterLogWindow lbEclipseEventLog.hWnd, ListView1.hWnd
|
|
|
|
|
Sorry Mohamed, I was unable to get it fully working as well. I will keep working on it; it’s an interesting idea.
I kept getting access-denied errors from the list view.
Social Engineering Specialist.
Because there is no patch for human stupidity.
|
|
|
|
|
What are the available error codes after the call fails? Both the return code of the call to SendMessage(...) and the value returned by GetLastError() (note that you have to call GetLastError() right after the call to SendMessage(...) ).
BTW: you are taking "the long way around" to build the contents of msgString ...
Peace!
-=- James
Tip for inexperienced drivers: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
Both SendMessage and GetLastError returns 0..
|
|
|
|
|
If the call returns successful return/error codes, and the Item Count increases after the call, my guess is that you have a redraw problem.
Try forcing a redraw of the application/control and see if your item shows up. Also, make sure that column zero has a real width. With a multi-column ListView control, if Column 0 has a width of zero, newly added items with no subitem text will be effectively invisible.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites
|
|
|
|
|
If i want to do MX query through NSLOOKUP what will be the actual code line for that
Plz Help
ankit
|
|
|
|
|
I Hope this Exact Syntax for NsLookUP
c:\>nsLookUp -type=mx yahoo.com
this will return all the Mail server of Yahoo.com
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
i just found that it also don't run on windows 98 is there any alternative for it
ankit
|
|
|
|
|
Pls go through this link [^] Seems like can provide a bit of help for your problem.
suhredayan There is no spoon.
|
|
|
|
|
but if i wnt to do text query
then
i was earlier doing it through api DNSQUERY
but that is not supported on windows 98
i want to know version by "current.cvd.clamav.net"
it was sucessful with DNSQUERY(but unsupported on win98)
so is there way to do it
ankit
|
|
|
|
|
Hello All,
I'm unable to use GetIDispatch with ImageList Control (Visual Studio 6.0). I get an error "Invalid Object", what could be the problem
Thanks & Regards
Rajmathi
|
|
|
|