|
Budric B. wrote:
But out of curiosity do movie players use GDI? Or do they use OpenGL and write the pixels directly to the graphics card?
I believe they use DirectX, which has an intricate set of optomizations. It can give a program direct access to the screen, and I believe it can even set up a hardware pipeline to allow output from a DVD drive to be displayed without any code being executed to draw the video.
Nathan Holt
|
|
|
|
|
How do i change the window shapes to somethiing like ovals. also how do i change the Colors of controols like buttons? i trie using SetBkColor..but i din't work
|
|
|
|
|
this will change the dialog's shape to an oval
CRect rect;
GetClientRect(rect);
m_rgn.CreateEllipticRgn(0, 0, rect.Width(), rect.Height());
SetWindowRgn((HRGN) m_rgn, TRUE);
to change a button's backcolor, if you have a CButton variable assigned to it, it should look something like this: (put this in your dialog's OnCtlColor() message handler).
if(pWnd == (CWnd*)&m_button)
{
pDC->SetBkColor(RGB(0,0,255));
}
[insert witty comment here]
bdiamond
|
|
|
|
|
|
oh, I forgot. You'll have to declare this in your dialog's class definition.
CRgn m_rgn;
[insert witty comment here]
bdiamond
|
|
|
|
|
Hi,
I have an MFC application which gives problems to link (not compile).
I get the following errors:
error LNK2001: unresolved external symbol __imp__floor
error LNK2001: unresolved external symbol __imp__atof
error LNK2001: unresolved external symbol __imp__atof
I ignored the library 'msvcrtd.lib' in my project.
Any ideas how I can solves these two problems?
Greetings,
Jens
|
|
|
|
|
What version of VC++ are you using? Is it a multithreaded project?
Kuphryn
|
|
|
|
|
yes multithreaded debug
(depending on mfc)
|
|
|
|
|
Hi all,
following code produces compiler error
--header1--
template < class T > class myclass{
}
--header2--
class myclass1{
friend class myclass;//<--this line
..
}
This compiles without problems with VS2003, but produce error, that myclass is allready defined as a template with VS2005Express beta1. How should I write? (friend template < class T > class myclass fails too)!
Thanks in advance,
boni
|
|
|
|
|
The code compiles fine in VC++ .NEt 2003.
Try something like on the problematic compiler.
template <typename t="">
class a
{};
class b
{
friend class a;
};
Kuphryn
|
|
|
|
|
greetings
I am really sorry to bother you but i have a slight problem.
i am a university student in England, and i am doing a final year project
called Web based home automation which means i have to control devices over the internet.
the problem is that i have to use borland C++ to write a client/server program to be able to remotely control devices over the internet.
The problem is that i have tried to work with borland C++ version 5.01 but i am unable to do this because, although i know the basics of programming in c,c++,assembly i am someone who is aimed at automation and not really programming.
i basically need to write a simple client/server chat program in c/c++ with borland, and then elaborate on it to enable controlling devices.
please help me, i am really stressed out.
i extremely appreciate any help you can give me!
from Chris
|
|
|
|
|
You got all the way to your final year and have just realised you are not a programmer?
I suggest that you quit and find a different degree to do. Though I would be surprised that you find one where plagiarism is accepted.
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 Williams (Little Britain)
|
|
|
|
|
hahaha you're so funny!
1st: who told you thet i was in a programming course?
2nd: its nice to laugh at others problems untill you get one hey?
3rd:plagerism means cheating/copying...i am not asking for someone to write code for me, i just want some advice so if you are too good to help, MIND YOUR OWN BUSINESS!
thanks
|
|
|
|
|
porac69 wrote:
1st: who told you thet i was in a programming course?
You were asking a programming question in a programming forum. It would be easy to assume you are therefore in a programming course.
porac69 wrote:
i am not asking for someone to write code for me, i just want some advice so if you are too good to help, MIND YOUR OWN BUSINESS!
"Please do my homework for me" type requests show up here at least once per week, especially as semesters come to an end. Don't take offense to Antony's comment as it is well-founded. While yours is not the worst by far, students do come here and type in their assignments verbatim and expect to get help.
My first question would by why is using Borland C++ a requirement?
Second, how much help are you expecting to receive from a forum devoted to Microsoft Visual C++? That's not to imply that you won't get help, but just that your chances are less, compared to the help you'd receive from a forum devoted to Borland C++. Make sense?
I put together a very simple server application that listens on port 13. When it gets a request, it sends some text back to the client. I've removed the error checking for brevity.
void main( void )
{
WSADATA wsaData;
int rVal;
char Str[32];
SOCKET client;
WSAStartup(MAKEWORD(1,1), &wsaData);
SOCKET s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
SOCKADDR_IN sin, clientaddr;
sin.sin_family = PF_INET;
sin.sin_port = htons(13);
sin.sin_addr.s_addr = INADDR_ANY;
rVal = bind(s, (LPSOCKADDR) &sin, sizeof(sin));
rVal = listen(s, 2);
while (1)
{
int addrlen = sizeof(clientaddr);
client = accept(s, (struct sockaddr *) &clientaddr, &addrlen);
if (client < 0)
continue;
char *clienthost = inet_ntoa(clientaddr.sin_addr);
int port = ntohs(clientaddr.sin_port);
fprintf(stderr, "Received request from [%s] on port [%d]\n", clienthost, port);
sprintf(Str, "Hello %s on %d", clienthost, port);
rVal = send(client, Str, lstrlen(Str), 0);
closesocket(client);
fprintf(stderr, "Sent %s to client\n", Str);
}
closesocket(s);
WSACleanup();
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanks alot
its just that ive been in front of the pc screen for 3 nights without more than 2 hours sleep.
i must use borland because that is a specification i started off with.
i am not useless...i do know how to program but i am not familiar with internet programming and all those .cpp .dll . ... files make me confused, especially when youre in front of a pc for so long trying your best.
i believe no-one knows everything so why not learn from eachother?!?
thank you once again
|
|
|
|
|
well, thanx alot for your concern guys!
its just that my main problem is not the code, its trying to arrange a graphical interface for my "chat program" with borland.
i dont know how to do that and i dont know if borland 5.01 enables me to.
|
|
|
|
|
I have a USB Telephone which is basically a USB speaker and microphone.
I am having trouble setting the recording volume.
I know I need to use mciSendCommand(wDeviceID, MCI_SETAUDIO, MCI_DGV_SETAUDIO_VOLUME, (DWORD)volume); . I am having trouble finding the wDeviceID for the microphone.
I have written some test code to find the wDeviceID and device name, but even that doesn't work! Can anyone tell me what I'm doing wrong please? TIA
MCI_SYSINFO_PARMS siParams;<br />
ZeroMemory(&siParams, sizeof(siParams));<br />
char str[MAX_PATH];<br />
siParams.lpstrReturn = str;<br />
siParams.dwRetSize = MAX_PATH;<br />
siParams.wDeviceType = MCI_ALL_DEVICE_ID;<br />
<br />
for(int i = 0; i < 5; i++)<br />
{<br />
siParams.dwNumber = i;<br />
MCIERROR mci = mciSendCommand(<br />
i,<br />
MCI_SYSINFO,<br />
MCI_SYSINFO_NAME,<br />
(DWORD)(LPMCI_SYSINFO_PARMS)&siParams);<br />
TRACE("%d %02d, %s\n", mci, i, siParams.lpstrReturn);<br />
}
I feel like I'm diagonally parked in a parallel universe
Jerry Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
what about opening mci Device?
there is nice code for this in msdn:
UINT wDeviceID;
DWORD dwReturn;
MCI_OPEN_PARMS mciOpenParms;
// Opens a CD audio device by specifying the device name.
mciOpenParms.lpstrDeviceType = "cdaudio";
if (dwReturn = mciSendCommand(NULL, MCI_OPEN, MCI_OPEN_TYPE,
(DWORD)(LPVOID) &mciOpenParms))
{
// Error, unable to open device.
}
// The device opened successfully; get the device ID.
wDeviceID = mciOpenParms.wDeviceID;
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|
|
You Are Right as Always $api
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi all,
I am writing a program in vc++.
i would like to generate one time password.I have no idea.
Please help me.
rajesh
|
|
|
|
|
do you wanna know the program tools or pattern?
in first case look for rand, random, randomize and so on.
then the algorythm is following:
1. create the enumaration with the char symbols that can appear in password
2. create cycle of password length and for every iteration get random integer value which will be the index in the enumaration. add the char symbol to the end of password.
does it fast your problem?
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|
|
Friends,
I want to programatically determine whether the control is currently enabled or not. E.g
I dropped an edit box on a dialog. The object is m_myeditBox . In OnInitDialog() i made edit box, disabled by using m_myEditBoc.EnableWindow(FALSE) . Later in the program i want to determine whether the control represented by m_myEditBox is currently enabled or not. How can i do so
Imtiaz
|
|
|
|
|
Try m_myEditx.IsWindowEnabled() that should return the information you want.
Mike
|
|
|
|
|
Hi,
I've registered an application, under Windows XP, using 'instsrv.exe' and 'srvany.exe'. This all works fine, but when i stop the service i want to clean up any used resource, and this is where it gets 'tricky'. The service is completely shutdown, no destructors called or anything like that. I'm also not able to catch some kind of 'kill' interrupt using 'signal' (used to catch SIGINT (CTRL-C) interrupts).
Does anyone know a solution or another 3rd party service registration tool that provides some method of catching a stop service command?
Many thanks
Er zit een korstje op mijn aars.
|
|
|
|
|
Hi there,
I have the following (simplifed!) situation:
struct abc {
CString a;
double b;
long c;
...
};
I could do as follow:
CString s;
s.Format("INSERT INTO myTable (a,b,c) VALUES (%s,%g,%d);",abc.a,abc.b,abc.c);
and execute a CDaoQueryDef
OR ....
and here your geniality is requested!!!
Is there any way to pass in one shot the arraydo something like:
s.Format("INSERT INTO myTable () VALUES (%???);", abc); ->Would/Could it work???
^
|
which data type??
and again execute the famous CDaoQueryDef.
My "abc" struct cound cointain a good dozen of elements and passing each single one could become somehow "problematic", especially if one has different long structs;
Otherwise some additional idea?
Every suggestion is more than welcome.
Thanks and Regards
Filippo
|
|
|
|
|