|
EBerlin wrote:
This is my first post here at TheCodeProject. If I did not post in the right place or did not follow a proper convention please let me know so I can remedy it.
Wow - are we that scary ? You've done well, you've found the right spot. Welcome to CP !!!
You need to load the bitmap into a member variable, then on double click draw it in the correct location. You'd therefore need to store a point to represent where the thing is drawn, and maybe initialise it to -1, -1, and draw only if it is positive numbers, so it appears on the first double click and then moves when you click elsewhere.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Thanks for your quick response.
Just repeating my interpretation of your response.
So make a local var of type CBitmap then map "double left click" and in that function use the CPoints X, Y coordinates and draw the bitmap at that location.
Using the bitmap, (and I think DC mem as well) how do I think display the bitmap?
Do you have a link to some sample code I could look at?
Thanks again for your help
Eric
|
|
|
|
|
EBerlin wrote:
So make a local var of type CBitmap then map "double left click" and in that function use the CPoints X, Y coordinates and draw the bitmap at that location.
No, you need to store the location as well, so it gets redrawn when the window gets moved, etc.
EBerlin wrote:
Using the bitmap, (and I think DC mem as well) how do I think display the bitmap?
In OnEraseDC, call the base method first, then draw the bitmap. Yes, you'll need a memDC to hold the bitmap while drawing
EBerlin wrote:
Do you have a link to some sample code I could look at?
Sorry, no. But if you give that a go and get stuck, I'm happy to help.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Does anyone know what the format of the Outlook Express storage file is or where to find the format for it?
My problem in a nutshell is this: I want to be able to filter out all of the spam emails from my Hotmail accounts. I've looked around and tried many of the shareware/trialware programs out there that claim to do this, but have had no luck with them working. So, instead of trying to find a program that does what I want, I'll have to (try) write one instead. The only problem is that I don't know the format of the DBX files that Outlook Express is using.
Before I spend a lot of time trying to figure out the format by example, I thought I'd see if anyone here knows what it is of has seen it described anywhere. What would be even better is if someone has already written a class that handles this (though I'm not too optomistic about that).
So, can anyone help me with this?
Thanks in advance for any help or pointers!
Mike
|
|
|
|
|
FYI, MSDN has articles abt Outlook Express format!
Thanks,
Ramu
|
|
|
|
|
Thanks for the response!
If you could post some of the URL's that would be great! I've searched many different times and didn't find anything that I thought was useful. It is entirely possible that I didn't search with the right keywords or that I just overlooked articles with the relevant information.
Thanks again!
|
|
|
|
|
can't help with the DB layout.
but, IMO, it's probably easier to go at it at the source - at the mail transport level. i think Outlook Express supports MAPI. if so, you could write an app that scans your inbox looking for files that match patterns, and delete the ones that do. this app does something like that: http://www.smalleranimals.com/snoop.htm. it's not too complicated to do.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Thanks for the reply Chris!
After seeing the great (and daunting) data that Ernest posted, I am beginning to think you're right.
I was hoping for something that I could do in a couple of days (it doesn't have to be pretty, it just needs to work) but this has the appearance of a full fledged, several weeks project. More time than I want to put in, I think.
|
|
|
|
|
File format for Outlook Express 5.0 DBX files
Header:
These are the values we use to see what type the file is.
0x0 Signature [16/32 bytes]
= 4A4D4636 03001000 /* OE4 SIGNATURE */
= CFAD12FE C5FD746F 66E3D111 9A4E00C0 /*OE5 Email DBX*/
= CFAD12FE C6FD746F 66E3D111 9A4E00C0 /*OE5 Folder DBX*/
As I said, we use these values to identify it, but we don't know
what these values mean
0x5C Highest Email ID [4 bytes]
This is the current highest. The next email will have a number
one higher than this.
0x7C File Size [4 bytes]
Total size of file
0xC4 Item Count [4 bytes]
Number of items stored in this DBX file. Appears to be
accurate. We use it as a second check that we haven't gone wrong
whilst reading the indexes.
0xE4 Index Pointer [4 bytes]
File offset pointing to a page of Data Indexes. This page can
even be a page of Indexes pointing to pages of indexes. This area
needs to be explored a little more
Indexes: (pointed to by the pointer in 0xE4)
This area is a little blurry, but it appears to work
0x0 Self [4 bytes] - Current Offset
0x4 Unknown [4 bytes]
0x8 Table Pointer [4 bytes] - Pointer to another of these tables
0xC Parent [4 bytes] - If this is a table of indexes which is
referenced by another table above it,
this will point to the parent's table
0x10 Unknown [1 byte]
0x11 Pointer Count [1 byte] - Number of pointers in this table
0x12 Unknown [2 bytes]
0x14 index Count [4 bytes] - I'm not sure
Size = 0x18
Straight after this comes [Pointer Count] entries like this
0x0 Index Pointer [4 bytes] - Pointer to a data block
0x4 Table Pointer [4 bytes] - Pointer to another Table of indexes
0x8 Index Count [4 bytes] - Not sure. If non-zero [Table Pointer]
has more indexes?
Size = 0x0C
These [Index Pointer] items point to offsets in the file which are
data items. At present Emails and Folders have been worked on.
Item Header:
0x0 Self [4 bytes] - current offset
0x4 Size [4 bytes] - size of block that follows
0x8 Unknown [2 bytes]
0xA Count [1 byte] - number of items in the block before the data
starts
0xB Unknown [1 byte]
Size = 0x0C
Then comes [Count] number of items:
0x0 type [1 byte] - specifies what the data is
0x1 value [3 bytes] - actual data
The following types have been found for Emails
Type - Value
0x02 -
0x04 - buffer pointer to file offset of email data
0x05 - buffer pointer to asciiz string containing the subject of email
0x06 -
0x07 - buffer pointer to asciiz message id of email
0x08 - buffer pointer to asciiz another string containing the subject of
email
0x09 -
0x0B -
0x0A - buffer pointer to asciiz message ids of parent emails
0x0C -
0x0D - buffer pointer to asciiz Name of sender
0x0E - buffer pointer to asciiz Email address of sender
0x11 -
0x12 -
0x13 - buffer pointer to asciiz Name of recipient
0x14 - buffer pointer to asciiz Email address of recipient
0x1A -
0x1B -
0x1C -
0x80 - Numeric ID (numeric)
0x81 -
0x84 - file offset to email data
0x90 -
0x91 -
The following have been discovered for Folder Items
Type - Value
0x01 -
0x02 - Buffer Pointer to Descriptive name of Folder
0x03 - Buffer Pointer to Filename of Folder
0x05 -
0x06 -
0x80 - Folder's ID (numeric)
0x81 - Folder ID of parent (numeric)
0x86 -
0x87 -
0x8A -
When handling blocks of data (as in Emails) the offset pointer will
point to the following structure:
0x0 Self [4 bytes] - current offset
0x4 Size [4 bytes] - size of block
0x8 Data Size [2 bytes] - size of data inside block
0xA Item Count [1 byte] - number of int size objects before data
0xB Unknown [1 byte]
0xC Next address [4 bytes] - File offset of next data block
Size = 0X10
Last Article:
Client/Server Socket class
|
|
|
|
|
Wow!!! That looks like fun.
Thanks for the response. I think you've given me enough to think about as to whether I want to continue on with this or to try and find a program that does what I need (or at least close to what I need).
At least now, if I look at one of the files, I should have a better idea of what is going on.
Thanks again!
|
|
|
|
|
Hi All,
Has anyone encountered:
An unnamed file was not found
error message box popup in your application before?
It happens when I run the release version of my MFC program outside of MS Visual Studio. When run inside visual studio, both debug and release versions have no errors...
Comments? Inputs?
Thanks.
|
|
|
|
|
This is MFC framework error message.
This will be occur when you try to open a file which doesnt exist physically.
If this problem occurs in InitInstance()..then manually populate the
CCommandLineInfo Object.
For more info, let us know what u r doing!
Hth,
Ramu
|
|
|
|
|
Thanks You for your help!
Thanks to your note, I found the problem in one of my destructors. It was attempting to delete a file that does not exist.
<br />
CFileStatus fileStatus;<br />
CFile::GetStatus("temp.satdef", fileStatus);<br />
<br />
<br />
<br />
if (!(fileStatus.m_attribute & 0xD0))<br />
CFile::Remove("temp.satdef");<br />
Apparently, somehow, my fileStatus check sometimes doesn't work all the time.
|
|
|
|
|
Can anyone decode this piece of code for me ??
template <typename Type>
std::list<const bla*> * blou::bli()
{
return getObjectDescriptor().template listSonsOfType<Type>( );
}
I think there must be some STL (which i do not know at all) in the thing, but i quite do not understand the last line : what´s this .template ? and what is here really returned ? is this a cast or something ??
~RaGE();
|
|
|
|
|
Well, this a rather obscure use of the template keyword caused by the extremely clumsy C++ syntax. getObjectDescriptor() returns an object of some class for which a template member function listSonsOfType is defined as in this example:
class CObjectDescriptor
{
...
template <typename T> std::list<const bla *> * listSonsOfType();
...
}; Now the line (without the template keyword)
return getObjectDescriptor().listSonsOfType<Type>( ); could be interpreted as a call to the member function or as an expression involving the operators "less than" and "greater than". In this case, the latter doesn't have any meaning, but C++ gurus found pathological examples in which both interpretations are valid. To disambiguate, one must include template .
By the way, this piece of code won't even approach to compile in VC++, which lacks template member function support.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
OK. Thank you very much.
~RaGE();
|
|
|
|
|
Can someone explain why the following doesn't compile:
#include < list >
template < class TYPE > class CNeighbourhoodArray
{
CNeighbourhoodArray()
{};
~CNeighbourhoodArray()
{};
list < int > foo_list;
};
Is it illegal in C++ to use a template class as the type of a member variable of another template class? Did that make sense ?
TIA,
Pete
|
|
|
|
|
Anonymous wrote:
Can someone explain why the following doesn't compile
what error do you get?
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Sorry, I forgot to include the error...
c:\pete\capture\vss\neighbourhoodarray.h(25) : error C2143: syntax error : missing ';' before '<'
c:\pete\capture\vss\neighbourhoodarray.h(26) : see reference to class template instantiation 'CNeighbourhoodArray<type>' being compiled
HTH,
Pete
|
|
|
|
|
This is perfectly legal, the only missing thing is the std:: prefix:
include < list >
template < class TYPE > class CNeighbourhoodArray
{
CNeighbourhoodArray() {};
~CNeighbourhoodArray() {};
std::list < int > foo_list;
};
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Doh! That'll do it.
Thanks a lot Joaquin
|
|
|
|
|
Have you checked your namespaces???
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
Suppose we are making simple client server application.
We use a function "connect()" in client source code to connect to the server. By default this function is in blocking mode. As such when we try to connect, the program sticks at a particular location and only when this function returns, the program flow continues. This function return 0 on success.
Let suppose, the socket is in non-blocking mode, as such when we use connect(), the program flow not stop as this function immediately return and our application is free to do something else. In this case the connect() function immediately returns with error something like, WSAERRWOUILDBLOCK.
Now the problem is that how we will be able to know after some time that the connection actually established or not ??
Infact in blocking mode connect() waits for a while and returns 0 on success. But in non blocking mode connect() immediately returns and does its working on background. So how we will be able to know whether connect() established connection or not ???
|
|
|
|
|
Have a look at select .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
By default, the program is in blocking mode when you use WSAConnect, connect, WSADisconnect, disconnect, etc. To be in non-blocking mode, you have to decide what non-blocking mode you want to use. There are numerous mode including WSAAsyncSelect, WSAAsyncEvent, and more complicated non-blocking mode for big servers. Once you have implemented a non-blocking mode, your network flow automatically becomes non-blocking.
For example, for a small network program such as an ftp client, chat/message program, etc. you can use WSAAsyncSelect. WSAAsyncSelect makes good use the the Windows messaging system. Once you have implemented WSAAsyncSelect, Windows sends you messaged including FD_CONNECT, FD_READ, FD_WRITE, FD_CLOSE, etc. You use the messages to determine what is going on with the network connection.
I highly recommend Network Programming for Microsoft Windows, Second Edition
by Anthony Jones and Jim Ohmund for Windows programmers.
Kuphryn
|
|
|
|