|
nineofhearts00 wrote: 1. new win32 console app (made it empty)
No Bueno. Should be a Win32 GUI app.
Mine linked with no exports or def file.
Here's what's in my stdafx.h precompiled header:
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <scrnsave.h>
A console app is going to compile different because WIN32 and _WINDOWS need to be defined.
|
|
|
|
|
By the way I had to add comctl32.lib in my project to link with InitCommonControlsEx.
|
|
|
|
|
and add comctl32.lib for the other unresolved (InitCommonControlsEx)
|
|
|
|
|
had that, but had removed it when i was trying to find an answer...but thanks.
|
|
|
|
|
On the plus side, that's only 24 hours of your life you'll never get back
|
|
|
|
|
Somebody would help me how could I access a memory cell? For example, I want to access the memory 0x009200,(read and write the memory).what should I do?
Thanks.Eager for your help!
|
|
|
|
|
What do you mean by a 'memory cell' ? Why do you want to access a specific location ?
If you knew that 0x009200 contained valid memory, you could do this:
char * mem = 0x009200;
But, it's a dangerous road. Where's the number coming from, that you know the number, but don't have a pointer that points to it already ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
this number only a example.and all the thing is another person asking for me.
But what u tell me couldn't work.the program will terminate when i what to display the char stored in mem.
Thanks for your replay
best regards.
|
|
|
|
|
kcynic wrote: But what u tell me couldn't work
Wrong.
kcynic wrote: the program will terminate when i what to display the char stored in mem.
Because, like I said, if you just start making up memory addresses, odds are that you won't own them, and you'll crash your program.
So, I ask again, why would you want to grab a memory address that you don't already have a pointer to, and try to work with it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
There is no point in accessing a specific address if you're not in kernel mode, or outside the scope of a memory protected operating system. Most, if not all, use something called "paging". The paging mechanisms map virtual addresses to physical addresses. The virtual address 0x0010000 might not (most likely won't) point to the physical address 0x0010000. In fact, you can't be sure what physical address the virtual address is mapped to, as it may vary at runtime at any time (pages being swapped in and out).
If you're running an application (i.e., not in kernel mode) in Windows, Linux, or any other modern operating system, you can stop your quest right now. It is a fruitless quest.
--
Not a substitute for human interaction
|
|
|
|
|
Is it possible to add multiple views to one document? I would like to display both views at the same time. In the CDocument class there is a function call AddView but that only seems to give me an ASSERT error when I try.
Is there something simple I am missing or is this even possible?
thanks,
Mike
|
|
|
|
|
CDocument::AddView() attaches another view to the document but the view needs to be created first.
How are you adding a view?
|
|
|
|
|
I have made a class that is a derivative of CView. I get the next view position and create the view, just the same way it is done for the initial view. I then call AddView with the pointer to the view I have just created. My one thought is that maybe I need to point the new view to the document that is creating it.
|
|
|
|
|
I had to look up how I do it since I've been moving away from doc/view for quite a few years but
I still have windows that open as views. The framework does it using the CDocTemplate class to
associate the document, view, and frame window class - useless for creating a child view
Anyway, I found a better generic example of what has to be done (from MFC docs)...
CView* pActiveView = ((CFrameWnd*) m_pMainWnd)->GetActiveView();
m_pOldView = pActiveView;
m_pNewView = (CView*) new CNewView;
CDocument* pCurrentDoc = ((CFrameWnd*)m_pMainWnd)->GetActiveDocument();
CCreateContext newContext;
newContext.m_pNewViewClass = NULL;
newContext.m_pNewDocTemplate = NULL;
newContext.m_pLastView = NULL;
newContext.m_pCurrentFrame = NULL;
newContext.m_pCurrentDoc = pCurrentDoc;
UINT viewID = AFX_IDW_PANE_FIRST + 1;
CRect rect(0, 0, 0, 0);
m_pNewView->Create(NULL, "AnyWindowName", WS_CHILD, rect, m_pMainWnd, viewID, &newContext);
m_pNewView->SendMessage(WM_INITIALUPDATE, 0, 0);
...
The key is the CCreateContext stuff. You may not need some of the code - for example you
probably already have a document pointer so you don't need to obtain it. AddView will be called
in CView::OnCreate() automagically.
I Hope this helps!
Mark
*EDIT* Here's a link Adding Multiple Views to a Single Document[^]
|
|
|
|
|
I was wondering if anybody would help be with a piece of code to open a binary and display the content in .txt format or comma separated. I am dealing with images that were processed and saved in binary format. I want to know what was saved in these files and use them.
Thanks
|
|
|
|
|
What about an hex editor?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have no idea how I can use hex editor. I've never used it before
|
|
|
|
|
I mean you can use an editor able to load binary files and to show the content as hexadecimal data (for instance, Visual Studio 6 can do that: choose Open->File menu item and then, on the file open dialog, select the option "open as Binary").
hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks!!
I will try this
|
|
|
|
|
I'm a bit new to this type of programming but I was wondering if anyone could point me to some information or provide some coding ideas on how to display a message to the user on the screen within a Direct3D game from an external process. I don't have any internal access to any of the game code. It would behave similarly to how FRAPS displays the frames per second inside all Direct3D games.
Thanks for any advice.
|
|
|
|
|
How do i get the control's handle in a dialog?
is thr ny way of enumeration for this? plz provide me some sort of example.
|
|
|
|
|
Please don't post twice (or more) the same question.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
If you have the control's ID:
HWND hwndCtrl = ::GetDlgItem(hwndDlg, ID_CONTROL);
Mark
|
|
|
|
|
Actually i have to move all the controls at run time in more than 100 dialogs and in each dialog there are many controls. so instead of passing each control id i want to enumerate all the controls to get the respective handles and with this handle i m moving the controls appropriately.
so plz give me solution to get the handle of all controls in a dialog.
|
|
|
|
|
Like CPallini said:
EnumChildWindows(hwndDlg, EnumChildProc, 0);
...
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
{
...do something with hwnd, a handle to a child window of hwndDlg...
return TRUE;
}
*EDIT* Return a value from EnumChildProc()
|
|
|
|