|
The 1st thing u hv to do is either create ur own wave class or get the function like what hv suggest by the guy who reply to u to do ur class. use msdn library to help you talking to ( do programming) the soundcard to buffer.u cn get msdn library online in vc++ developer centre or u jst buy the license or cd of it and can use offline.
you can take the wavein.cpp i jst posted in jst nw as a reference too. The file is about how to get the signal frm sound card to buffer.and at the same time, could u also help me to ask others how to read the buffer to display or do signal processing later? if yes, i would be very aprreciate ur help. thx a lot.gd luck..
|
|
|
|
|
Hi
I realy need help on how to change the text color of a single CListCtrl item at the list while the rest of the list needs to stay at the same color it has.
Thanks in advance
Assay
|
|
|
|
|
There are many, many good articles on doing that and more here at CodeProject. You can start with this one, and search if you need more.
|
|
|
|
|
Add a message handler as shown below and edit the code
u will get the below function , just type handler in
codeproject u get what u want
ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawMyList)
void Reports1::OnCustomdrawMyList(NMHDR *pNMHDR, LRESULT *pResult)
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
http://www.codeproject.com/listctrl/lvcustomdraw.asp
try this link
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hello,
I know php, actionscript/javascript and a basic perl. I trying now to learn visual c++ because I want to make applications. I have visual c++ but I'm not really sure what I'm doing, I have a few books from my brother (a programmer) and have tried to follow the exercises but I'm still lost.
When I write something in php or javascript I know what all of it does as I write the functions myself but with visual c++ I just drag things around and double click on them and give them names etc like the exercises say but I really have know idea where the code is or what particular file is being edited when I do try and change a value or property.
I had a look at some of the c++ files in my workspace directories and it all looks quite complicated with lots of comments saying add stuff here or 'class wizard will add properties here)'. Should I try and edit this so I understand it a bit better or will this just screw things up?
Before I started I thought it would be more like php where I write lots of functions and then just tell buttons what to do when they have been clicked but it's difficult to understand the code as it uses wierd names and ids (BTW: do ID names all have to be in UPPERCASE? I find that annoying.) for things, things I have know idea about because it was all created automatically.
Is there anyway of writing an application from scratch and doing all the code by hand so that I know what everything does? Or is this not the point of visual c++? Or maybe s.o. has links for beginners on writting applications with v. c++. Any advice would be great.
|
|
|
|
|
Stephen Bungert wrote:
Should I try and edit this so I understand it a bit better or will this just screw things up?
writing C++ apps is all about editing the .CPP and .H files. all that stuff that Visual Studio does is nice, but it only handles a very small part of the whole thing.
Stephen Bungert wrote:
Before I started I thought it would be more like php where I write lots of functions and then just tell buttons what to do
that's exactly what VC++ programming is all about. the dev environment will write stub functions for event-captures for you (button presses, paint events, etc). then you go and fill them in.
Stephen Bungert wrote:
BTW: do ID names all have to be in UPPERCASE?
no, but it's the standard. C/C++ macros (ie. #defines) are usually in all upper case.
Stephen Bungert wrote:
Is there anyway of writing an application from scratch and doing all the code by hand so that I know what everything does? Or is this not the point of visual c++?
you can write console apps (DOS window apps) with no UI from scratch with VC++ . but if you want to do anything with Windows it's best to let VC generate the skeleton app for you.
my advice: start with a "dialog app". that's an application that starts as a single dialog. it will save you from the horrors of the Doc/View paradigm. the default dialog has OK and Cancel buttons - have VC create event handlers for those two functions, then put some of your own code in there to see what they do (hint: AfxMessageBox(...); can be handy). then add some other controls and play around with them. edit controls are pretty simple. list and combo boxes are a bit more complex, etc..
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
well, I remember my first days trying to figure Vc++ out... I think part of the problem is you're coming from the php, javascript/actionscript world which is the "interpreted" language world into the C++ world, which is "compiled" code. The whole point of php and other scripting languages is to make it easy for people to generate snippets of code that accomplish certain tasks, limitted in capabilities and performance.
I found that starting out by trying to understand the win32 programming basics helps a lot when dealing with VC++. The thing is all MFC does is it makes Win32 programming a lot easier, but that is only true for those who either know their way around Win32 standard programming, or those who don't care to understand the underlying paradigms of win32 programming. You seem to be one of those who likes to understand the underlying principles before building on top of them, so I'd suggest starting with a Win32 Application project... the "Hello World" example, and don't include any MFC support in the beginning. Try to understand the concept of Window as base class for almost all other classes in the Win32 environment. Once you grasp the Window concept, how to create one, what is the message pump, what are messages, how to handle them.. then you can move on and start getting into the more advanced stuff.
Good luck!
|
|
|
|
|
i'm also a beginner of vc++ 6. i even blur of c++ indeed. i jst hv sth share wth u, duno whether can help u or nt, bt maybe can cheer u up..hehe..c++ fundamental is very important b4 u start to learn vc++ 6. the vc++ 6 bible and teach urself vc++ 6 in 21 days and the beginning of vc++ are quite a good book. some ebook like teach urself c++ in 21 days is also very useful for me to understand some basic of c++ fast.
every language is different. it takes time to learn. be patient. i believe in patient learning make ur life wonderful . i still hv one mths to pass up my vc++ project, i hope i can fulfill it with the some help of engineer as i wish. gambadei( keep up gd work)...gd luck.
|
|
|
|
|
Hi,
understanding the 'Visual' part of Visual C++ (MFC) becomes much more easier, if you learn the basics of object orientation first.
So don't start with a GUI application but create your own small console-based projects first, add some classes and let them interact.
1. Start a new console-based project
2. Add a source-code file to that project
3. Define your main() function
MyFirstProject.cpp looks like this:
#include <iostream>
using namespace std;
void main()
{
cout << "Hello World" << endl;
}
4. Create your first object (an object of the string class)
MyFirstProject.cpp looks like this:
#include <iostream>
#include <string>
using namespace std;
void main()
{
string text;
text = "Hello World";
cout << text << endl;
}
5. Extract your first function
MyFirstProject.cpp looks like this:
#include <iostream>
#include <string>
using namespace std;
void showMe(const string& Text)
{
cout << Text << endl;
}
void main()
{
showMe("Hello World");
}
6. Create your first class
MyFirstProject.cpp looks like this:
#include <iostream>
#include <string>
using namespace std;
class MyFirstClass
{
public:
MyFirstClass(const string& Text);
void showMe();
private:
string m_text;
};
MyFirstClass::MyFirstClass(const string& Text)
{
m_text = Text;
}
void MyFirstClass::showMe()
{
cout << m_text << endl;
}
void main()
{
MyFirstClass MySecondObject("Hello World");
MySecondObject.showMe();
}
7. Spread your code to different files
- Add a header file to your project
- Add another source-code file to your project
MyFirstProject.cpp looks like this:
#include "MyFirstClass.h"
void main()
{
MyFirstClass MyThirdObject("Hello World");
MyThirdObject.showMe();
}
MyFirstClass.h looks like this:
#include <string>
using namespace std;
class MyFirstClass
{
public:
MyFirstClass(const string& Text);
void showMe();
private:
string m_text;
};
MyFirstClass.cpp looks like this:
#include "MyFirstClass.h"
#include <iostream>
MyFirstClass::MyFirstClass(const string& Text)
{
m_text = Text;
}
void MyFirstClass::showMe()
{
cout << m_text << endl;
}
8. Add more classes and let them interact...
This is C++. The rest is Microsoft (MFC) specific.
I hope you got an idea of how to develop C++ programs from scratch.
Regards
Achim Klein
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
hi all,
how can i get information (in run time) about the machine which run the code,
i.e how can i know the processor model and the RAM and OS of the PC that runs the code.
so please any one knows an API or any thing like this please tell.
Note: i tried "getsysteminfo" but it gives very low level informations which i don't need.
thanks in advance
|
|
|
|
|
khalouda wrote:
i.e how can i know the processor model and the RAM and OS of the PC that runs the code.
1) HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0 registry key
2) See here
3) GetVersionEx()
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi
Im trying to draw a rectangle with rounded corners, using GDI and Win32, I can't use MFC.
But, in the parts that nothing should be drawed I still can see the image, but in pink :S
Any sugestions?
The code I'm using is
// Draw the mask
bmp = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_MASKPRUEBA));
hbmold = (HBITMAP) SelectObject(memdc, bmp);
BitBlt(hdc, 0, 0, 536, 300, memdc, 0, 0, SRCAND);
DeleteObject(bmp);
//Draw the picture
hbmold = (HBITMAP) SelectObject(memdc, bmp);
BitBlt(hdc, 0, 0, 536, 300, memdc, 0, 0, SRCPAINT);
Thanks in advance
-- modified at 14:45 Friday 23rd September, 2005
|
|
|
|
|
|
I can't use that function
Im writting #define WINVER 0x500
but nothing, all I get is
error LNK2001: unresolved external symbol __imp__TransparentBlt@44
|
|
|
|
|
link with msimg32.lib
or, you might take a look at article Q79212 in the MSDN, if you just need to make a single color transparent.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Thanks so much, that solved my problem
|
|
|
|
|
I have a desktop application that must authenticate each user.
I am not allowed to have my own password file, nor to store
passwords in a database.
The application needs to work on XP and Win2K, and
will be written in VC6++.
LogonUser looks perfect, because it lets me authenticate
the passwords the same way that Windows does when users
log in every day.
It works fine on XP. It fails on Win2K, of course, because
SE_TCB_NAME is not granted to user accounts.
Any suggestions for something similar? I do NOT
need the token that is normally generated by
LogonUser, as I'm not starting a service or
impersonating a user. I only need the BOOL that
tells me the password is valid or not.
|
|
|
|
|
mmmm... I wouldn`t like to log on on an application using my windows password... I never know what are you going to do with it.
I think you need to look for another approach.
If you need login in an application you will need an encripted passwords file.
|
|
|
|
|
Company IT policy doesn't allow me to keep
my own password file, even if it is encrypted.
We thought of using the Windows password because
it is an authenticaion system already available
in the company.
|
|
|
|
|
if the user is logged in and is using your program then they are already authenticated. If you are doing this over a network then you could use named pipes and check the user at the other end..
james
http://www.catch22.net
|
|
|
|
|
I also argued the position that logging into Windows should suffice.
After all, Office works this way. We use Outlook here, and you
need not provide a seperate password for that.
The local powers here were unconvinced, so I have been looking
for a way to do it.
Thanks.
|
|
|
|
|
|
Hi all,
How can i make my application to choose a printer other than the default printer programmatically?
thanks
kleser
|
|
|
|
|
Call:
OpenPrinter()
StartDoc()
StartPage()
EndPage()
EndDoc()
ClosePrinter()
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|