|
|
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.
|
|
|
|
|
Blake,
Thankyou for your invaluable advice!
Jon
using System.Beer;
|
|
|
|
|
Hi,
I wanted to display images(*.bmp, *.jpg, t.tiff...) in a dialog box, I came across CxImage in one of the articles in the code project,But I do not know how to attach it to my project and how to use it. Can anyone please help. Or does anyone know...how to use GDI+ for displaying images.
Thanks
|
|
|
|
|
hi
If you already have bmp images, u can easily add to the Dialog using "Microsoft Forms 2.0 Image" .It is a activeX Control.
|
|
|
|
|
Who know, why Visual C++ generates other function name, but I use extern "C"
I use Visual C++ 2003 and try to export function from DLL. I declare function:
extern "C" __declspec(dllexport) char* __stdcall GetUserFromAdir(HWND ParentWindow);
When I view DLL by TDUMP (TDUMP is a utility from Borland Delphi), I see, my function GetUserFromAdir has other name (_GetUserFromAdir@4)
How shall I solve this problem?
|
|
|
|
|
Gasanov wrote:
How shall I solve this problem?
What problem? The "@4" indicates the size of the parameters (in bytes). Had your function used void , you would see "@0" instead.
I think if you use the __stdcall calling convention, it will decorate the name. Use the .def file like Blake suggests to undecorate the name.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I think he expects the completely undecorated name, so that GetProcAddress can work.
I usually do not add the 'dllexport' part and put the undecorated name into a DEF file. Always works for me.
|
|
|
|