|
i had read that you written pic grabber,
so can you advise where to get code for optimized download-
able to continue after break, and for multiple
sections loading?
Thanks.
I want to create fast text loader/anylizer.
|
|
|
|
|
|
how to call this method?
I have link error
pDlg->testFunc(p1);
|
|
|
|
|
Hello,
I have an MFC MDI application, that repeatedly displays a message box in the InitInstance() member function, specifically in the MFC calls after the following code is executed:
if (theCommands.m_nShellCommand == CCommLine::FileNew)
{
if (!ProcessShellCommand(theCommands))
return FALSE;
}
The message box says "Failed to Create Empty Document".
The application is using a .ocx control to create a spreadsheet document inside of the CMainFrame. This only happens on one computer. The same computer can run a similar app. with the same activeX control and it will not create this error. I don't understand it.
Can anyone help me?
Here is some useful output
'MVReport.exe': Loaded '\\dan\mvreport\Debug\MVReport.exe', Symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\mfc71d.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\msvcr71d.dll', Symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\SHLWAPI.DLL', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\ODBC32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\comdlg32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\MFC71ENU.DLL', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\odbcint.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\clbcatq.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\comres.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
CoCreateInstance of OLE control {B0475003-7740-11D1-BDC3-0020AF9F8E6E} failed.
>>> Result code: 0x80040154
>>> Is the control is properly registered?
Warning: could not create view for frame.
Failed to create client pane/view for frame.
Warning: CDocTemplate couldn't create a frame.
'MVReport.exe': Loaded 'C:\WINDOWS\system32\mslbui.dll', No symbols loaded.
'MVReport.exe': Loaded 'C:\Program Files\Logitech\MouseWare\system\LGMOUSHK.DLL', No symbols loaded.
The program '[3480] MVReport.exe: Native' has exited with code 0 (0x0).
-dotBomb
|
|
|
|
|
The OLE control is obviously failing on creation, leading to your other errors. If it works with another
program on the same machine, then you are missing something specific. It may be that the other piece of
software is using a similar ocx, or even an older version.
Are you running AfxOleInit in your CMyApp::InitInstance member function?
Have you looked to see what 0x80040154 means?
Another trick is to use regmon from www.sysinternals.com to see where CoCreateInstance is failing.
You may have a different version (and therefore different GUID) of the ole control on your machines.
etc.
Happy hunting,
Iain.
|
|
|
|
|
Iain,
You were correct. The OLE control was failing on creation, because although it was registered, my application could not find it. It turns out that the path of the .ocx control MUST be in the OS search path in this case, and then re-registered with regsvr32 IN THE NEW PATH.
This was a lesson to me not to drill down into valuable, working code searching for runtime errors not directly caused by that code.
Thank you,
-DK
|
|
|
|
|
Sounds like you've had a frustrating last couple of days.
Mind you, its always nice when the solution in non-obvious.
Less embarassing at least!
Glad you've cracked your problem,
Iain.
|
|
|
|
|
How to change font of Cdialog programmatically ?
I use Create(IDD, CWnd*) function.
thanks.
|
|
|
|
|
Add a CFont member variable to the dialog's declaration. In the dialog's OnInitDialog() method, use:
LOGFONT lf = {0};
lstrcpy(lf.lfFaceName, "Arial");
m_font.CreateFontIndirect(&lf);
SetFont(&m_font);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Your method is not work,
also
virtual OnSetFont(Font*) - for settinf font,
not works.
Works:
http://www.codeguru.com/Cpp/W-D/dislog/fonthandling/article.php/c2023
Problem now- how to acces private members of CDialog,
if I want to create reuseable class for CDialogs
for font change ???
|
|
|
|
|
vgrigor wrote:
Your method is not work,
My apologies. The code snippet I provided was from a project in my archives. Those are from many years ago and apparently do not work with newer versions of MFC.
vgrigor wrote:
file:///E:/Doc/www.codeguru.com/dialog/ChangeDefaultDialogFont.shtml
This is a file only accessible by you. From what I could find CodeGuru has no such article.
vgrigor wrote:
how to acces private members of CDialog,
The dialog itself can access all members, regardless of their privilege.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I changed link. PLease , See above.
|
|
|
|
|
Code from above article do not work for ActiveX,
do you know how to correct it for that purpose?
<br />
int Create_WithHelper(int IDD, CWnd* pParentWnd, int isModal, int size, CString FontName = "MS Sans Serif")<br />
{<br />
<br />
CDialogTemplate dlt;<br />
int nResult;<br />
<br />
if (!dlt.Load(MAKEINTRESOURCE(IDD))) return -1;<br />
<br />
<br />
dlt.SetFont("Arial", 14); <br />
LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate);<br />
<br />
<br />
m_lpszTemplateName = NULL;<br />
<br />
HINSTANCE hInst = AfxFindResourceHandle(MAKEINTRESOURCE(IDD), RT_DIALOG);<br />
<br />
BOOL bResult ;<br />
<br />
m_hDialogTemplate = dlt.m_hTemplate;<br />
<br />
<br />
<br />
if(isModal) <br />
{<br />
nResult = <br />
DoModal();<br />
}<br />
else<br />
{<br />
bResult = <br />
CreateIndirect( dlt.m_hTemplate, pParentWnd);<br />
}<br />
<br />
<br />
<br />
GlobalUnlock(dlt.m_hTemplate);<br />
<br />
if(m_hWnd == 0 )<br />
ASSERT(0);
<br />
<br />
return bResult; <br />
<br />
};<br />
|
|
|
|
|
CFont *font = new CFont;
font->CreateFont(14,0,0,0,1200,0,0,0,
ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,"Arial");
m_example.SetFont(font);
the first number is the size. play around with the numbers for your liking.
I have a class called label.cpp label.h if you need it. It makes 3d fonts and all. Send me an email to junkmail4tony@comcast.net with a subject line of would like label class files. I will happily send it to you.
|
|
|
|
|
win32newb wrote:
...if you need it.
I don't, but vgrigor might.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It sounds like the .ocx file has not been properly registered. You can register it with the regsvr32.exe program.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hello,
i have a little problem with the interpretation of CreateNamedPipe(...)
what exactly is the difference between the dwOpenMode flag FILE_FLAG_OVERLAPPED and the dwPipeMode flag PIPE_WAIT, and which of those is used if both are specified?
Thanks in advance!!
|
|
|
|
|
hph wrote:
what exactly is the difference between the dwOpenMode flag FILE_FLAG_OVERLAPPED and the dwPipeMode flag PIPE_WAIT...
One relates to the calling thread, while the other relates to the pipe itself.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
ok, thanks! and what does this mean ?
|
|
|
|
|
See if these two help:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/createnamedpipe.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/named_pipe_type_read_and_wait_modes.asp
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
yes it helped, thank you, i got it!
|
|
|
|
|
Hi All!
How to debug the system wide hooks? Any artical or material will be highly appreciated.
Regards,
Bilal Anjum
|
|
|
|
|
Hi all!
I have a question regarding the computer's virtual memory.
I am writing a program to simulate all kind's of combinations of a poker hand. To do this I wrote 5 while statements. This will give a complexity of about O(50 exp 5) = O(312 500 000) in the last while statement I will do some calculations. The problem is that when I run the program a run out of virtual memory ( I have increased the limit to 4GB ). I am confused why I run out of memory, I did't think the while statements would consume any memory (almost) . Could it be that I have a memory leak in the calculations that I make.
So I guess my question is; will these while statements use all the computer's virtual memory depending on the complexity?
Thanx!
Martin_j
|
|
|
|
|
martin_j wrote:
I have increased the limit to 4GB.
Not possible, even if you were using Windows 2000 AS or DS with the /3GB switch.
martin_j wrote:
So I guess my question is; will these while statements use all the computer's virtual memory depending on the complexity?
No, while statements do not use memory in the quantity you are asking.
It sounds like you need to open the Performance Monitor when your program starts and watch its memory consumption.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Are you allocating any memory in these while loops ???
You need to check ur system performance.
Is there any considerable amount of harddisk space left ?
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|