|
bankman wrote:
Should I focus on DirectX? Does it support Mpeg 4?
Probably not and No. I would do a search for ActiveX controls that serve that purpose. There are a couple of direct show media applications that will play your format provided you install a mpeg4 codec. A quick search on the internet and I found one at http://ffmpeg.sourceforge.net/[^]
John
|
|
|
|
|
yes, i'm agreed the above's suggestion, but here
i'll give you suggestion that you should learn the
skills and technologies that were existed from current
all around world resources, so we all shoule learn 'get something'
behaviour to build our other more important projections,
these are bricks!!
|
|
|
|
|
I've created MFC application with Doc/View support. My view class is inherited from CRichEditView class.
I need to obtain the row and column number of the current cursor position.
The following function gets the current line number.
GetRichEditCtrl().LineFromChar(-1);
The question is "How can I get the column number"?
The ideal example is the Visual C++ IDE that shows the row and column of the cursor in the status bar. The row and column updates whenever the cursor changes.
|
|
|
|
|
A quite complicated solution :
Use GetSel to retrieve the caracter number.
Make a loop on LineFromChar with parameter the character number, which you decrement until LineFromChar changes.
Then, the first number minus the final one should give you the pos.
long int i,j;
m_RichEditCtrl.GetSel(&i,&j);
i=(i<j?i:j);
long int counter=m_RichEditCtrl.LineFromChar(-1);
while(m_RichEditCtrl.LineFromChar(i)==counter)
i--;
long int pos=counter-i;
~RaGE();
|
|
|
|
|
Got used that Microsoft Word underlines the errors in red?
Nice isn't it?
Well, when editing my C programs, the editor didn't do that. What a bore.
So, I decided to add that feature to the editor. It is very simple:
After some period of time has elapsed since the last key was pressed, save the text in a temporary file, and call the compiler to compile that file. Save the output of the compiler and parse it.
Do messages like "undefined symbol "xxx" appear?
If yes, store the line and position of the offending symbol, and when that line is displayed in the editor, underline the symbol with red.
Want to see it in action?
Download the editor with the associated compiler (no charge, no registration, no questionnaire to fill, no popups) from:
http://www.cs.virginia.edu:/~lcc-win32
It is a nice feature, that doesn't hide the fact that it is not Visual Studio of course. Maybe because of its small size this algorithm is at all doable. The compiler is small and very fast. So fast that can be used as a background compiler, running most of the time behind you when you type.
Is C outmoded?
Yes, of course. C will be always outmoded because it is not fashionable. As languages come and go away, C remains. If you write in C there is a bigger chance that your code will run in the unknown machines of the future.
You probably know C. It has be cloned a thousand times, in all tones, even in the C Sharp scale.
The whole download is 3.5 MB. And there is packed a system with all the headers and import libs to use the full Win32 API. The editor, including the debugger, the project generation facility, a versioning system, a software metrics module, an object code analyzer, etc, is 700K.
Yes. 700K.
Including a spell checker for C.
I noticed that the latest versions of Visual Studio show the current function at the top right corner of the window. Lcc-win32 has been offering this since 1999 but it shows it at the bottom right corner.
But this is publicity, and is therefore biased. Look for yourself, and tell me if you like it.
jacob
|
|
|
|
|
If you want to provide a tool, write an article and post it under the "Free Tools" section. This forum is for asking questions.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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"
|
|
|
|
|
Yes. As the above poster suggested, please write an article and post it in the free tools section. That way your article will get seen by more users. A post in a forum will only be good for a few days because no one will scroll ahead more than a few pages of posts.
John
|
|
|
|
|
OK. Thanks for this tips. I will reword it and repost it in that forum.
jacob
|
|
|
|
|
I want to add the flexibility to my application to allow the user to write and use custom functions within the application. The functions would be added to a library. I don't want to write an interpreter. One thought I had was to let the user write C functions and write them to a dll source file, then my application could shellexecute a compiler and linker to generate the dll. The application could then turn around and call the dll function. All of this would be transparent to the user.
Now for the question. Can the VS C command line compiler and linker be shipped with my app?...I think I already know the answer, it would have to be licensed.
Is there a suitable free-ware compiler and linker that I could use?
Is there another way to skin this cat?...I don't want to try a VBA interface, but that might accomondate the largest audience.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
The lcc-win32 compiler system does just that. Many people use it exactly for that. Their users type a function, then it is compiled to a dll and loaded into the system.
Lcc-win32 has also the possibility of loading an object file "on the fly", not a Dll. This eliminates a lengthy link step, and links the code "live" to the system. But that algorithm has other drawbacks. The dll way is more portable and is not so much longer to perform.
The interesting thing is that your users will say they want to debug their functions. The lcc-win32 system features a debugger too.
jacob@jacob.remcomp.fr
http://www.cs.virginia.edu/~lcc-win32
|
|
|
|
|
Thanks, sounds like what I need...I will give it a look.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
|
I am about to install the lcc-win32. I am a little leary of installing things. Will the program steal any of the file associations from VC?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
No, the VC compiler cannot be shipped with your product, unless you bundle in a copy (license) of VC.
A few options include:
1) gcc compilers (free)
2) Using the Script Host to support users writing in javascript and vbscript
3) embed your own macro language (I have done this in the past and you will want to avoid this if at all possible!)
4) programmatically post the user-entered code to a service on your web site, compile it and return the DLL as the result (or error page)
|
|
|
|
|
These have possibilities, I will have to look into them.
basementman wrote:
1) gcc compilers (free)
2) Using the Script Host to support users writing in javascript and vbscript
The others make my feeble head hurt
Thanks for your reply
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Can't say I much like the idea of "end-users" running compilers etc. unless they are technically competant, and even then this doesn't sound right.
Using the Scripting Host is one solution, then users can write in JScript, VBScript, Perl (heaven forbid) etc.
Another is a C Interpreter, which is what I do in ED (see sig). Have a look at UnderC http://home.mweb.co.za/sd/sdonovan/underc.html[^] I haven't actually used this, but I'm suitably impressed with what Steve is doing.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Neville Franks wrote:
Can't say I much like the idea of "end-users" running compilers etc. unless they are technically competant, and even then this doesn't sound right
I would be interested in your reasons why. The app would take care of setting the proper compiler and linker switches and report any errors generated by either. how is this functionally different than running an interpreter? I am not arguing with you, I never miss an opportunity to learn new things.
Neville Franks wrote:
Have a look at UnderC
Thanks for the link...looks interesting, but I am worried about speed. my program, among other things is doing rather large monte carlo dispersions. I have the same concern about the scripting host
Thanks for your reply
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Gary Kirkham wrote:
I would be interested in your reasons why. The app would take care of setting the proper compiler and linker switches and report any errors generated by either.
It seems like a lot of extra baggage and effort to distribute compilers and linkers. And potentially more difficult for the end user. Interpreters offer several advantages, one being there is no edit, compile, link, run cycle.
Interpreted code can also typically access all functions in your app. Conpiled code in DLL couldn't easilly do that.
Gary Kirkham wrote:
but I am worried about speed. my program, among other things is doing rather large monte carlo dispersions. I have the same concern about the scripting host
Scripted code is typically used for UI stuff, not CPU intensive operations. It can always call compiled code to perform such tasks.
A large part of ED (see sig) is written in its C Extension Language. This is compiled into virtual machine code which is interpreted at run time. The compiler is called on demand whenever a source file is edited, so the user doesn't even know about having to run a compiler. The Under C code is a pure interpreter with no separate compile phase that the user sees.
I think you need a clear idea of the functionality you want to provide, and how that can interact with your application code and then work out what will work for you.
Hope that helps.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
To whom it may concern,
I know people dont like to help out students. But I am a student and I the reason I am coming here to ask my question is not because I'm lazy, but because I dont know where to go to get the right information. For school, I was asked to write a database management system in C++, or in any other language of choice. I was wondering if anybody could tell me in what language it would be easier to write such system. And if so, how I could start, and if there is a helpful library that I could use to help myself, because I dont want to have to reinvent the wheel either! I would like some helpful information that helps me out to start out. Thanks everyone!!;P
GabyGirl
Ps. can anyone else give me ideas as to how to start. And... by reinventing the wheel, I mean, whether I have to design a way to store my records in arrays or something...
|
|
|
|
|
Try Visual Basic here:
http://www.freevbcode.com/listcode.asp?Category=4[^]
it is easier than C++ if you are a beginner.
jhaga
CodeProject House, Paul Watson wrote:
...and the roar of John Simmons own personal Nascar in the garage. Meg flitting about taking photos.Chris having an heated arguement with Colin Davies and .S.Rod. over egian values. Nish manically typing *censur*. Duncan racing around after his pet *c.* Michael Martin and Bryce loudly yelling *c.* C.G. having a fit as Roger Wright loads up *c.* . Anna waving her *c.* and Deb scoffing chocolates in the corner.
...Good heavens!
|
|
|
|
|
I guess I dont understand what you meant by "reinvent the wheel". The whole exercise of writing DBMS is actually to do it from scratch so students will know the hurdles of writing good DBMS. Anyway, I believe C++ is good for you especially in doing DBMS, especially it will reinforce the OO programming that, believe me, you will actually use at workplace; at least in my company we do. If you want speed over good OO design, you can always go with C. To parse SQL, unfortunately you'll have to do C (using yacc and bison). The core engine can still be in C++ though. If you dont want to use SQL, you can always go with procedural calls too. I did a simple DBMS system with SQL interface for my last semester project using C++, group of 2. It wasnt that hard at all, kinda fun actually. Just go slowly but surely; dont expect you'll get Oracle out of it. Good luck!
|
|
|
|
|
Could someone explain to be how to figure out the size of something in bits?
example:
how many bits is
char buf[1024]
float buf[1024]
double buf[1024]
int buf[1024]
I know if I have the number of bits on each on then I can divide by 8 to get the number of bytes.
Do I have the idea or am I way off?
Sorry for the newbie question
steven
|
|
|
|
|
In terms of C++ and windows OS:
char -> 8 bits
float -> 32 bits (4 bytes)
double -> 64 bits (8 bytes)
int -> 32 bits (4 bytes)
Kuphryn
|
|
|
|
|
I understand that, but if the I wanted to know the size of
char [1024] would it be (8 * 1024)= 8192 bits and 1024 bytes?
steven
|
|
|
|
|