|
that's not usually true - you can't undo an undo - when you do the first undo, the stack is emptied
|
|
|
|
|
Having a test on MS-WORD, I find that you delete 20 page then perform undo. After 30 times there's no complain about memory and the action performs very fast. So I assume, there must has other way than "command pattern" to perform such an action.
cheers
|
|
|
|
|
I might as well say it before the flaming starts.... if you have a specific question to ask, I am sure that someone here would be more than happy to help.... The first thing you will hear is "do your own homework"...
So why can't YOU get it to run in VC++?
Artificial intelligence is no match for natural
stupidity.
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
My VC++6 & MS DEV is somewhat out of order, I tried to re-load but was unsuccessful; I need to change the TEST file html code so that the student name and # appears beneath the clock; if I do and try to save it I get just under 20 errors when I attempt to run(!); I am supposed to copy and paste the TEST html code to Notepad or Wordpad, save as html to a deskcop icon; html code to change and save:
ERROR
Betty Hope<h 2=""> ERROR
898654712<h 2=""> ERROR
Betty Hope
898654712
ALSO WINZIPPED it and another friend could not unzip it properly to have a look. thanks for any help.
|
|
|
|
|
I have created an executive file in the form of CMemFile In an MFC application, which is directly copied in memory and is not on the hard disk. Now, how to execute this file directly from the memory? I tried to use the ShellExecute method, however, it does not accept the CMemFile giving an error saying that it cannot convert CMemFile to LPCSTR.
Is there any method to directly execute the exe file from the memory?
Regards
|
|
|
|
|
How does CMemFile store its data? Most likely it stores a pointer to the memory that contains the actual data. Look in the Microsoft documentation for CMemFile to see how it stores the data. Hopefully, CMemFile has a method to provide this pointer. An LPCSTR is a pointer to a string, so method could be called and the result could be cast to an LPCSTR if it is not already returned that way. Then this could be provided to the ShellExecute function.
David Spain, C++ Applications Programmer
|
|
|
|
|
David Spain wrote:
How does CMemFile store its data? Most likely it stores a pointer to the memory that contains the actual data. Look in the Microsoft documentation for CMemFile to see how it stores the data. Hopefully, CMemFile has a method to provide this pointer. An LPCSTR is a pointer to a string, so method could be called and the result could be cast to an LPCSTR if it is not already returned that way. Then this could be provided to the ShellExecute function.
I don't think so. You might obtain the CMemFile data using Detach , which returns a BYTE* and also closes the file. The return type is a BYTE* because a file may contain any type of data, not just text. Casting it to an LPCTSTR makes no sense: it may fool the compiler into accepting it, but the content will still be the same, and if it wasn't text, no one interpreting it as such will have correct results. In this case, in fact, it's an executable (binary) file.
Besides, ShellExecute expects to receive the name of the file path and name, not the content of the file.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
I don't think so. You might obtain the CMemFile data using Detach, which returns a BYTE* and also closes the file. The return type is a BYTE* because a file may contain any type of data, not just text. Casting it to an LPCTSTR makes no sense: it may fool the compiler into accepting it, but the content will still be the same, and if it wasn't text, no one interpreting it as such will have correct results. In this case, in fact, it's an executable (binary) file.
You are right. What I wrote actually made no sense. Obviously the ShellExecute function wants a string pointer, that points to the name of an actual file on disk.
As simply another idea, an executable in memory seems similar to a running process. Would using CreateProcess or something similar be a better avenue to pursue instead of ShellExecute?
David Spain, C++ Applications Programmer
|
|
|
|
|
Hi all,
I need to authenticate myself to a proxy. I have the domain\username and password.
I set it like this:
<br />
InternetSetOption((HINTERNET)(*pHttpFile), INTERNET_OPTION_USERNAME, <br />
sUsername, sUsername.GetLength());<br />
InternetSetOption((HINTERNET)(*pHttpFile), INTERNET_OPTION_PASSWORD, <br />
sPassword, sPassword.GetLength());
However, I still get the 407 error code.
Any idea how to set username and password for a file when behind a proxy?
Thanks!
Geert
Want to spread the newest version of your software automatically? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
I am trying to get a rebar added to an existing MDI window, I am using the following code:
<br />
INITCOMMONCONTROLSEX icex;<br />
<br />
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);<br />
icex.dwICC = ICC_COOL_CLASSES|ICC_BAR_CLASSES;<br />
InitCommonControlsEx(&icex);<br />
<br />
HINSTANCE hInst = (HINSTANCE)GetWindowLong(hParentHandle, GWL_HINSTANCE);<br />
hToolbar = CreateWindowEx(WS_EX_TOOLWINDOW,REBARCLASSNAME,NULL,WS_VISIBLE | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | RBS_VARHEIGHT | RBS_BANDBORDERS | CCS_NODIVIDER | CCS_NOPARENTALIGN,0,0,0,0,hParentHandle,NULL,hInst,NULL);<br />
if( !hToolbar ) {<br />
MessageBox(0, "Could not create toolbar control", "Error", MB_OK | MB_ICONHAND);<br />
return;<br />
}<br />
<br />
SetWindowLong(hWndBar, GWL_STYLE, WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS | CCS_NOPARENTALIGN | CCS_NORESIZE);<br />
SetWindowPos(hWndBar, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);<br />
<br />
RECT rect;<br />
GetWindowRect (hWndBar, &rect);<br />
<br />
REBARINFO rbi;<br />
rbi.cbSize = sizeof(REBARINFO);<br />
rbi.fMask = NULL;<br />
SendMessage(hToolbar, RB_SETBARINFO, 0, (LPARAM)&rbi);<br />
<br />
REBARBANDINFO rbb;<br />
rbb.cbSize = sizeof(REBARBANDINFO);<br />
rbb.fMask = RBBIM_SIZE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_ID | RBBIM_STYLE | RBBIM_TEXT | 0;<br />
rbb.hwndChild = hWndBar;<br />
rbb.cxMinChild = rect.right - rect.left + 2;<br />
rbb.cyMinChild = rect.bottom - rect.top + 2;<br />
rbb.cx = 250;<br />
rbb.fStyle = RBBS_BREAK | RBBS_GRIPPERALWAYS;<br />
rbb.wID = 100085;<br />
rbb.lpText = TEXT("Toolbar");<br />
<br />
SendMessage(hToolbar, RB_SETPARENT, (WPARAM) (HWND) data->hParentHandle, (LPARAM)0);<br />
SendMessage(hToolbar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbb);<br />
SendMessage(hToolbar, RB_SHOWBAND, (WPARAM)(UINT)0, (LPARAM)(BOOL)TRUE);<br />
SetWindowPos(hToolbar, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);<br />
Now using that code, the bar appears to flash on the screen but doesn't stay there, what am I missing?
|
|
|
|
|
Hi,
I have one executable say program.exe which is linked with first.dll.
first.dll contains TestClass. Now if i replace the first.dll with the
dll of same name and same exported function of class TestClass, but
having different implimentation, then the program.exe is executed with
replaced first.dll.
Is there any way to know that the first.dll is replaced or not.
Regards
AbdulMunaf Chhatra
Software Engineer,
C-Sam Solutions Pvt. Ltd.
Phone : +91-265-2324018/19
Email : a.chhatra@popnet.co.in
|
|
|
|
|
Abdul Munaf Chhatra wrote:
Is there any way to know that the first.dll is replaced or not.
How about looking for an exported function or global variable that exists only in the original DLL?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Here is something I did a long ago.
Create a global string in the DLL like
char* pCpde = "My Secret Code";
Before loading the DLL from the EXE, open the DLL in binay mode from the EXE.
Search for your secret code.
If it exists, close the DLL file and load it.
I call it signing code.
« Superman »
|
|
|
|
|
If you look at MS Word, with a new blank document.. and then choose View->Print Layout menu.. Now, you'll see the white page on the brown/gray background.. on a 100% view
I know that on normal circumstances in Doc/View architecture, the client area of CView entirely occupies the client area of the CCHildFrame..
Now with the Print-Layout View, Is it possible that the white page is drawn on the CView client area but it is NOT occupying the whole client area of CCHIldFrame so thats why we are seeing the background color of CChildFrame?
Or is the white page and the background color are all drawn together in the client area of CView?
Maverick
"watch the birdie!..."
|
|
|
|
|
I used Spy++ and using the window finder tool suggests that the 'white paper' that you see is a window that is not part of the background that the paper 'sits' on.
I'd be surprised to learn that the MFC document/view classes are in use in Word.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
so u're saying that Doc/View classes aren't used in Word?
|
|
|
|
|
Maverick wrote:
so u're saying that Doc/View classes aren't used in Word?
Maybe they use some Doc/View classes, but most likely not MFC's CDocument and CView
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I am trying to create a CDialogBar from an existing window using the Attach() method (I have to use Attach because the window is created by a seperate process belonging to my app), I also have a CMDIFrameWnd which I would like to dock the dialog bar to, I am using this code:
<br />
data->m_pParent = new CMDIFrameWnd;<br />
if( !data->m_pParent->Attach(data->hParentHandle) ) {<br />
ShowError();<br />
return;<br />
} else {<br />
MessageBox(0, "Attached OK", "Attach", MB_OK);<br />
}<br />
<br />
SetWindowLong(hWndBar, GWL_STYLE, WS_CHILD | CBRS_LEFT | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY);<br />
<br />
data->m_pBar = new CDialogBar;<br />
if (!data->m_pBar->Attach(hWndBar) )<br />
{<br />
ShowError();<br />
return;<br />
}<br />
<br />
data->m_pBar->EnableDocking(CBRS_ALIGN_ANY);<br />
data->m_pParent->EnableDocking(CBRS_ALIGN_ANY);<br />
But I get a failed assertion on this line in dockcont.cpp
<br />
ASSERT(pBar->m_pDockSite != NULL);<br />
Am I even heading in the right direction here?
Thanks in advance
|
|
|
|
|
Hi,
I have code like in this manner to split the pane that will have 2 rows and 1 column.
VERIFY(m_wndSplitter.CreateStatic(this, 2, 1));
VERIFY(m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(SmallClass), CSize(100,100), pContext));
VERIFY(m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(BigClass), CSize(100,100), pContext));
This always displays two panes.
Now my task is to find out at run time and display only one pane, but when I changed the code
VERIFY(m_wndSplitter.CreateStatic(this, 1, 1));
I am getting an assertion stating that either maxCol or maxRow should be greater than 1 in winsplit.cpp.
Can somebody help me out to display one pane/ two panes and decide about this at run time?
Thanks,
PRJ
|
|
|
|
|
|
i need to access the toolbar which is created in the parent window from the child window. but i m unable to do so. what should be done? can any1 pliz suggest.
thanx in advance
|
|
|
|
|
How about using GetParent() to get the parent window and then accessing the toolbar using the parent window.
« Superman »
|
|
|
|
|
Santosh M. P. wrote:
How about using GetParent() to get the parent window
well, tried getparent() but how to get access to the toolbar after that. pliz help
|
|
|
|
|
Hi there,
I want to write a simple dialog based application that should access the internet and get me a file from the server on the web.
Not only that, but I also need to send a URL back to the server to update the database residing on it.
Any ideas on how to do it ?
From what I read, they say that CWebBrowser can do that, but for some reason I couldn't find the basic interfaces to the Document through the file MSHTML.DLL as they stated in MSDN. could it be that I am using an old ver ?
Anyway, I am just starting out, so I'll be glad to hear on your perspective
Thanx, N
|
|
|
|
|
|