|
It's an MPEG2 file, but i'm decoding the file myself.
|
|
|
|
|
Hi,
I am trying to locate the function address (user defined function)once I load the image of my executable. I have gone through the article by Matt Pietrek about the PE file format but still i am unable to work out how one can locate the address of a function in the mapped memory after calling MapAndLoad API or subsequent calls to CreateFileMapping and MapViewOfFile.
Can anyone help in this regard. Has anyone tried to locate the function address this way?
Regards,
Nitin.
|
|
|
|
|
Why not just do a LoadLibraryEx, passing LOAD_LIBRARY_AS_
DATAFILE or DONT_RESOLVE_DLL_REFERENCE flags to prevent it from initializing. Then, you can use the usual GetProcAddress() to look up the address of the function.
|
|
|
|
|
how to restrict a user from accessing contents of the local drives by typing them in the internet explorer address bar..
like if i type c: in internet explorer it opens up the c drive i want to restrict this type of access.
is there any way that i can know what is typed in the url bar and do what i want before navigating.
thanks in advance
qrious
|
|
|
|
|
It depends on the OS. With NT, 2000, and XP, you can restrict what drives, and folders, the current user has access to.
|
|
|
|
|
Hi everyone,
I have a question about XOR painting. I have a window with a bitmap background. Whenever I drag my mouse in the window, I want to highlight the selected area using XOR mode. Of course, I could do that by
::InvertRect(RECT & rect)
However, now I have some other areas that I want to highlight..but with a different color and I still want the background pattern to show under the highlighted rectangle. Is it possible to do an XOR drawing with some bit switched off or something like that. I want the XOR effect, but a different shade.
I hope my problem is clear enough. If anyone has any ides or suggestions, I would really appreciate it.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
hi..
I thing that this function use logical NOT operation!!!
|
|
|
|
|
Hello,
I have problems retrieving the height and width of a formview :
When I call the OnPaint() function, I want to display a picture at a specific position in a formview so I need to know its current size.
What I do to get the size is, in the OnPaint() function :
CRect rect;
this->GetWindowRect(&rect);
int winwidth=rect.Width();
int winheight=rect.Height();
But I get a width and height of zero.
Does anyone know what I did wrong ?
Thanks for your help,
|
|
|
|
|
Try this instead:
CRect ClientRect;
GetClientRect(ClientRect);
This will retrieve the width and the heigth of the client area (so what you need ) !
|
|
|
|
|
Thanks for your help, but it doesn't work either : I still have a width and height of zero with :
CRect rect=new CRect();
GetClientRect(&rect);
int winwidth=rect.Width();
int winheight=rect.Height();
|
|
|
|
|
Have you tried the GetTotalSize() method of the FormView (scrollview implemented)?
|
|
|
|
|
I have a structure like
struct Id {
LPCSTR sId; /* note that this is the first member */
unsigned nId;
};
I'd LOVE to have vc-debugger to display the sId value (in place of {...}) in the watch/this/locals/auto window, like CString does.
I've looked through the sources for CString and haven't quite figured it out.
Deriving from string isn't an option.
Any suggestions?
|
|
|
|
|
Locate the file autoexp.dat - mine (Visual Studio 6) is in the MSDev98\bin directory.
This file contains details of the expansions used when debugging. Open this up, and there is a huge bit at the top telling you how to do your own stuff. Further down you can see the entry for CString.
Hope this helps!
|
|
|
|
|
Are you saying that when you view Id.sId in the watch window, it shows ellipses instead of the actual data? If you do not know about the autoexp.dat file, and thus have never altered it, then I'm unclear on your question. By default, the contents of the address pointed to by Id.sId are displayed. If you had just Id in the watch window, it would indeed show up as {...}.
|
|
|
|
|
thanks a lot. I didn't know of autoexp.dat, but have always suspected something like it. Thank you very much for telling me of it.
(Thought it was built into vstudio. -darn M$)
|
|
|
|
|
How do I put an icon on a Single Document screen and then be able to click on the icon to call my dialog??
Thanks,
grahamoj.
|
|
|
|
|
Where do you want the icon? Are you sure you're not talking about a toolbar button?
|
|
|
|
|
Hello,
I have a structure that looks like:
struct STRUCT_EXAMPLE<br />
{<br />
int Data1;<br />
int Data2;<br />
float Data3;<br />
...<br />
<br />
void Clear() { memset(this,0,sizeof(STRUCT_EXAMPLE)); }<br />
};
Now, I allocate an "array" of this structure:
STRUCT_EXAMPLE* pPtr = new STRUCT_EXAMPLE[NewValue];<br />
for (int i=0;i<NewValue;i++)<br />
pPtr[i].Clear();
Everything works fine but when I delete the array:
if (pPtr)<br />
delete[] pPtr;
I have a memory check error:
memory check error at 0x0145C630 = 0x00, should be 0xFD.
memory check error at 0x0145C631 = 0x00, should be 0xFD.
memory check error at 0x0145C632 = 0x00, should be 0xFD.
memory check error at 0x0145C633 = 0x00, should be 0xFD.
and the first adress byte is the adress of the first element of my array (so it's normal that it is 0 because I want the first Data1 in the the first element of the array to be 0)!!
Can someone help me ??
Thanks
|
|
|
|
|
cedric moonen wrote:
STRUCT_EXAMPLE* pPtr = new STRUCT_EXAMPLE[NewValue];
Shouldn't this be: STRUCT_EXAMPLE** pPtr =
I'd change your code to use vector<struct_example*> ...
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
No, I want to use an array of structures, not use the pointers (so they are automatically destroyed) !
But, I found the error: I made a mistake elsewhere in my code and I write "outside" an array. In fact I write on the memory allocated by the bebugger (debug mode) just before the array (STRUCT_EXAMPLE* pPtr). So, that made the compiler go crazy !!
|
|
|
|
|
hi
is there any any anyway to set the (SourcecodeWindow) keywords on bold?
i have used years the Borland C++ Builder, and the style is very good. black bold C++ keywords.
so is there any way?
|
|
|
|
|
Hi, everyone!
I think memcpy is faster than strcpy and they really
do the same thing. So I think we should not use memcpy
instead of strcpy.
Am I correct?
Thanks in advance,
George
|
|
|
|
|
You can use memcpy when you want to copy a 'raw' piece of memory. There is no such thing as a concept of a C-string ( null-termination) or even objects in it.
When you want to work with strings it is best to use std::string (or CString if you like) and not to work with strcpy or the like at all.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Thanks, jhwurmbach buddy!
I am always using strncpy in C++ program. How to use
std::string to do string copy? Do you mean this way,
Source code:
--------
string src = "abc";
string des = src.substr (0, 2);
--------
regards,
George
|
|
|
|
|
Yes, if the first two letters are what you want.
You can make a std::string from a LPCTSTR returned by the API simply by saying e.g.
LPCTSTR s = GetWindowText();
std::string t (s); the other way round is:
SetWindowText( s.c_str() );
YOu can read more about std::string (and CString) in the Codeproject C++ FAQ.
My opinions may have changed, but not the fact that I am right.
|
|
|
|