|
Hello Mr. Cardinal !
Thanks alooot for your useful help
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hello there,
How can i change the editbox to make a Flat editbox ?
I don't want to remove the border !
I just want to make flat editbox !!!
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
You can turn off border and set "Static edge" extended style to achieve a semiflat look, or you need to use owner draw control.
Pavel
Sonork 100.15206
|
|
|
|
|
Does Visual C++ support the statvfs object? If not, is there an object that is used to retrieve information about a partition (total size, size used, ect)?
|
|
|
|
|
Have a look at the Win32 APIs
GetDiskFreeSpaceEx
GetDriveType
|
|
|
|
|
Hi! I am develop a little application for a pocket pc with embedded Visual C++ 3.0... I tried to use the vector class of the stl, but I found out that there is no stl for embedded Visual C++, so I looked for a MFC class... but there are so many classes (CArray, CTypedPtrArray,...)...
Can anyone tell me what kind of mfc class I could use instead of the stl vector class?!?!? I need an array who stores pointer to a class (like "class CMeasureItem*")...
-- Sorry for my bad english!!!
Nice greets, Daniel.
|
|
|
|
|
CTypedPtrArray
Pavel
Sonork 100.15206
|
|
|
|
|
There's at least a couple of STL ports for eVC. Check them out at
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I have a MFC dialog app. Now, when I open an other dialog from the main one :
CSomeDialog dlg;
dlg.DoModal();
i want to access to some public member variable (for example CString m_Name) of the main dlg FROM the second dialog.. how to do this ?
Thanks for helping a beginner !
|
|
|
|
|
give the second dialog a pointer or reference to the first dialog.
void C1stDlg::OnY()
{
C2ndDlg d;
d.m_pFirstDialog = this;
d.DoModal();
}
void C2ndDlg::OnX()
{
m_pFirstDialog->m_Name = "Abe Lincoln";
}
-c
"Kate said / The flowers of intolerance and hatred / Are blooimg kind of early this year / Someone's been watering them.
-- Robyn Hitchcock, Devil's Radio
|
|
|
|
|
When i press a button in my program, i get this message:
Unhandled exception at 0x00ef86a6 in MP3.exe: 0xC0000005: Access violation reading location 0x00000110.
And the strange part is that I get this message even before it has executed any of the procedures for the event of that button. It hasn't even come to the case line
case IDC_CONVERT:
When it pops up with the message.
This only happens if I, before I press the button, press another button which prompts the user to choose an ACM compressor driver. Here are the code for the button that i press before i press the second button which generates the message:
i = SendMessage(ghFormatHandle, LB_GETCURSEL, 0, 0);
j = SendMessage(ghTagHandle, LB_GETCURSEL, 0, 0);
hCurrentDriver = (HACMDRIVERID)SendMessage(ghFormatHandle, LB_GETITEMDATA, i, 0);
id = (HACMDRIVERID)SendMessage(ghTagHandle, LB_GETITEMDATA, j, 0);
SendMessage(ghFormatHandle, LB_GETTEXT, i, (LPARAM)szFormatName);
details.cbStruct = sizeof(details);
acmDriverDetails(id, &details, 0);
strcpy(szDriverName, details.szLongName);
SetDlgItemText(ghMainWnd, IDC_DRIVERNAME, szDriverName);
SetDlgItemText(ghMainWnd, IDC_FORMAT, szFormatName);
EndDialog(ghChooseWnd, 0);
I have found out that if i remove the hCurrentDriver = (HACMDRIVERID)SendMessage(ghFormatHandle, LB_GETITEMDATA, i, 0); line, no error happens! what could be wrong? Here's the call stack when the error happens:
LameACM.acm!00ef86a6() <--
winmm.dll!76b431ad()
msacm32.dll!77be4b5d()
MP3.exe!0040118e()
e877e88c()
(it's at the arrow when the error happens)
And here's the assembly code I get redirected to:
00EF86A0 push esi
00EF86A1 mov esi,dword ptr [esp+8]
00EF86A5 push edi
00EF86A6 mov edi,dword ptr [esi+110h] <---- THIS LINE
00EF86AC cmp dword ptr [edi],0FFF88E3Bh
00EF86B2 je 00EF86BC
00EF86B4 pop edi
00EF86B5 mov eax,0FFFFFFFDh
It jumps to the line marked with "THIS LINE".
The value of edi is 24653 and the value of esi and eax is 0.
Please help, I have no idea what could be wrong.
You're very welcome to email me to help me solve this error, thanks a ton!
-Rune Svendsen
|
|
|
|
|
Have you checked the return value assigned to i?
|
|
|
|
|
you must use a NULL pointer
|
|
|
|
|
Hi,
I recently installed the latest Platform SDK on Windows 2000 and now my Oct 2001 version of MSDN won't open. Has anyone had this problem before? When I try to launch the MSDN I get the following error:
Cannot open the file: c:\Program Files\Microsoft Visual Studio\MSDN\2001OCT\1033\MSDN130.COL.
I verified that the file is there, so I'm kind of confused about what is going on. I also tried uninstalling it and I get the same error.
Any help would be greatly appreciated.
Thanks,
Craig
|
|
|
|
|
How do I access a documents data from the dialog? Is there any function for doing?
I know abt the GetDocument() that can be used in the View to access Document's data..
can anyone help me?
Thanks
|
|
|
|
|
no, there is no function in CDialog for accessing a CDocument. you either have to give your dialog a pointer (or reference) to your CDoc or copy data to and from the dialog using member functions of the dialog (or variables).
void CMyDoc::OnX()
{
CMyDialog dlg;
dlg.m_data = m_data;
if (dlg.DoModal()==IDOK)
{
m_data = dlg.m_data;
}
}
or:
void CMyDoc::OnX()
{
CMyDialog dlg;
dlg.m_pDoc = this;
dlg.DoModal();
}
...
class CMyDialog
{
...
public:
CMyDoc *m_pDoc;
}
-c
"Kate said / The flowers of intolerance and hatred / Are blooimg kind of early this year / Someone's been watering them.
-- Robyn Hitchcock, Devil's Radio
|
|
|
|
|
I am using CFileDialog to open a bunch of files and count the number of lines in them.
I am using the OFN_ALLOWMULTISELECT option.
It works fine if I select multiple files, but as soon as I select only one file, the CommDlgExtendedError returns a FNERR_BUFFERTOOSMALL error. The following is the code snippet:
<br />
CFileDialog fileDlg(true,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT ,"All Files|*.*||",NULL);<br />
fileDlg.m_ofn.lpstrFile = m_sFileNameBuf.GetBuffer(65536);<br />
fileDlg.m_ofn.nMaxFile = 65536;
int nOK = fileDlg.DoModal();<br />
if(nOK == IDOK)<br />
{<br />
POSITION pos = fileDlg.GetStartPosition();<br />
int nLines = 0,nTotalLines = 0;<br />
while(pos)<br />
{<br />
sFileName = fileDlg.GetNextPathName(pos);<br />
nLines = GetNumLines(sFileName);<br />
nTotalLines += nLines;<br />
sTmp.Format("%d",nLines);<br />
sLine = "File ";<br />
sLine += sFileName;<br />
sLine += " has ";<br />
sLine += sTmp;<br />
sLine += " lines.\n";<br />
fLog.WriteString(sLine);<br />
fLog.Flush();<br />
}<br />
sTmp.Format("%d",nTotalLines);<br />
sLine = "\nTotal number of lines inspected is " + sTmp;<br />
fLog.WriteString(sLine);<br />
fLog.Flush();<br />
}<br />
else<br />
{<br />
DWORD err = CommDlgExtendedError();<br />
CString s(fileDlg.m_ofn.lpstrFile);<br />
fLog.WriteString("No files were inspected as operation was cancelled.");<br />
}<br />
<br />
<br />
|
|
|
|
|
Never mind I got it. I don't know why but as soon as I made my buffer 65535 (and not 65536 - 64k + 1byte), it works for single selection as well.
|
|
|
|
|
Dear All,
i want to write help for my application. plz if any one of you can guide me how can i write my application help same as msdn. if there is some code materail or any other helping material plz reffer me i will be thank full.
lodhi
|
|
|
|
|
|
I'm trying to send a message from my ListBox custom class to another class which utilizes the control. In the Listbox control I build a LV_DISPINFO struct and then pass it to a SendMessage method to be used by the OnNotify message in the calling class. In this example CCreateWorldStep1Dlg uses the ListBox custom control whereas the ListBox custom control passes a message back to CCreateWorldStep1Dlg as a Notify message.
<br />
void CCreateWorldStep1Dlg::OnNotify(UINT message, LPARAM lParam) <br />
{<br />
CString Buffer;<br />
LV_DISPINFO *pInfo = (LV_DISPINFO *)lParam;<br />
<br />
pListBox->GetText(pListBox->GetCurSel(), Buffer);<br />
if(pListBox->GetCurSel() == pListBox->GetCount() - 1)<br />
pRegionsArray->Add(Buffer);<br />
else<br />
pRegionsArray->SetAt(pListBox->GetCurSel(), Buffer);<br />
}<br />
The problem is that variable pInfo contains garbage when I look at it. May I be converting the lParam incorrectly?
This is how I am sending the message
GetParent()->GetParent()->SendMessage(WM_NOTIFY, m_DlgID, (LPARAM)&dispinfo);<br />
Thanks for the help
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
Hello,
I have a smiple dialog box with a edit control(multiple line).. I pump strings into the edit control and start filling it up.. each string I put into the control goes on a new line below the previous line.. How do I get the control to auto-scroll down so that each new line that is inserted is displayed with out having to manually scroll to the bottom of the control.
Thanks!
|
|
|
|
|
Try with m_youredit.SetSel(-1,-1,TRUE) .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Didn't work.. I have tried even tried SetScrollPos(SB_VERT,1,TRUE); to scroll the bar down only one click.. but it doesn't seem like anything is effecting the scroll bar.
|
|
|
|
|