|
i set up a program in C# using incrementing and decrementing information so i wanted to try to make this same program in C++ well so far i have it done all but the decrementer i have a
const int iPLEFT = 200; and under that i have
i have
const int iAP1 = 1; <-- i have this all the way up to 12
well the decrement i want to take the base 200 and subtract the iAP1-12 when the button is pushed
example.
i select the chosen name in my combo box then i click a button to add points. the incrementer will add 1 to the Ppoint1 label when there is 1 listed in the Ppoint1 label then i want the 200 to decrement 1 and so on.
also if anyone knows of some realy good MFC books that will help me learn and understand MFC / C++ programming. i realy enjoy learning to program so any extra information will be very helpfull
thank you for your time
|
|
|
|
|
Exactly ur stuck up in a combo box
and if u want to learn VC++ u get
lots of resources in the Codeproject
I had used
Masterin VC++ (SAMS publication)
Charls petzol but it is for SDK not MFC
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
-MFC-
http://www.functionx.com/visualc/Lesson05.htm
cma.zdnet.com/book/visualc/
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
How to Save Picture from Clipboard to file using VC++?
-- modified at 21:11 Thursday 29th December, 2005
|
|
|
|
|
This is the way u capture bitmap from clipboard.
BOOL bRes = OpenClipboard();<br />
HBITMAP hBmp = (HBITMAP) GetClipboardData(CF_BITMAP);<br />
if ( hBmp != NULL )<br />
{<br />
CClientDC dc(this);<br />
HDC hDC = CreateCompatibleDC(NULL);<br />
SelectObject(hDC, hBmp);<br />
if ( !BitBlt(dc.m_hDC, 0, 0, 200, 200, hDC, 0, 0, SRCCOPY) )<br />
AfxMessageBox("Err");<br />
}<br />
<br />
bRes = CloseClipboard();
Saving the bmp into a file is simple as well. You can look into the MSDN. or below link on codeproject for saving HBITMAP to File.
http://www.codeproject.com/bitmap/drawing2bitmap.asp
Best Regards,
-- modified at 2:24 Friday 30th December, 2005
|
|
|
|
|
Nice one.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Thank you very much! laugh:
|
|
|
|
|
does anyone how internet accelerators work, if they do, and what it would take to make a simple program to boost internet speed?
I have dsl and have seen a lot of programs that claim to speed internet speed and thought i would try to make one of my own (mostly for fun).
any help, includeing websites tutorial or ideas would be greatly appreciated.
thank you in advance for the help and happy new year!
- Kyle
|
|
|
|
|
gr8coaster329 wrote: does anyone how internet accelerators work
Generally when a big file is downloaded say 1MB, the internet explorer downloads the file using one single socket i.e. serially, The problem with this approch is that the data back should come to you without wasting the bandwidth i.e. There should be no time gab between 2 packets.
So the accelerators opens more than one socket and downloads the file from different part of the file, i.e partial download, partial download is possible in http1.1 and also the server should support the partial download.
Downloading the same file from different offset, to some extend improves the bandwith utilization and hence improves the download time.
gr8coaster329 wrote: any help, includeing websites tutorial or ideas would be greatly appreciated.
Check the GET HTTP request for more info, You might need to know the HTTP protocol for this too.
or google "partial get request"
Partial request can also be achived using FTP protocol, so the download accelerators uses either FTP or HTTP depending on the location of the content i.e. on http server or ftp server.
-Prakash
|
|
|
|
|
I need a console app (it is called from various other programs) that processes some data from various files and at times needs to send data to a (let's say generic text) printer with some printer control instructions. I cam across a sample in the help files with starts:
BOOL RawDataToPrinter(LPSTR szPrinterName, LPBYTE lpData, DWORD dwCount)<br />
{<br />
HANDLE hPrinter;<br />
DOC_INFO_1 DocInfo;<br />
DWORD dwJob;<br />
DWORD dwBytesWritten;<br />
<br />
if( ! OpenPrinter( szPrinterName, &hPrinter, NULL ) )<br />
return FALSE;<br />
.....
This seemed to do what I need. I included WinNT.h and then the fun began: Compiling just presents a long list off errors in the WinNT.h file:
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(273) : error C2146: syntax error : missing ';' before identifier 'WCHAR'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(273) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(276) : error C2143: syntax error : missing ';' before '*'
and many others.
Any ideas? Suggestions? -- Honestly I have not yet started to celebrate the new year!
Ludwig
|
|
|
|
|
Try creating a console application with win32 support.
-Prakash
|
|
|
|
|
Hi and belated Merry Christmas to everybody! I wish you all a Happy New Year and may it bring you all health and happyness and luck to your families.
Oh and yes, I do have a question: I got a VC++ 6 DLL project. Simple. Win32. How can I add a "Description", "Company Name" and "Version" to it?
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Add a Version resource to the project.
onwards and upwards...
|
|
|
|
|
Hi basementman. I can't really add a version resource 'cause as I said this is an emtpy win32 DLL project. It only holds a .cpp and a couple of Hs. Can I do it like this?? How can I add such a resource?
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Hi,
I have a this problem that I don't succeed in connecting to another computer through the net, can anyone please help me?
I have two computers in different locations:
1) Both get the ip through the local computer name and then a call to gethostbyname and inet_ntoa. Is there a better way achieving the current ip?
2) I use a hub, how can I get my real IP and not what the hub gives me?
3) On the other computer a server listens on INADDR_ANY and a certain port, when I try to connect to it with the ip found in section 1, I fail after a timeout. I tried pinging the computer with the ip found, but it was unreachable. Can it be the ip is unreachable (even when the firewall is down)? What can be the problem? The socket connects without problems to sites on the internet and to the local computer ip.
thanks in advance,
O.
|
|
|
|
|
If you are behind a NAT server, you cannot really get your public IP, except by doing something externally like doing an HTTP connect to download a webpage that simply returns your IP address. For e.g., you could connect to www.whatismyip.com and download the index page, and then parse out the IP address from there.
|
|
|
|
|
I am trying to design a simple program for keeping track of how long people are sitting at a position in a workplace. I would like to represent each person with a small square that looks like a button but can be dragged into and out of position. The button like graphic would have a space for a name and a timer. Is this just a matter of designing a small dialog box or is there some other simple way to do this using icons or cursors ??
thanks
|
|
|
|
|
How to avoid this error and send tcp pack in raw sock mode while sendto() returns SOCK_ERR and WSAEINTR "Interrupted function call." by WSAGetLastError(), although udp packs goes normally. (The code is completely functional and without errors.)
9ine
|
|
|
|
|
I want to write a CStringW string to a wfstream but it doesn't seem to work. Does anyone know how to do this?
my sipet is:
CStringW sRus(_T("ершы шы ф еуые"));
wfstream outFile;
outFile.open("C:\\Junk.txt",ios_base::out);
outFile << sRus << '\n';
outFile.close();
Chris
|
|
|
|
|
|
ChrisLang wrote: I want to write a CStringW string to a wfstream but it doesn't seem to work
The reason why is explained here[^].
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
You need to open the file in binary mode:
outFile.open("C:\\Junk.txt",ios_base::out | ios_base::binary);
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I have spent hours scouring the net for the answer to this, I do hope somebody could help me here
I'm currently coding an English-Chinese dictionary in C. This dictionary will later be embedded into a PDA with the Hopen OS (Don't worry about this). Anyway, due to this, my final code has to be contained in only 1 file, ie... no .bin or .txt
Basicaly I have included in my code a rather large word list in the following format
#define MAXCHN 100<br />
#define MAXPIN 100<br />
#define MAXENG 200<br />
<br />
typedef struct {<br />
char chn[MAXCHN];<br />
char pin[MAXPIN];<br />
char ove[MAXPIN];<br />
char eng[MAXENG];<br />
}<br />
<br />
Words words[] = <br />
{ <br />
{"°¡","a","¨¡","(interj.) | ah"},<br />
{"°¢","a","¨¡","an initial particle | prefix to names of people"},<br />
{"ºÇ","a","¨¡","(phonetic particle)"}
(please note you may need to alter your code page)
This is some 30000 lines of text.
Now this works all good and proper, but with one drawback, The size. The origional text file is only 1.6Mb, after compilation the file is some 16MB. I realised my error in that each C string is allocated what I earlier defined. So after I compile, some of the shorter lines have a mass of white space after them, increasing the size.
All the text is constant, it will not be changed at all. Basically it is just a waste of space.
Instead of literal strings I tried using pointers i.e
typedef struct {<br />
char *chn;<br />
char *pin;<br />
char *ove;<br />
char *eng;<br />
}
Though this causes buffer overruns during execution. Maybe I overlooked something but I'm pretty sure this isn't the way to go.
Any help, advice or even a head banging would be greatly appreciated. Thankyou.
|
|
|
|
|
waldermort wrote: Though this causes buffer overruns during execution. Maybe I overlooked something but I'm pretty sure this isn't the way to go.
Well, how do you allocate the different strings ?
'any way, I would try to do this in a 2 passes process; write an application that generate a dictionnary in binary format (hexa, or uuencoded ) , and include that data in your final application, use that data as the dictionnary.
or do something like ( does that work ? ):
typedef struct Word {
char *chn;
char *pin;
char *ove;
char *eng;
}
Word _word[] =
{
{"°¡","a","¨¡","(interj.) | ah"},
{"°¢","a","¨¡","an initial particle | prefix to names of people"},
...
};
now, each string ( chh, pin, ove, eng ) will have the right size.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I didnt exactly get u ? ... The size of exe is issue or memory used by program while it is running is issue ?
If both are issues go for allocating data on heap. Only allocate data for the character required at that time while deleting the previous one. I mean u will have use switches with 30,000(whatever lines of text is) cases.
I hope I have understood ur problem correctly && u have understood the solution.
Best of Luck & Best Regards,
|
|
|
|