|
Take a look at this MS article about an update to MSVCRT.DLL as shipped with VC++ 6.0 to prevent some heap compatibility problems of the C run-time library. Maybe this could fix your problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i am working with tiffs and need help on one part.
i can get the pointer to the header.
ImageHdr = (LPSTR)::GlobalLock((HGLOBAL) hTif2);
my problem is getting the pointer to the raw image.
the following works if i know what the bytesoffset should be.
i can access it using tif tags (273) the first time. but after the image is manipulated (dialated, rotated, etc) i can not find the pointer to the raw image(the image offset changes).
pImage=(unsigned char*)ImageHdr+BytesOffset;
is there a function that can give me the pointer to the raw image without using tif tags?
thank you.
|
|
|
|
|
It looks like AOL 7.0 supports some MAPI functionality in AOL 7.0.
Does anyone know if it is possible to write a subject, and the message text? It looks like these fields are being ignored, and only the recipients email is being accepted.
If not, does anyone know of a different way (other than MAPI) to create an email in a C++ program for AOL? I don't need it to actually send, just set an email up with the recipient addr, subject, and message text.
Thank you.
|
|
|
|
|
Hi.
Anyone knows how to implement Xp style progress dialog which runs from one side to the other (i.e. in the find files dialog) ?
|
|
|
|
|
I haven't tried it myself, but maybe playing with extended styles WS_EX_LAYOUTRTL or WS_EX_RTLREADING for the progress bar control one manages to have the bar drawn in right-to-left direction. From this and with a little code it's not hard to replicate the "Knight Rider car" effect you're after.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I haven't seen the XP progress dialog, but if you're looking for a progress control that works like Netscape's "infinite" progress bar, check out:/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Who can offer a design pattern to solve the following problem:
1. I have a class which is a singleton
2. this class manages a collection (map) of objects.
3. each object is a subject
4. I have another class who uses the singleton from step 1 which is an observer of the objects from step 2
5. in some point of the flow, an object from step two decided it is finished. it notifies it's observer from step 4.
6. the observer from step 4 performs some action based on the recieved notification and now it needs to delete the object that notified him that it was finished doing it's work, BUT (and here's the problem): it cannot delete it since the object from step 2 is in the middle of it's notification loop. the class from step 4 doesn't know if there are other observers and need not care about it. How can I break the notification loop and delete the object which sent the notification safly ?
Now, please don;t offer me to use a message loop or a message queue and a timer since it is out of the question for my current design.
Thanks.
Shoval Lior.
|
|
|
|
|
Do you have multiple observers that are trying to delete the object from step two, or do the other observers simply react to the notification?
If you have multiple observers, I would add reference counting to the managed object of step two, and each observer that observes this object will increment the count. Then when it gets the notification to stop observing, it will 'release' its reference count.
In your managed object of step two, when all of the references are released, then it will delete itself with delete this, or what ever other mechanism you have set up.
|
|
|
|
|
Currently there are no other observers, but some day they might be.
The main problem is not deleting the object, but breaking the notification loop.
How do I accomplish that ?
|
|
|
|
|
Hi,
could't it be done like this ?
...
5. in some point of the flow, an object from step two decided it is finished. it notifies it's observer from step 4.
6. the observer from step 4 performs some action based on the received notification and then returns a "special value" meaning that the object has to delete itself.
7. the calling object receives the "notification's return", and if it is the "special value", it deletes itself...
Lion.
|
|
|
|
|
What do you mean by "6. the observer.... returns a "special value"...."
I don't know of any way an observer can return something to the notifying subject. That's not how my Observer pattern is implemented..
Any other idea ?
Thanks.
|
|
|
|
|
The observer could notify the singleton that it is "finished" with the object. The singleton could then decide what to do - it would probably pass on the message to the object, which would inform other interested observers of the fact. The object can then delete itself. If it does so, it should inform its (other) observers that it's no longer available for use.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
All is well, but it doesn't change the fact that it still does't break the notifications loop.
Think of this as the flow of events:
1. Subject starts it's notification loop
2. it reaches my observer is the list of observers and notifies it
3. the observer then notifies the singleton needs to be deleted
4. the object is deleted
5. the function (in the singleton and in the observer) returns and the next thing to do is for the subject to continue it's notification loop on to the next observer on the list, but then the program crashes on access violation since the memory space the subject has occupied is not longer allocated since it was deleted / has deleted itself.
Please try something else.
Thanks,
Lior.
|
|
|
|
|
check out my reply to the previous message I received.
In short, it still doesn't break the notifications loop.
Thanks,
Lior.
|
|
|
|
|
IMHO there's a conceptual mismatch here that's causing your problems: You have an observer entitled to delete the subject (so it is a rather powerful observer) but that might be sharing the observation with other observers. The design seems to fail to capture the special role played by this observer. Maybe you can transfer the responsibilty of deleting subjects to the singleton class that holds them, and keep the observers as passive objects, which is (as I see it) what this design pattern originally intends.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm getting the error message:
'Cx::Cx' : cannot access protected member declared in class 'Cx'
I used the classwizard to create a CWinThread derived class Cx.
And I see that i places the construtor in the protected section.
Now I read that there were two ways to start the thread, one that uses AfxBeginThread /ResumeThread and this one:
Cx * thread = new Cx();
thread->m_x = 1;
thread->CreateThread();
I like this implimentation and would like to get it to work but I'm not sure how.
|
|
|
|
|
Anonymous wrote:
And I see that i places the construtor in the protected section
You placed your constructor in the protected section or the class wizard did?
It seems to me that the contstructor should be in the public section.
|
|
|
|
|
Thats a typo, the sentance should read:
And I see that IT places the construtor in the protected section.
it = classwizard.
>It seems to me that the contstructor should be in the public section.
Yeah, thats what i thought (which is why i included that bit of info about the location of the constructor) but thats what the classwizard does so i don't want to go and change it.
So my question in the first post still stands.
|
|
|
|
|
I am not a big MFC programmer, but MSDN says that AfxBeginThread will create the instance of the object for you.
|
|
|
|
|
I can't believe this trivial/basic task is giving me trouble! I've figured pretty much everything else out -- but .. in VC++.NET how do you properly delete a classes member functions and variables?
Travis D. Mathison ---
--- After three days without programming, life becomes meaningless ...
|
|
|
|
|
Appart from any other IDE-assisted methods, you can always go to the corresponding .h and .cpp files and manually erase the occurrences of the member.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That's what I am doing now. I'm simply wondering where the IDE assisted feature for it is ..
Travis D. Mathison ---
--- After three days without programming, life becomes meaningless ...
|
|
|
|
|
Yes, I should have guessed. I don't know, I'm sorry I can't be more helpful.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
I have been looking all over the web(or at least as far as google takes you) for the source of a tab view. All i need are these nice Execl like tabs. I found some source on the codeproject for something similar, but these flicker way too much to be usefully.
Does anyone have an idea, where I can get a source for a Tab-view.
Thank You,
SD
|
|
|
|