|
Try using forward declaration of class CMyDialog in
CCustomClass.h File
something like this
class CMyDialog;
class CCustomClass
{
// your stuff
};
|
|
|
|
|
Hey all.
I'm on the move tonight
One quick question. Currently, the way that I am doing this is definately not the right way of doing things.
I want to create a directory. (I'm using MFC BTW). I'm looking to see if there is a class (or if someone else may have built a class) that can help me do this. _mkdir is not really what I'm looking for because it won't create the folder if the parent does not exist. I'm looking to be able to build all "parent" folders of the dir as well. For instance, I want to say something like "CreateDir("c:\\temp\\1\\2\\3\\4\\5"), and if c:\temp does not exist, it will create it, then create c:\temp\1, c:\temp\2, etc.... I remember in VB M$ had a method that did this (I can't remember the name exactly) but I cannot seem to find it in VC. Any suggestions would be appreciated!
Thanks
Shultas
|
|
|
|
|
|
Exactly what I was looking for.
Thanks Mike
|
|
|
|
|
Hey everyone.
Dangit!
I pressed some wrong button while trying to compile my program in VS .NET 2003. The dang editor added "->" on every line and a lot of "."'s throughout my entire program and I don't know what it is, nor how to get rid of it!!!!!
Any suggestions?
Thanks
|
|
|
|
|
Sounds like you've turned on visible whitespace. the '->' is for tabs, and '.' (in the middle of the line) is for spaces. It won't affect the program - it's just a display. In VC6 (I don't have .NET) the shortcut is Ctrl+Shift+8, but I don't know about VS.NET. Have a look in the help.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
YES!
That helped perfectly!
Gee, what a great feature! Press a button and your program instantly becomes un-readable (at least after you've had a couple of jack and cokes, hehhe)
Thanks for the post, that fixed it!!!
Shultas
|
|
|
|
|
|
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
|
|
|
|