|
I like to say that better give CString for member variable. How you use this Hexa numbers in ur code?? will you use bthem as hexa numbers or convert them as decimal numbers?
|
|
|
|
|
hi all,
sorry for this late reply. got in to something else.
I got it working.
the input required from edit box is hex value.
since this has a , b etc a value of type int does not work.
so as mentioned by one of you, I used value type string.
and then converted string to hex value using
sscanf(temp,"%x",&value);
now value has hex what ever user entered.
I still have a problem.
I need a 6 byte hex number from user in some cases.
so the 'value' is UCHAR[6] for that case.
for such big values, this is not working. I get some junk values after conversion.
Another thing,
I usually use messagebox to check intermediate values. but with CHAR[6] containing a hex value how do I make it to string and pass to mesagebox..
I hope I am clear and I'll get some help.
- KK
|
|
|
|
|
Hi,
Is there any way I can get the actual content type of a URL without downloading the file completely ?
1. I tried CHttpFile::QueryInfo with HTTP_QUERY_CONTENT_TYPE, But for that to work, I must call SendRequest, which will download the complete file.
2. I tried FindMimeFromData(...) with Url option, But its not even connecting to the internet to get the Mime type, instead I believe it checks only in the url. Sometimes the url may not be having any information about this and the server might set the mime type, so I need a method which will download only the Http response header and extract this information.
Thanks
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
You could ask the server - The response of a HTTP request gives the MIME type. To see what I'm talking about try this:
1. Open a command prompt and enter "telnet www.thecodeproject.com 80".
2. Now type the following, exactly (you will not be able to see what you're typing - The blank line at the end is important):
HEAD /images/standard/logotop.gif HTTP/1.1
Host: www.thecodeproject.com
The response from the server will indicate the content type (see the "Content-Type" header field).
I'm not saying you have to do all this manually at the socket level (although to do so would not be hard), but if you can figure out how to send a HTTP "HEAD" request to the server and read the response using whatever framework or API you're into you should be able to do it.
Steve
|
|
|
|
|
Hi Steve,
That was indeed very helpful. I used plain sockets and got this to work.
Thanks a TON!!!
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi everybody,
I'm looking for a possibility to monitor file access via a windows hook
but couldn't find anything on the MSDN page.
Isn't it possible to monitor and modify file open, read, write and close events?
Please help.
|
|
|
|
|
There are various techniques ranging from kernel patching, user mode API hooking, filter drivers, etc. Which you choose would depend on the scope of the hook - is it just one process or the system as a whole?
Steve
|
|
|
|
|
I only want to control file access from a single application.
Every time the app want to read from a file on disk it should provide the data from within a encrypted archive.
|
|
|
|
|
There are two common ways to hook an API for a single application, IAT patching and binary re-writting or the target. IAT patching will only effect one module (DLL or EXE) binary re-writting the target will effect the entire process. Look up these terms and check out the Detours library from Microsoft.
Steve
|
|
|
|
|
Thanks alot.
I will have a look on it.
|
|
|
|
|
Giving the number of bad things that can happen with api hooking, do you know if microsoft has any plans to do something to prevent api hooking?
thanks!
|
|
|
|
|
I believe 64 bit Windows has measures to prevent kernel patching. Click here[^] for details.
Steve
|
|
|
|
|
Im making a program that uses a listbox as its message window.Iam reading content for this control from one of my file.Dynamically the text is adding in the control. But when the text goes over the height of the list box the scroll bar appears but it doesnt scroll down automatically. How do i make it autoscroll to follow new items?
|
|
|
|
|
|
In my dialog,i have list box and im entering datas to list box thru button.When im entering datas the scroll bar is always placed in top position...To see the last enter text,i have to scroll the bar to bottom...
This is my problem..
IS there any command in MFC to keep the scroll bar always down to see the updated text...(For exemple,i need a listbox control like a notepad).Pls hlp me.....
Thanks in advance
-- modified at 4:06 Tuesday 31st January, 2006
|
|
|
|
|
Capture the selection changed message, and in this message select the last item with
m_lb.SetCurSel(m_lb.GetCount());
~RaGE();
|
|
|
|
|
Hello!
is it possible that an application (created with MFC), in a system, don't execute, and it encounter with problem. But it dosn't encounter with problem,
if we create this application with Win32App.
Actually, is it necessary that we create a program with Win32App? and we can not create it with MFC?
|
|
|
|
|
A pure Win32-app needs the runtime-dll. msvcrt.dll.
For a Win32-program that uses MFC, you must also supply the correct MFC-dll-file. Else, the program can't be executed.
|
|
|
|
|
kakan wrote: A pure Win32-app needs the runtime-dll. msvcrt.dll.
Not needed when you link statically to the crt library. See Project settings. C/C++ ->Code Generation ->Use run-time library -> See the options.
this is this.
|
|
|
|
|
IMO, there aren't too many who wants the increased app size, especially since the runtime dll already is installed in most cases.
But it's a possible, yes. I know that.
|
|
|
|
|
I think believe MFC makes creating User Interface easier, and along with a bunch of very useful classes, it is easier to write Win32 programs. But these programs depend on the MFC runtime libraries, only if MFC is dynamically linked to it.
I think your problem is because you are running the debug version without the necessary DLL's. If it is a debug version, then make it Release version. It is very likely that the MFC runtime dlls are already present on the target system.
Otherwise, there is no reason that an MFC program will not execute while a Plain Win32 will.
this is this.
|
|
|
|
|
MFC classes are simple wrappers for Win32 methods...
what is the actual error you're encountering ??
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
-- modified at 6:36 Tuesday 31st January, 2006
|
|
|
|
|
Hi ,
I have created a button in a class derived from CWnd.
After the event handler for the button is executed ,the focus does not return to the button.
I can see this default behaviour when the class is derived from CFormView or CDialog.
Can anyone tell me what the problem is?
Thanks,
Gayathri
|
|
|
|
|
can you post the code inside the handler of that button?
|
|
|
|
|
Hello!
I have some char array of hexadecimal values I get from the network. I want to convert them to some printable form. For example I did it like:
<br />
string print_buff;<br />
<br />
char buffer2[100] = {0x7f, 0x80, 0x1a};<br />
<br />
for(int i = 0; i < 3; i++){<br />
char a[3] = {0};<br />
sprintf(a, "%2.0x", buffer2[i]);<br />
print_buff.append(a, 2);<br />
}<br />
This works well to the values 0x7f (127), but for the numbers bigger than 0x7f it doesn't work properly anymore. If I look at 'a[3]' character array (in debuger) I can see that 0x80 has converted to "ffffff80" string. How is this even possible when I limited string with formating option to 2? When I append characters afterwards, "ff" is appended not "80".
Rostfrei
|
|
|
|