|
You could consider using a list control for this instead, unless you realy want the user to be able to freeform edit your event log. List controls are easier to override for changing the way they look if I remeber rightly it's not hard to make the grid lines disappear for example if you want it to look like a readonly multiline edit. They can contain much more as well I wouldn't try putting 2 million lines of text in an Edit Control, ( I think max is still 64K), but a List Control will be happy with that.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi
I am doing customization of ToolTip control. So how can i check that mouse is move on which area of ToolBar. I want to display ToolTip text for mouse move on particular icon on ToolBar.
Regards
Atul
Atul
|
|
|
|
|
M. Atul wrote: I want to display ToolTip text for mouse move on particular icon on ToolBar.
For toolbars if you set the CBRS_TOOLTIPS style then toolbars will send TTN_NEEDTEXT notification message to it's parent window. Handle this message to show tooltips.
|
|
|
|
|
Hi again, I'm trying to find someone who used Imapi for cd recording if he could help me. I'm having a problem with staging a image for folders to enable burning to cd. I'm using ISorage and IStream, I'm only having trouble with folders(subfolders), no problem recording files! I call my function member 'BurnCD()' for recording, here is the code:
<br />
BOOL CBurn::BurnCD()<br />
{<br />
HRESULT hr;<br />
<br />
CFile files[32];<br />
IStorage* pStorage = NULL;<br />
IStream* pStream;<br />
int i=0;<br />
<br />
for (i =0; i<m_lsFiles.GetItemCount(); i++)<br />
{<br />
CString strFilePath=m_lsFiles.GetItemText(i,0);<br />
CString tip=m_lsFiles.GetItemText(i,2);<br />
CFileException e;<br />
int nSize = 0;<br />
<br />
if(tip == CTXT_DOC)
{<br />
<br />
hr = StgCreateDocfile( NULL, STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, NULL, &pStorage);<br />
if (files[i].Open(strFilePath,CFile::modeRead,&e))<br />
{<br />
USES_CONVERSION;<br />
CString ime = files[i].GetFileName();<br />
HRESULT res;<br />
if( (res = pStorage->CreateStream( T2W(ime.operator LPCTSTR()), STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE|STGM_FAILIFTHERE, 0, 0, &pStream) ) != S_OK )<br />
return FALSE;<br />
<br />
nSize = files[i].GetLength();<br />
BYTE *pBuffer = new BYTE[nSize];<br />
if (files[i].Read(pBuffer,nSize) > 0)<br />
{<br />
hr = pStream->Write(pBuffer,nSize,NULL);<br />
hr = pStream->Release();<br />
}<br />
files[i].Close(); <br />
delete[] pBuffer;<br />
hr = pJolietDiscMaster->AddData(pStorage, 0);<br />
}<br />
}<br />
else if (tip == CTXT_DIR)
{<br />
hr = StgCreateStorageEx(NULL,<br />
STGM_CREATE | STGM_READWRITE |STGM_SHARE_EXCLUSIVE | STGM_DIRECT,<br />
STGFMT_STORAGE,<br />
0,0,0,<br />
IID_IStorage,<br />
(void**)&pStorage);<br />
<br />
CString curDir = strFilePath;<br />
CString dir_name=_T(""),temp = strFilePath;<br />
int len = temp.GetLength();<br />
for(int i=len-1; i>=0; i--)<br />
{<br />
if(temp.GetAt(i)=='\\')<br />
{<br />
dir_name = temp.Right(len-i-1);<br />
break;<br />
}<br />
}<br />
IStorage* pDirStorage;<br />
USES_CONVERSION;<br />
hr = pStorage->CreateStorage(A2W(dir_name.operator LPCTSTR()),<br />
STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DIRECT,<br />
0,0,&pDirStorage);<br />
SetCurrentDirectory(strFilePath);<br />
CString F_name;<br />
CFileFind m_ff;<br />
strFilePath += "\\";<br />
strFilePath += "*.*";<br />
BOOL b_dd = m_ff.FindFile(strFilePath);<br />
if(!b_dd)<br />
{<br />
DWORD err = GetLastError();<br />
DisplayErrorString("",err);<br />
return FALSE;<br />
}<br />
while(b_dd)<br />
{<br />
b_dd = m_ff.FindNextFile();<br />
if(m_ff.IsDots()) continue;<br />
F_name = m_ff.GetFileName();<br />
if( F_name.GetLength() > 31)<br />
{<br />
return FALSE;<br />
}<br />
<br />
if(m_ff.IsDirectory())<br />
{<br />
BOOL res = StorageDir( curDir, F_name, pDirStorage);<br />
if(!res) return FALSE;<br />
continue;<br />
}<br />
<br />
CFile File;<br />
if(!File.Open(F_name,CFile::modeRead,&e))<br />
return FALSE;<br />
<br />
IStream* pDirFileStream;<br />
HRESULT rez;<br />
rez = pDirStorage->CreateStream(A2W(F_name.operator LPCTSTR()),<br />
STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE,<br />
0, 0, &pDirFileStream);<br />
nSize = File.GetLength();<br />
BYTE *pBuffer = new BYTE[nSize];<br />
if (File.Read(pBuffer,nSize) > 0)<br />
{<br />
hr =pDirFileStream->Write(pBuffer,nSize,NULL);<br />
hr = pDirFileStream->Commit(STGC_OVERWRITE);<br />
hr= pDirFileStream->Release();<br />
}<br />
File.Close(); <br />
delete[] pBuffer;<br />
}<br />
hr = pJolietDiscMaster->AddData(pStorage, 0);<br />
pStorage->Release();<br />
}<br />
}<br />
theApp.DoWaitCursor(1);<br />
hr = pDiscMaster->RecordDisc(FALSE,TRUE);<br />
theApp.DoWaitCursor(-1);<br />
<br />
return TRUE;<br />
<br />
on the bolded,underlined line is where my code crak's reporting "Insufficient permissions to create stream!"
If someone can help with this or post it's code how to solve storage for folders please do so, I'm very thankful to all who can help!
|
|
|
|
|
Hello,
I have a CMenu class object with some menu options.When I try to disable a particular menu option I am not able to do it.I have used the following
EnableMenuItem(6,MF_DISABLED | MF_GRAYED );
But if I use the following
CString R;
GetMenuString(6,R,MF_BYCOMMAND);
I get the particular string of Id 6
What I sould do to disable the menu_id?
Thanks
Prithaa
|
|
|
|
|
use
<br />
EnableMenuItem(6, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
Is 6 the id of the menu item.
Best Regards
Raj
|
|
|
|
|
Hello,
Yes I have 6 as the id of the menu item
I have tried
EnableMenuItem(6, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
But that did not work
Thanks
Prithaa
|
|
|
|
|
Use this
and
Set the m_bAutoMenuEnable to FALSE in the constructor of
CMainFrame so no ON_UPDATE_COMMAND_UI or ON_COMMAND handlers are
needed.
|
|
|
|
|
prithaa wrote: I have a CMenu class object with some menu options
If it's an MFC app then you should use ON_UPDATE_COMMAND_UI macro and handle disabling and enabling there.
|
|
|
|
|
Hello,
Thanks,
I am not using Doc-View architecture.Yes I am using MFC's in my app.
I am handling enabling disabling in OnCmdMsg() of Mainframe class
Bye.
|
|
|
|
|
prithaa wrote: I am handling enabling disabling in OnCmdMsg() of Mainframe class
If you have done the OnCmdMsg as I said earlier, to disable the menu you need to return FALSE from that funtion.
|
|
|
|
|
Naveen.R wrote: If you have done the OnCmdMsg as I said earlier
Is this the correct way? ON_UPDATE_COMMAND_UI macro is provided for this purpose right.
|
|
|
|
|
When I checked the ON_UPDATE_COMMAND_UI wasn't arriving..
Please try.
Create a menu dynamically
Set it to mainframe using the SetMenu().
Now the menu will be disbaled since it dosent have command handler.
So I stepped into the MFC code and found out that handling the OnCMdMsg() will solve the pblm( I forget what you said in the IPT class ).
Please check the ON_UPDATE_COMMAND_UI is coming in this case.
|
|
|
|
|
Hello All,
I have to register a DLL which is builded in .NET with C#.
and i have to call exported function from VC++ project.
so for i have to register that DLL so please tell me how it is possible?
Thanks
bankey
|
|
|
|
|
|
Thanks for ur response.
i am allready trying using regasm it shows only registered successfully but in actual it is not registering.
may be there is version or other problem because when i build DLL using C# on my machine itself than it is working properly but when i got that DLL which is builded on other machine that it is not registering so what is happening i am unable to understand
|
|
|
|
|
I created a Setup with Visual Studio and all works nice.
I like to start the application automatically after the setup is closed.
(probably add a new page with the demand to open the app or not )
Has anyone an idea how to start it?
Big thanks
|
|
|
|
|
|
Hi
Any body know any articles or ebooks that explains VC++ for beginers ?
|
|
|
|
|
|
http://www.functionx.com
Anurag Gandhi.
|
|
|
|
|
Hi all:
I have a modeless dialog in which I have done not much inside its OnPaint, but when this dialog overlapped randomly, this dialog appears out of shape on the surface, should I send WM_PAINT or WM_ERASEBKGND message, if so when should I send them?
|
|
|
|
|
If you draw something directly on the dialog, all the drawing code should be put in the OnPaint handler. The dialog doesn't "keep" the drawing for you but you have to redraw everything again in the OnPaint handler.
Is that your problem ? If no, then I misunderstood your question.
|
|
|
|
|
Cedric Moonen wrote: redraw everything again in the OnPaint handler
I probably miss state the situation, on OnPaint I only call the DrawText, other than that I done nothing else, system handle all the rest paint operations.
|
|
|
|
|
it depends on what you exactly do. A repaint makes than sence, when all GUI changes are done.
It is also common style to update only some controls. For instance a status bitmap.
It makes also sence to divide forground and background painting.
Greetings from Germany
|
|
|
|