|
|
Hello all.
I have a button in my program, IDC_PROCESSFILE. I want to change the text of this button on the fly. I have a checkbox, when the user hits a checkbox, I want to tie to the check/uncheck event to change the text on the button. IE. You can click "Process multiple files" checkbox, when you click that checkbox, I want to change the button to say "Process files" instead of "Process file" ... Just wondering if this is possible? I do know how to tie to the check/uncheck event, just do not know how to change the text of a button.
Thanks
Shultas
|
|
|
|
|
One solution is SetWindowText().
Kuphryn
|
|
|
|
|
Exactly what I was looking for. Thank you kuphryn!
|
|
|
|
|
I believe this is what u're looking 4:
CWnd* pWnd = GetDlgItem(IDC_PROCESSFILE);
pWnd->SetWindowText(_T("Process file"));
What would life be without programmers and salesmen?
|
|
|
|
|
i looked thru the codes for the bitmap sections but can't find any tt explains how to convert bitmap to jpeg and back.... need help.. thankz
Flies spread diseases so close ur FLY!!!
|
|
|
|
|
GDI+ will do it for you - read my article on building a simple paint program. Otherwise, it's a pretty complex task.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hi!
I have complete my app using mscomm32.ocx,then it runs ok on my machine (os:win2k) which installed vc studio 6.0.But it can't run on the other machine (os:win2k) without intalling vc studio 6.0.
especially I register this ocx in the other machine.
why?
thanks!
|
|
|
|
|
Use the dependency viewer that comes with VC on the ocx to find what it requires installed in order to work.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I think this is just a licensing problem which MSComm32.ocx has. You can transfer the license by making setup file using Install Shiled. Another way is to use CreateFile API command in place of MSComm ActiveX!
Reza
|
|
|
|
|
Hello
I have an Visual Studio 6/ MFC application that contains a list ctrl. I would like make it so that the user cannot select items in the list control.
I have added the folowing code to handle the LVN_ITEMCHANGING notification message but it doesnt work. The item becomes selected no matter what value is returned. Can anyone help please?
BOOL CListCtrlEx::OnItemChanging(NMHDR *pNMHDR, LRESULT *pResult)
{
NMLISTVIEW *pLVNM = (NMLISTVIEW *)pNMHDR;
if( pLVNM->uNewState & LVIS_SELECTED &&
!(pLVNM->uOldState & LVIS_SELECTED))
{
return TRUE;
}
return FALSE; //allow change
}
|
|
|
|
|
figured it out. see the last two lines
void CListCtrlEx::OnNmCustomDraw(NMHDR *pNMHDR, LRESULT *pResult)
{
NMLVCUSTOMDRAW *lvcd = reinterpret_cast<nmlvcustomdraw *="">(pNMHDR);
// CDDS_PREPAINT is at the beginning of the paint cycle. we
// implement custom draw by returning the proper value. In
// this case, we are requesting item-specific notifications.
switch (lvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
// Request prepaint notifications for each item.
*pResult = CDRF_NOTIFYITEMDRAW;
break;
case(CDDS_ITEMPREPAINT|CDDS_SUBITEM):
if(m_DisableSelectedHighlight)
{
lvcd->nmcd.uItemState &= ~CDIS_SELECTED;
lvcd->nmcd.uItemState &= ~CDIS_FOCUS;
}
|
|
|
|
|
You've mixed up the return value of the function and the value returned through pResult . In MFC, WM_NOTIFY handlers return void . The pResult parameter is where you put the "return value" of the handler. In other words, you should do *pResult = TRUE; instead of return TRUE;
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
Actual sign at the laundromat I go to: "No tinting or dying."
|
|
|
|
|
Hi, is there any function which tells me what ip has the machine ? (i dont mean 127.0.0.1 ).
Thanks
|
|
|
|
|
GetMyIp(void) const
{
// Don't forget to initialize the sockets and stuff!
char locn[255];
CString ip;
if (SOCKET_ERROR != gethostname(locn, 255))
ip = inet_ntoa(*(struct in_addr *)*gethostbyname(locn)->h_addr_list);
return ip;
}
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
That was pretty fast reply Thanks
|
|
|
|
|
Hi,
It is ever possible that nobody have met what I call the CR count problem of an Edit control ?
What I mean is that an Edit control of Microsoft is not able to count right the CRLF characters ! Yes, just the ones that Microsoft itself keeps alive !
What it does is just to ignore the '\r' characters in the count,
both when using EM_GETSEL and EM_SETSEL
I made a workaround, which is to count all the CR characters both before the beginning of a selection and inside the selection itself, and then make some adjust to the counts. But this code is CPU consuming and more orrible than here described.
Does anyone know a better workaround, or better a solution for this ... ?
Marcello
|
|
|
|
|
Hi everyone..
I would like to make a "Wireless signal strength meter" such as a small bar graphics which can be seen when you open the wireless connection status dialog from your wireless network icon.
I think there might be a way of getting this value regardless of brand of wireless network card..
If there's anyone who knows it, please share your know-how.
Thank you very much
Eddie
|
|
|
|
|
Hi.
I would like to be able to instantiate an object based on some attribute.
ie) I would like to be able to tell a function to create a object based on some value. I do not mean a simple switch trawling through a range of int or char values, but to be able to call a function with an argument that can be used to create an object of a specified type.
Is it possible to create an object based on an indirection, other than a pointer to an already exisiting object of the same kind.
Any advice would be very welcome.
James
|
|
|
|
|
Hi James, the technique you're after is oftenly called a virtual constructor or factory method; google for these terms to get some info. If you have trouble implmenting this, do not hesitate to come back for more help.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi.
Thanks very much.
I am after the type of effect that you can get using an array of pointers to functions.
I will check out the web, as you suggest.
Thanks.
James.
|
|
|
|
|
I am creating a DLL using the Visual C++ 6.0 appwizard(dll). I am building a vst(steinberg)plug-in using MFC. I would like to know if a dialog that I added to this DLL can support activeX controls.
I have tryed adding the function AfxEnableControlContainer( ) to the InitInstance() function, and registered the controls however that does not seem to work.
Can anyone help me?
Thanks in advance,
-Jeff Chandler
|
|
|
|
|
You made dll by MFC and used AfxEnableControlContainer() function to enable using ActiveX control, so the dll part is OK. Just to be sure, you can make a simple MFC exe file and load your dll.
I think this problem returns to the application which load your plug-in.
Reza
|
|
|
|
|
I'm building an app using MFC as a front end, with the majority of the app in C++ with heavy use of STL.
I've used Boost::shared_ptr to manage my new/delete calls for me. As far as I can tell, the only pointers I use are STL vector<> iterators.
My problem is this: when I run the app in the debugger, it works perfectly. When I run it as an EXE, it throws an exception and crashes after a few minutes - even though its the exact same build!
I've tried building with _DEBUG and NDEBUG, and both yield the same results. I've tried disabling inlining and optimization, and it makes no difference. The crashes are fairly random, so I suspect a bad pointer.
To check my memory, I've used:
afxMemDF |= checkAlwaysMemDF;
It didn't trip even once while debugging.
Can anyone help me?
|
|
|
|
|
A few random things to try... there is an article somewhere around here called "Surviving the Release Build", which has some good info.
Also, I've noticed that the Debug build often is "nice" and initializes variables to zero or to a known debug value. Release mode gives you no such luck. So perhaps you just have an uninitialized variable somewhere?
You can also try "Cave-man" debugging... put in message boxes at strategic locations in your program to narrow down the crash.
"I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
|
|
|
|