|
Hello,
I have a SDI project, where from a menu selection I create many modeless dialog Windows. I dont have focus on any particular user dialog box, but if I happen to press the Enter key, the Window closes...but the program thinks it is still open. I have code already that allows me to close each Window, but that is not causing this problem. I am not sure where in the code I am where I click the Enter key.
Does anyone know how I might cure/find this problem??
Thanks,
Jerry
|
|
|
|
|
Does this help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
I asked this question in the C# forum because it's something I'm doing in C#, but I'm just wondering if any C++ afficionados have already done this one. Through C# I'm using the SendMessage API to be able to have subitem images. But I don't want images in the first column of the listview. the subitem images show up fine, but there's an empty gap for an image in the first column of the listview for an image that I don't plan on putting there. Does anyone know how to get around this? Thanks in advance.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
BlackDice wrote:
But I don't want images in the first column of the listview.
You're out of luck with that one. The only way I know of to prevent that is to make the list owner-drawn and draw it all yourself.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello
I'm programming a universal audio tagger for windows. I'm looking for an easy to understand code example for writing Ogg Vorbis comments in C++.
I've already implemented LibVorbis 1.0.1 and I'm using OggVorbis_File to Read the comments. (No problem there) Unfortunately I was unable to find a good code example of how to use the LibVorbis library to Write Vorbis comments. I think I have to use something like vorbis_comment_add(...), but I have no clue how to do it.
Any help is very welcome!
|
|
|
|
|
|
Unfortunately I had a very good look at the documentation and spent a whole day searching with google, but was still unable to find a good C++ example for implementing Write-Functions with LibVorbis!
Any more help would be great!
Thanks
|
|
|
|
|
Ask on a Ogg specific mailing lists. You are more likely to find someone who knows what how to do this there.
Show them what you have tried, so they can point out what you are doing wrong. Your first question looks like someone who didn't read the book, and that will make them mad. Your second question makes it clear that you read the book (the right one?), so the book needs to be fixed.
Before doing that though, try it. Write a somple C program, and try calling that function with all the options you can think of to see what happens. Then look at the results elsewhere to see what really happened.
|
|
|
|
|
Hi all,
Are there any sample code for implementing a HTTPS server on window platform ? Since my application will be deployed on Window9x and Window XP home edition, so IIS is not available.
Thanks
|
|
|
|
|
I don't know of any HTTPS server source code, but this site has HTTP server source code, mabye you could modify it to work for HTTPS.
http://www.vijaymukhi.com/vmis/vmchap4.htm
Mabye www.sourceforge.net might something HTTPS also
wWw.KruncherInc.cOm
|
|
|
|
|
On top of the previous message, have a look at the OpenSSL[^] project. The source is a bitch to wade through, and I'm not sure if it runs on Windows, but have a go. HTTPS is basically just encrypted HTTP with authentication through a different port (443 usually).
Of course, the other possibility is to distribute something like Apache, which is free, supports SSL and is available on any Windows platform.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello,
In one of my VC++6 projects I need to save image into BMP file. I have window’s handle (HWND hwnd), device context handle (HDC hDC) and bitmap handle (HBITMAP hbit). What API function do I need to call to save image from this form into ‘filename.bmp’ file?
Thanks for help,
Regards,
Leonid
|
|
|
|
|
If you Know COM, use IPicture Interface.
there is no direct function/ApI for saving file in bmp or other related format,you have to look for related Library for that,one of best library is CXImage serach for it at this site
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I want to write data to a file one byte at a time. I am having a problem that for some reason the write function is writing 2 bytes instead of one. Here is the code.
int begin, end, dummy;
begin = ftellp(); //get the current position
bin3ds2.write ( &ch, 1 );
end = ftellp( file ); //get the current position
if( end - begin != 1 ) {
++dummy //a breakpoint is here
}
If it works correctly end - begin should always be one, but sometimes it's two. I think that something else in my code might be causing this to happen, but I don't know what. Can anyone help me with this. I have been strugling with this for a while, and I can't seem to solve it. I think I need someone else to look over my code. Thanks.
|
|
|
|
|
I don't know for sure, but maybe you'd have to check out whether you're opening the file in text, rather than binary mode.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
I changed my call to open to this:
studio.bin3ds2.open( ofn.lpstrFile, ios::out || ios::binary );
It still has the same problem.
|
|
|
|
|
You should use | (bitwise OR) instead of || (logical OR). Try this and please let me know if it worked.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
I have been stuck on this problem for a week. I really need help on this.
It is a MFC base multi-threading application. There is a shared thread to dealing with all logging message. When I open only one dialog window and send message to the log thread to send an email, there is no problem at all. If I open one more dialog window(same class as previous one), and do the same thing again, an exception occured. I found out the problem is on an assertion in class CMimeMessage about interface IMultiLanguage while it is being initialized. CoCreateInstance() function for ComPtr<imultilanguage> in CMimeHeader can be called successfully only once.
If anybody know how to solve it, please help me. Thanks a lot.
Maggie
|
|
|
|
|
Hi,
I've got a worked thread that wakes up every second and does some really quick processing. But, when certain events happen in the UI thread I need to gracefully close the worker thread.
I've got this working, but the way i'm doing it seems a bit rubbish. Is there a better way?
I created 2 events:- "eventThreadShouldStop" and "eventThreadHasStopped".
my thread loops with a while(WaitForSingleObject()) on the eventThreadShouldStop event. When that event is set, the thread finishes up tidily. After it's finished up, it sets the eventThreadhasStopped event, which signals back to my main thread the the worked thread has finished.
So, just to cleanly stop a thread, i've having to use 2 separate event objects.
Is there a better way of doing this? Surely it's a frequent thing to do- signal to a thread it should end, and wait for it to end?
Jon
using System.Beer;
|
|
|
|
|
It seems alright to me. I would do this in the same fasion.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I second the above comment... I have done exactly this in the past but now I use a threadpool insead which will allow me to handle more than one background job. If you want more info on this I recommend this article: http://www.codeproject.com/threads/threadlibrary.asp
John
|
|
|
|
|
You can eliminate the eventThreadHasStopped event if you cause your main thread to wait on the thread handle instead. You get the thread handle when the thread is first created. So, after the main thread sets the eventThreadShouldStop it can wait on the thread handle instead of the eventThreadHasStopped. The thread does not need to do anything but exit cleanly, and then the main thread will unblock and continue running. The way you are doing it is fine too, if you do not have the thread handle. I have done what you did many times and it works fine.
|
|
|
|
|
That's interesting.
Should i ::DuplicateHandle on the handle first? I worry that if the thread exits between me setting the event that it should exit, and the main thread calling waitforsingleobject(), then i could end up with my main thread blocking forever.
Jon
using System.Beer;
|
|
|
|
|
Once you have the thread handle from the thread creation, even if the thread exits before your main thread has a chance to start waiting, the thread handle will still be signaled and your main thread will not block or wait on it, you will just see the WAIT_OBJECT_0 immediately.
Your only danger is if you wait on the thread handle and the thread fails to get created successfully. Provided the thread actually ran, the thread handle will become signaled when the thread exits, whether or not you had started to wait on it yet or not.
|
|
|
|