Im working on my project for college and i want to know how to add sth similar to a chronometer for user to see how much time have passed while entering some characters using cin.getline function.thanks for answering.:wave:
↧
Showing the time for a user while entering some characters
↧
My code is going out of bounds
I am really unsure how to keep within the boundries and still perform the function I need.
My code functions normal when I have both categories 'buy' and 'sell' in the queue which is my main goal and I should be clocked out on this function BUT,,,
If the queue is missing all 'sell' data, it segment faults.
I don't want to change any of the functionality, just get rid of the segment fault error.
It appears b < buydat.size() and buydat[b+1] are in conflict.
The purpose of the algorithm is capture the record sets in groups of 7 from data coming in from the www as strings. In that group/set, I pattern match for the string 'Buy' and if true, insert record into vector for processing. I also need the price (y = 3)
How do I capture buydat[2] and buydat[3] in groups of 7 without a segment fault?
gentoo-mini # cat getmyData.h
When one buy and one sell are sitting in the queue. Code functions as expected:
gentoo-mini # ./masterMain
Data from the www following is as expected:
gentoo-mini # php getMyorders.php 155
BUT,,,
If I clear sell data and have only buy data in the queue, I get a segment fault:
gentoo-mini # ./masterMain
Data sitting in queue is as follows:
gentoo-mini # php getMyorders.php 155
gdb
gentoo-mini # gdb masterMain
My code functions normal when I have both categories 'buy' and 'sell' in the queue which is my main goal and I should be clocked out on this function BUT,,,
If the queue is missing all 'sell' data, it segment faults.
I don't want to change any of the functionality, just get rid of the segment fault error.
It appears b < buydat.size() and buydat[b+1] are in conflict.
The purpose of the algorithm is capture the record sets in groups of 7 from data coming in from the www as strings. In that group/set, I pattern match for the string 'Buy' and if true, insert record into vector for processing. I also need the price (y = 3)
How do I capture buydat[2] and buydat[3] in groups of 7 without a segment fault?
Code:
void buymngr(){
//vector defs
vector<std::string> buydat;
vector<std::string> markdat;
vector<std::string> pricedat;
vector<std::string> qworkcoin;
buydat = getmyData();
markdat = getmarketbuyData();
cout << "Bork!" << endl;
//This if statement was put here to try and prevent running code if missing data (seg fault patch)
//It does not work and if category 'sell' is missing, it will fail to 'True' and run anyway then segment fault
//if(!buydat.empty()){
if(buydat[2] == std::string("Buy")){
cout << "Bork2!" << endl;
for(int b = 2; b < buydat.size(); b+=7){
int y = 3; y+=7;
if ( buydat[b] == "Buy" ) {
pricedat.push_back(buydat[b+1]);
//segment fault here
qworkcoin.push_back(buydat[y+1]);
}
}
}
gentoo-mini # cat getmyData.h
Code:
#include <vector>
using namespace std;
vector<string> getmyData()
{
FILE *mydfp = popen("php getMyorders.php 155", "r");
if (mydfp == NULL) perror ("Error opening file");
char mydbuff[BUFSIZ];
vector<string> vrecords;
while(fgets(mydbuff, sizeof(mydbuff), mydfp) != NULL){
size_t n = strlen(mydbuff);
//clean '\0' from fgets
if (n && mydbuff[n - 1] == '\n') mydbuff[n - 1] = '\0';
if (mydbuff[0] != '\0') vrecords.push_back(mydbuff);
//if (mydbuff[0] != '\0') vrecords.push_back("0.001");
//vrecords.push_back("0.003");
//vrecords.push_back("0.0032");
//vrecords.push_back("0.0033");
//vrecords.push_back("0.0034");
}
cout << "I got my own data" << endl;
return vrecords;
}
When one buy and one sell are sitting in the queue. Code functions as expected:
gentoo-mini # ./masterMain
Code:
I got my own data
I just got market buy data
Bork!
Bork2!
You 'do' have buy string match data!
my max price is 0.00492975 at position 0
market max price is 0.00560504 at position 0
Highest is market!0.005605 0.00100000
php buycoin.php 155 0.005605 0.00100000 Command
0.005605 0.00100000 sendbuy
0.005605 0.00100000 mkbuybuff
0.00560505 *biggestMark
0.00100000
You bought coins, you are now top buyer
I got my own data
I just got market sell data
my min price is 0.00760479 at position 0
market min price is 0.00564973 at position 0
Lowest is market!php sellcoin.php 155 0.00564972
0.00564972
226250684
Data from the www following is as expected:
gentoo-mini # php getMyorders.php 155
Code:
224122032
2014-12-21 18:17:43
Buy
0.00492975
0.00010000
0.00010000
0.00000049
226250651
2014-12-26 10:56:48
Buy
0.00560500
0.00100000
0.00100000
0.00000561
226250684
2014-12-26 10:56:55
Sell
0.00564972
0.00100000
0.00100000
0.00000565
226250585
2014-12-26 10:56:31
Sell
0.00760479
0.00100000
0.00100000
0.00000760
If I clear sell data and have only buy data in the queue, I get a segment fault:
gentoo-mini # ./masterMain
Code:
I got my own data
I just got market buy data
Bork!
Bork2!
Segmentation fault
gentoo-mini # php getMyorders.php 155
Code:
224122032
2014-12-21 18:17:43
Buy
0.00492975
0.00010000
0.00010000
0.00000049
gdb
gentoo-mini # gdb masterMain
Code:
GNU gdb (Gentoo 7.7.1 p1) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from masterMain...done.
(gdb) run
Starting program: masterMain
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
I got my own data
I just got market buy data
Bork!
Bork2!
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b9355b in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libstdc++.so.6
(gdb) bt
#0 0x00007ffff7b9355b in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libstdc++.so.6
#1 0x0000000000404ffc in __gnu_cxx::new_allocator<std::string>::construct<std::string<std::string const&> > (this=0x7fffffffbfc0, __p=0x60a1b0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/ext/new_allocator.h:120
#2 0x0000000000404b19 in std::allocator_traits<std::allocator<std::string> >::_S_construct<std::string<std::string const&> >(std::allocator<std::string>&, std::allocator_traits<std::allocator<std::string> >::__construct_helper*, (std::string<std::string const&>&&)...) (__a=..., __p=0x60a1b0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/bits/alloc_traits.h:254
#3 0x0000000000404123 in std::allocator_traits<std::allocator<std::string> >::construct<std::string<std::string const&> >(std::allocator<std::string>&, std::string<std::string const&>*, (std::string<std::string const&>&&)...) (__a=...,
__p=0x60a1b0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/bits/alloc_traits.h:393
#4 0x00000000004041ad in std::vector<std::string, std::allocator<std::string> >::_M_emplace_back_aux<std::string const&> (this=0x7fffffffbfc0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/bits/vector.tcc:408
#5 0x0000000000403a69 in std::vector<std::string, std::allocator<std::string> >::---Type <return> to continue, or q <return> to quit--- q
Quit
(gdb)
#0 0x00007ffff7b9355b in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libstdc++.so.6
#1 0x0000000000404ffc in __gnu_cxx::new_allocator<std::string>::construct<std::string<std::string const&> > (this=0x7fffffffbfc0, __p=0x60a1b0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/ext/new_allocator.h:120
#2 0x0000000000404b19 in std::allocator_traits<std::allocator<std::string> >::_S_construct<std::string<std::string const&> >(std::allocator<std::string>&, std::allocator_traits<std::allocator<std::string> >::__construct_helper*, (std::string<std::string const&>&&)...) (__a=..., __p=0x60a1b0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/bits/alloc_traits.h:254
#3 0x0000000000404123 in std::allocator_traits<std::allocator<std::string> >::construct<std::string<std::string const&> >(std::allocator<std::string>&, std::string<std::string const&>*, (std::string<std::string const&>&&)...) (__a=...,
__p=0x60a1b0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/bits/alloc_traits.h:393
#4 0x00000000004041ad in std::vector<std::string, std::allocator<std::string> >::_M_emplace_back_aux<std::string const&> (this=0x7fffffffbfc0)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/bits/vector.tcc:408
#5 0x0000000000403a69 in std::vector<std::string, std::allocator<std::string> >::---Type <return> to continue, or q <return> to quit---
push_back (this=0x7fffffffbfc0,
__x=<error reading variable: Cannot access memory at address 0xfffffffffffffff2>)
at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/bits/stl_vector.h:911
#6 0x0000000000401e62 in buymngr () at buymngr.h:38 (actually pointing to line 18 -> qworkcoin.push_back(buydat[y+1]);))
#7 0x000000000040329f in main () at masterMain.cpp:25
↧
↧
How to disable optimization Visual C++ 2010?
I want to disable optimization in Visual C++ 2010. In gcc on Linux I could just use the -O0 switch, but in Visual C++ 2010 there are two categories of optimizations, one in the C/C++ pane and the other in the Linker pane:
Attachment 33229
So what settings should I choose to make sure that no optimization is being performed?
Attachment 33229
So what settings should I choose to make sure that no optimization is being performed?
↧
Unhandled exception Microsoft C++ exception: std::bad_alloc at memory location.
Unhandled exception Microsoft C++ exception: std::bad_alloc at memory location.
Is this a general problem with the debugger. The vs version 2012 or with my code?
Thank you
Naomi
Is this a general problem with the debugger. The vs version 2012 or with my code?
Thank you
Naomi
↧
How to reinstall VS-2012
Hi,
I uninstalled VS ultimate 2012 yesterday using force installation. Now i am trying to install it again but its saying that trial period has ended. Its asking me to enter the product key.I have downloaded a new copy of vs_ultimate.exe.
Now it has been installed & i can access it through my start as "Blend for Visual Studio 2012". However when i am executing it, its giving me the error that your trial period has ended. If any body on this forum knows the product key please provide me the product key, otherwise guide me how to solve this problem. I have windows 7 on my i5 Laptop.
Zulfi.
I uninstalled VS ultimate 2012 yesterday using force installation. Now i am trying to install it again but its saying that trial period has ended. Its asking me to enter the product key.I have downloaded a new copy of vs_ultimate.exe.
Code:
06/09/2014 11:15 PM 79,454,672 vlcmediaplayer-setup (1).exe
12/25/2014 01:30 PM 1,240,624 vs_community.exe
12/27/2014 09:10 AM 979,448 vs_ultimate.exe
05/01/2014 09:10 AM 486,848 vs_ultimate_download.exe
05/01/2014 04:22 PM 1,023,872 winexpress_full.exe
07/25/2014 10:08 PM 860,096 winzip18-dl_c.exe
11/05/2014 10:54 PM 880,584 winzip19-lan.exe
Zulfi.
↧
↧
[RESOLVED] How to reinstall VS-2012
Hi,
I uninstalled VS ultimate 2012 yesterday using force installation. Now i am trying to install it again but its saying that trial period has ended. Its asking me to enter the product key.I have downloaded a new copy of vs_ultimate.exe.
Now it has been installed & i can access it through my start as "Blend for Visual Studio 2012". However when i am executing it, its giving me the error that your trial period has ended. If any body on this forum knows the product key please provide me the product key, otherwise guide me how to solve this problem. I have windows 7 on my i5 Laptop.
Zulfi.
I uninstalled VS ultimate 2012 yesterday using force installation. Now i am trying to install it again but its saying that trial period has ended. Its asking me to enter the product key.I have downloaded a new copy of vs_ultimate.exe.
Code:
06/09/2014 11:15 PM 79,454,672 vlcmediaplayer-setup (1).exe
12/25/2014 01:30 PM 1,240,624 vs_community.exe
12/27/2014 09:10 AM 979,448 vs_ultimate.exe
05/01/2014 09:10 AM 486,848 vs_ultimate_download.exe
05/01/2014 04:22 PM 1,023,872 winexpress_full.exe
07/25/2014 10:08 PM 860,096 winzip18-dl_c.exe
11/05/2014 10:54 PM 880,584 winzip19-lan.exe
Zulfi.
↧
Copying one bmp file to another using fstream, Access violation reading location er
I would like to copy one bmp file to another using plain fstream (none 3-rd party library). I've managed to come up with something but I keep getting error:
Unhandled exception at 0x504A3442 (msvcr120d.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x00380000.
when i try to write the content of the bmp files not the header, namely error occurs in this line:
Also i am not sure if i am doing it in a right way, meaning that even after solving this error i will copy the bmp file sucessfully.
Code:
Quote:
Unhandled exception at 0x504A3442 (msvcr120d.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x00380000.
Code:
ofs_differential.write((char*)&picture, (bfh_warm.bfSize - bfh_warm.bfOffBits));
Code:
Code:
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
struct BITMAPfileHEADER
{
unsigned short bfType;
unsigned int bfSize;
unsigned short bfReserved1;
unsigned short bfReserved2;
unsigned int bfOffBits;
};
struct BITMAPinfoHEADER
{
unsigned int biSize;
unsigned int biWidth;
unsigned int biHeight;
unsigned short biPlanes;
unsigned short biBitCount;
unsigned int biCompression;
unsigned int biSizeImage;
unsigned int biXpelsPerMeter;
unsigned int biYpelsPerMeter;
unsigned int biClrUses;
unsigned int biClrImportant;
};
int readBFH(ifstream &ifs, BITMAPfileHEADER &bfh)
{
ifs.read(reinterpret_cast<char *>(&bfh.bfType), 2);
ifs.read(reinterpret_cast<char *>(&bfh.bfSize), 4);
ifs.read(reinterpret_cast<char *>(&bfh.bfReserved1), 2);
ifs.read(reinterpret_cast<char *>(&bfh.bfReserved2), 2);
ifs.read(reinterpret_cast<char *>(&bfh.bfOffBits), 4);
return ifs.tellg();
}
int readBIH(ifstream &ifs, BITMAPinfoHEADER &bih)
{
ifs.read(reinterpret_cast<char *>(&bih.biSize), 4);
ifs.read(reinterpret_cast<char *>(&bih.biWidth), 4);
ifs.read(reinterpret_cast<char *>(&bih.biHeight), 4);
ifs.read(reinterpret_cast<char *>(&bih.biPlanes), 2);
ifs.read(reinterpret_cast<char *>(&bih.biBitCount), 2);
ifs.read(reinterpret_cast<char *>(&bih.biCompression), 4);
ifs.read(reinterpret_cast<char *>(&bih.biSizeImage), 4);
ifs.read(reinterpret_cast<char *>(&bih.biXpelsPerMeter), 4);
ifs.read(reinterpret_cast<char *>(&bih.biYpelsPerMeter), 4);
ifs.read(reinterpret_cast<char *>(&bih.biClrUses), 4);
ifs.read(reinterpret_cast<char *>(&bih.biClrImportant), 4);
return ifs.tellg();
}
char* readPictureData(ifstream &ifs, unsigned int size, int cursor)
{
ifs.seekg(cursor, ios::beg);
char *picture = new char[size];
ifs.read(reinterpret_cast<char *>(picture), size);
return picture;
}
int main()
{
BITMAPfileHEADER bfh_warm;
BITMAPfileHEADER bfh_cold;
BITMAPinfoHEADER bih_warm;
BITMAPinfoHEADER bih_cold;
int cursor_warm;
int cursor_cold;
ifstream ifs_warm("1.bmp", ios::binary);
ifstream ifs_cold("2.bmp", ios::binary);
ofstream ofs_differential("differential.bmp", ofstream::binary);
cursor_warm = readBFH(ifs_warm, bfh_warm);
cursor_warm = readBIH(ifs_warm, bih_warm);
cursor_cold = readBFH(ifs_cold, bfh_cold);
cursor_cold = readBIH(ifs_cold, bih_cold);
char* picture = readPictureData(ifs_warm, bfh_warm.bfSize - bfh_warm.bfOffBits, bfh_warm.bfOffBits);
ofs_differential.write((char*)&bfh_warm, sizeof(bfh_warm)); //write header
ofs_differential.write((char*)&bih_warm, sizeof(bih_warm)); //write header
ofs_differential.write((char*)&picture, (bfh_warm.bfSize - bfh_warm.bfOffBits));
ifs_warm.close();
ifs_warm.close();
ofs_differential.close();
return 0;
}
↧
[RESOLVED] unfamiliar function declaration
I am experimenting with the c++11 regex and came across an item missing from my limited c++ knowledge.
From this article:
http://msdn.microsoft.com/en-us/magazine/dn519920.aspx
I am unfamiliar with this function with the -> operator?
Is this code the same?
James
From this article:
http://msdn.microsoft.com/en-us/magazine/dn519920.aspx
I am unfamiliar with this function with the -> operator?
Code:
auto begin(strip const & s) -> char const *
{
return s.first;
}
Code:
char const* begin (strip const& s)
{
return s.first;
}
James
↧
Clannad Visual Novel bugs help!
Hey there! :)
I have just recently started playing the Clannad Visual Novel (Full Voice version) and I have started to notice some bugs within the game. I have looked all over the place for fixes on this, however most of it seems unhelpful/unrelevent and outdated.
I have downloaded "CLANNAD Full Voice (English Version) [by selfDemanDeD]".
It looks to be that the problem lies within the SEEN.TXT file. Is I've said before, I have looked for some fixes for this, but turned no results apart from one fix for a BGM.
SO FAR I have completed Nagisa's route, Misae's route, Tomoyo's route and I think I am about currently halfway through Fuuko's route. Thus the bugs listed below may not be all, or the extent of each one, so if I find the bug outside of the ones listed below, it will be updated here.
I have found a few bugs so far which I will list below and will be updated when I find anymore, so check back if you will for any other bugs to fix:
I know this is a lot to ask of you, but I know there a few of you techy guys out there that would be willing to help an anime enthusiast, so I bid you the best of luck and the greatest gratitude ever if you could help me fix these bugs and make the visual novel even more enjoyable for me and everyone!
Once again I thank you in advance for your hard work and time!
A copy of my SEEN.TXT file (current from 02 Jan 2015) can be downloaded here: https://dl.dropboxusercontent.com/u/69370592/SEEN.TXT
It also seems that there are certain things you need in order to edit it, I have tried making them work, but I have no idea how they function. Perhaps you techy guys will have some idea.
If it helps you, here is a link to the original English Localization project - it has files stored there that may help you: https://www.assembla.com/spaces/clannad/wiki
I have just recently started playing the Clannad Visual Novel (Full Voice version) and I have started to notice some bugs within the game. I have looked all over the place for fixes on this, however most of it seems unhelpful/unrelevent and outdated.
I have downloaded "CLANNAD Full Voice (English Version) [by selfDemanDeD]".
It looks to be that the problem lies within the SEEN.TXT file. Is I've said before, I have looked for some fixes for this, but turned no results apart from one fix for a BGM.
SO FAR I have completed Nagisa's route, Misae's route, Tomoyo's route and I think I am about currently halfway through Fuuko's route. Thus the bugs listed below may not be all, or the extent of each one, so if I find the bug outside of the ones listed below, it will be updated here.
I have found a few bugs so far which I will list below and will be updated when I find anymore, so check back if you will for any other bugs to fix:
- Nagisa/Fuuko route - Nagisa's name missing from nameplate AND when said by Tomoya (it appears blank where her name should be)[Seems to only occur when Nagisa is said - Furukawa appears when Furukawa is said]
- Nagisa/Fuuko route - Tomoya's name when said by Nagisa appears as "No valid string, make a ticket about it". [Like above, this bug only happens when "Tomoya" is said - Okazaki is present when Okazaki is said by Nagisa]
- Don't know how to describe this one, but early on, sometimes Kyou's text randomly has "Tomoya" in it. Unfortunately, I do not know what situations causes this or what text should be there, sorry.
- Fuuko route - prank names are missing from the box - some of them are there but other's are not. Their "Lv" and "Mastered" still appears though. [This applies for everytime a prank choice occurs]
- Fuuko route - prank mastery achievement names are missing from all the boxes.
- Tomoyo route - when Tomoyo kicks Sunohara, sometimes a textbox-like thing scrolls across the screen that is blank. (Looks the same as a Fuuko achievement textbox.
I know this is a lot to ask of you, but I know there a few of you techy guys out there that would be willing to help an anime enthusiast, so I bid you the best of luck and the greatest gratitude ever if you could help me fix these bugs and make the visual novel even more enjoyable for me and everyone!
Once again I thank you in advance for your hard work and time!
A copy of my SEEN.TXT file (current from 02 Jan 2015) can be downloaded here: https://dl.dropboxusercontent.com/u/69370592/SEEN.TXT
It also seems that there are certain things you need in order to edit it, I have tried making them work, but I have no idea how they function. Perhaps you techy guys will have some idea.
- rlBabel.dll - Not sure what this does, but this is what seems to read the SEEN.TXT file in RealLive (I am not entirely sure about this): https://dl.dropboxusercontent.com/u/...92/rlBabel.dll
- rlDev - A program that enables the editing of the SEEN.TXT file: https://dl.dropboxusercontent.com/u/69370592/rldev.zip
- Visual Studio 2005 C++ runtime: https://dl.dropboxusercontent.com/u/...8.0Runtime.rar
If it helps you, here is a link to the original English Localization project - it has files stored there that may help you: https://www.assembla.com/spaces/clannad/wiki
↧
↧
Is there any way to change the background color of a messagebox?
Here is what I did,
Then within the callback function CallWndRetProc, I tried to change the background color of the dialog,
But it doesn't change the background color of the dialog. I wonder what is the right way to do that? Thanks.
Code:
oldHook = ::SetWindowsHookEx(WH_CALLWNDPROCRET, CallWndRetProc, NULL, ::GetCurrentThreadId());
MessageBox(...);
UnhookWindowsHookEx(oldHook);
Code:
PAINTSTRUCT ps;
HDC hdc = BeginPaint(msg->hwnd, &ps);
::SetBkColor(hdc, RGB(255, 0, 0));
EndPaint(msg->hwnd, &ps);
↧
C++ tictactoe against computer
Hello.
I# m trying to write a tictactoe game against the computer. I have an issue with my for computer move. If I place a marker on the field. It doesent react. After I set the second one it starts to place his own mark. I don# t know why and how to fix this. Here is the code:
I# m trying to write a tictactoe game against the computer. I have an issue with my for computer move. If I place a marker on the field. It doesent react. After I set the second one it starts to place his own mark. I don# t know why and how to fix this. Here is the code:
Code:
#include "Header.h"
int main()
{
srand(time(NULL));
Ausgabe();
while (true)
{
Eingabe();
Ausgabe();
ComputerZug();
}
system("pause");
return 0;
}
#include <iostream>
#include <ctype.h>
#include <time.h>
using namespace std;
char matrix[3][3] = { '1', '2', '3', '4', '5', '6', '7', '8', '9' };//Matrix mit 3mal3 Feldern, die mit Zahl 1 - 9 gefühlt werden
char spieler = 'X'; //Zeichen für den Spieler
char computer = 'O'; //Zeichen für Computer
int i, j;
void Ausgabe()//Funktion für Das Spielbrett
{
system("cls");//Jedes mal, wenn das Spielbrett neu ausgegeben wird, werden die vorigen Inhalte gelöscht
cout << "\t\t\t" << "\n\n\nPraktikum 6 Tic Tac Toe Proejct.\n\n\n";
cout << "\t\t\t" << ".---.---.---." << endl;
cout << "\t\t\t" << "| " << matrix[0][0] << " | " << matrix[0][1] << " | " << matrix[0][2] << " | " << endl;//erste Zeile
cout << "\t\t\t" << ":---+---+---:" << endl;
cout << "\t\t\t" << "| " << matrix[1][0] << " | " << matrix[1][1] << " | " << matrix[1][2] << " | " << endl;//zweiteZeil
cout << "\t\t\t" << ":---+---+---:" << endl;
cout << "\t\t\t" << "| " << matrix[2][0] << " | " << matrix[2][1] << " | " << matrix[2][2] << " | " << endl;//dritte Zeile
cout << "\t\t\t" << " --- --- --- \n\n\n";
}
void Eingabe()//Dammit beim drücken der 1, auch das X in dem Kästchen mit der 1 erscheint. Sonst würde er bei der 2 rauskommen
{
int a;
cout << "Drücke die entsprechende Zahl auf der Tastatur für die Eingabe: ";
cin >> a;
if (a == 1)
{
matrix[0][0] = spieler;
}
else if (a == 2)
matrix[0][1] = spieler;
else if (a == 3)
matrix[0][2] = spieler;
else if (a == 4)
matrix[1][0] = spieler;
else if (a == 5)
matrix[1][1] = spieler;
else if (a == 6)
matrix[1][2] = spieler;
else if (a == 7)
matrix[2][0] = spieler;
else if (a == 8)
matrix[2][1] = spieler;
else if (a == 9)
matrix[2][2] = spieler;
}
void ComputerZug()
{
srand(time(NULL));
int AI;
AI = 0;
while (AI == 0)
{
i = rand() % 3;
j = rand() % 3;
if ((matrix[i][j] == 'X') || (matrix[i][j] == 'O'))
{
AI = 0;
}
else
{
matrix[i][j] = 'O';
AI++;
}
}
}
↧
Reading an NFC DEVICE
Is it possible to read NFC card reader in VC++/MFC. Is it possible to develop a callback function that will read the NFC device, and see once the card is inserted, it takes that value from the card and store it in a DB?
↧
No problemo, just a hello
Hi...
Just want to say hi to everyone here.
I coded with BP7-for-Windows before, well perhaps 10-15 years ago so I guess everything related to Windows programming is lost:o Recently, I feel a growing need to refresh this and find this forum to be a good start:)
I've just read some forum Sticky and am going to set mode to "all ears" from now on, so it's very unlikely that I'll post a question for sometime. I hope this is allowed in here?
Warm regards,
Hendra
Just want to say hi to everyone here.
I coded with BP7-for-Windows before, well perhaps 10-15 years ago so I guess everything related to Windows programming is lost:o Recently, I feel a growing need to refresh this and find this forum to be a good start:)
I've just read some forum Sticky and am going to set mode to "all ears" from now on, so it's very unlikely that I'll post a question for sometime. I hope this is allowed in here?
Warm regards,
Hendra
↧
↧
print error
why i only printed the last input i entered
Code:
void kk::display
{
for(counter =0; counter < id; counter++);
{
cout<<"\nData is: " <<temp<<endl;
}
}
↧
MFC Proper usage of sending message to dialog to activate
I have finally got around to developing C++ & MFC using Visual Studio 2012, to build a full GUI Windows application (not sure if I have made the right choice). Though admittedly in two months time I do have
a dialog window at my beck and call.
Now I have discovered a flaw (suspect) partially caused by the design of this program not all following the same principles, nor written by the same people and long predates me. Let describe the situation.
I have a dialog I have created as a class which has a combo box. The list of items are populate during the
OnInitDialog() function just fine, except if the file where the detail is not yet read from that combo box would
not have any items other than the default. This is to be expected in the use of the program, so fine.
However, if the dialog (modeless) was already open and active, when the user went up to and selected the
menu command (main window) to read that file that CPtrList data structure that held that data would not
populate that Combo box on my dialog.
So what I would like when I am done reading the files contents is to detect if my dialog is opened and if
so send it a message to Activate (force a call to OnActivate()). I have gone to the event list for the dialog
and exposed this event handler from the resource editor just fine.
I see the syntax of OnActivate() is
void MyClass::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimalized);
So nState is an Unsigned Int of the current state of the thread/window (not sure)?
CWnd* pWndOther is the CWnd of my other Window that wants my dialog to activate I think
which is the main application since it was on the a menu that this function was called to read the file.
bMinimalized is whether my dialog is mimalized(?)
I'm missing a few pieces. What pains me is every time I do a search for answer (google is great!), I
rarely get exactly what I'm looking for and have to piece the information from multiple irrelevant
posts.
So any kind of information or directions on where to go get this info would be helpful & greatly
appreciated.
Maddog
a dialog window at my beck and call.
Now I have discovered a flaw (suspect) partially caused by the design of this program not all following the same principles, nor written by the same people and long predates me. Let describe the situation.
I have a dialog I have created as a class which has a combo box. The list of items are populate during the
OnInitDialog() function just fine, except if the file where the detail is not yet read from that combo box would
not have any items other than the default. This is to be expected in the use of the program, so fine.
However, if the dialog (modeless) was already open and active, when the user went up to and selected the
menu command (main window) to read that file that CPtrList data structure that held that data would not
populate that Combo box on my dialog.
So what I would like when I am done reading the files contents is to detect if my dialog is opened and if
so send it a message to Activate (force a call to OnActivate()). I have gone to the event list for the dialog
and exposed this event handler from the resource editor just fine.
I see the syntax of OnActivate() is
void MyClass::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimalized);
So nState is an Unsigned Int of the current state of the thread/window (not sure)?
CWnd* pWndOther is the CWnd of my other Window that wants my dialog to activate I think
which is the main application since it was on the a menu that this function was called to read the file.
bMinimalized is whether my dialog is mimalized(?)
I'm missing a few pieces. What pains me is every time I do a search for answer (google is great!), I
rarely get exactly what I'm looking for and have to piece the information from multiple irrelevant
posts.
So any kind of information or directions on where to go get this info would be helpful & greatly
appreciated.
Maddog
↧
cannot compile wizard generated project
I'm using visual studio 2010
i run visual studio and choose File->New->Project->Visual C++->MFC->MFC Application
and Follow the wizard, select a dialog based app, then use all default options.
and trying choose Build -> Rebuild Solution.
than i'v got error message like below.
>------ Rebuild All started: Project: Orcasetest4, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'Orcasetest4', configuration 'Debug|Win32'
1>Compiling...
1>stdafx.cpp
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(157) : error C2146: syntax error : missing ';' before identifier 'sin6_family'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(163) : error C2146: syntax error : missing ';' before identifier 'sin6_scope_struct'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(163) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(163) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(192) : error C2146: syntax error : missing ';' before identifier 'si_family'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(192) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(192) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(280) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(280) : error C2146: syntax error : missing ';' before identifier 'scopeid_unspecified'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(280) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(572) : error C2039: 'sin6_family' : is not a member of 'sockaddr_in6'
1> c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(156) : see declaration of 'sockaddr_in6'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(583) : error C2039: 'sin6_family' : is not a member of 'sockaddr_in6'
1> c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(156) : see declaration of 'sockaddr_in6'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxwin4.inl(188) : error C3861: 'Edit_SetCueBannerTextFocused': identifier not found
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(184) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(184) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(184) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(184) : warning C4183: 'GetIFileOpenDialog': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(185) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(185) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(185) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(185) : warning C4183: 'GetIFileSaveDialog': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(186) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(186) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(186) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(186) : warning C4183: 'GetIFileDialogCustomize': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(235) : error C2504: 'IFileDialogEvents' : base class undefined
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(236) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(237) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(238) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(239) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(240) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(242) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(245) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(246) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(249) : error C2504: 'IFileDialogControlEvents' : base class undefined
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(250) : error C2061: syntax error : identifier 'IFileDialogCustomize'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(251) : error C2061: syntax error : identifier 'IFileDialogCustomize'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(252) : error C2061: syntax error : identifier 'IFileDialogCustomize'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(253) : error C2061: syntax error : identifier 'IFileDialogCustomize'
1>test - 40 error(s), 3 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped =========
What did i wrong?
is Visual studio 9.0 Visual studio 2008?
i tried compile in mode x64 than it works.
but in Win32 it goes errors.
i run visual studio and choose File->New->Project->Visual C++->MFC->MFC Application
and Follow the wizard, select a dialog based app, then use all default options.
and trying choose Build -> Rebuild Solution.
than i'v got error message like below.
>------ Rebuild All started: Project: Orcasetest4, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'Orcasetest4', configuration 'Debug|Win32'
1>Compiling...
1>stdafx.cpp
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(157) : error C2146: syntax error : missing ';' before identifier 'sin6_family'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(163) : error C2146: syntax error : missing ';' before identifier 'sin6_scope_struct'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(163) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(163) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(192) : error C2146: syntax error : missing ';' before identifier 'si_family'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(192) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(192) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(280) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(280) : error C2146: syntax error : missing ';' before identifier 'scopeid_unspecified'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(280) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(572) : error C2039: 'sin6_family' : is not a member of 'sockaddr_in6'
1> c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(156) : see declaration of 'sockaddr_in6'
1>c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(583) : error C2039: 'sin6_family' : is not a member of 'sockaddr_in6'
1> c:\program files\microsoft sdks\windows\v6.0\include\ws2ipdef.h(156) : see declaration of 'sockaddr_in6'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxwin4.inl(188) : error C3861: 'Edit_SetCueBannerTextFocused': identifier not found
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(184) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(184) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(184) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(184) : warning C4183: 'GetIFileOpenDialog': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(185) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(185) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(185) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(185) : warning C4183: 'GetIFileSaveDialog': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(186) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(186) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(186) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(186) : warning C4183: 'GetIFileDialogCustomize': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(235) : error C2504: 'IFileDialogEvents' : base class undefined
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(236) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(237) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(238) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(239) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(240) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(242) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(245) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(246) : error C2061: syntax error : identifier 'IFileDialog'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(249) : error C2504: 'IFileDialogControlEvents' : base class undefined
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(250) : error C2061: syntax error : identifier 'IFileDialogCustomize'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(251) : error C2061: syntax error : identifier 'IFileDialogCustomize'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(252) : error C2061: syntax error : identifier 'IFileDialogCustomize'
1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxdlgs.h(253) : error C2061: syntax error : identifier 'IFileDialogCustomize'
1>test - 40 error(s), 3 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped =========
What did i wrong?
is Visual studio 9.0 Visual studio 2008?
i tried compile in mode x64 than it works.
but in Win32 it goes errors.
↧
WSAStartup best practices?
I'm writing a network-related module for a larger project. It's cross-platform, and the Windows implementation uses Winsock2.
I'm having some trouble figuring out the best way to handle the need to call WSAStartup()/WSACleanup(). If these things were reference-counted in some way, then the correct thing would be obvious; just make sure to call WSAStartup() in my object's constructor and WSACleanup() in the destructor. However, they aren't as far as I can tell, which makes calling WSACleanup() at any time perilous. An unrelated part of the code might also be trying to use sockets, and I don't want to rip them out from under it! I'm guessing, but I'm not certain, that calling WSAStartup() multiple times does no harm.
Any tips on best practices here?
I'm having some trouble figuring out the best way to handle the need to call WSAStartup()/WSACleanup(). If these things were reference-counted in some way, then the correct thing would be obvious; just make sure to call WSAStartup() in my object's constructor and WSACleanup() in the destructor. However, they aren't as far as I can tell, which makes calling WSACleanup() at any time perilous. An unrelated part of the code might also be trying to use sockets, and I don't want to rip them out from under it! I'm guessing, but I'm not certain, that calling WSAStartup() multiple times does no harm.
Any tips on best practices here?
↧
↧
Windows Program UI
I am trying to develop software for windows 7-8.1 and I want to code in C++. I have Visual Studio 2013. I know C++ on a (Console application) Intermediate level, and I feel stuck. I have a few questions about this.
-Even though I know the syntax of C++, that doesn't make me a programmer. I've tried books, but its not helping. I have ideas, but no direction to implement them. I am having a problem with learning the Windows API and the developer site for windows doesn't really help me *UNDERSTAND* the calls and functions. I feel this urge to copy and paste snippets, but have no actual understanding, and that would just wind up being a bad habit. Where do I go from here? Its just me, I am learning on my own, and where I live there is no group that codes.
-what order should I relearn C++ in? (variables, functions, enumerators, etc.....)
-Anyone have a detailed list of projects (describe a simple app) I can work through to get a functional understanding of C++?
-Even though I know the syntax of C++, that doesn't make me a programmer. I've tried books, but its not helping. I have ideas, but no direction to implement them. I am having a problem with learning the Windows API and the developer site for windows doesn't really help me *UNDERSTAND* the calls and functions. I feel this urge to copy and paste snippets, but have no actual understanding, and that would just wind up being a bad habit. Where do I go from here? Its just me, I am learning on my own, and where I live there is no group that codes.
-what order should I relearn C++ in? (variables, functions, enumerators, etc.....)
-Anyone have a detailed list of projects (describe a simple app) I can work through to get a functional understanding of C++?
↧
Old school SetWinMetaFileBits() fails after ~4K iterations. What am I missing here?
I'm suspect it might have something to do with the handle, but I can't find any good documentation on this.
Basically I have an old, legacy VC++ 6.0 app that does some work with the old metafile format. In the process of converting it to Enhanced Metafile format I call SetWinMetaBits.
As the title says, after about 4K iterations, I get a NULL handle and CANNOT recover. Whatever I do, wherever I go, who ever I see, that method will return NULL forever until I restart the app.
MODS: Looking for a way to delete this post.
I see no clear mechanism where one can delete a post. Is this possible? Thanks.
Basically I have an old, legacy VC++ 6.0 app that does some work with the old metafile format. In the process of converting it to Enhanced Metafile format I call SetWinMetaBits.
As the title says, after about 4K iterations, I get a NULL handle and CANNOT recover. Whatever I do, wherever I go, who ever I see, that method will return NULL forever until I restart the app.
MODS: Looking for a way to delete this post.
I see no clear mechanism where one can delete a post. Is this possible? Thanks.
↧
ActiveX for video server
Hello,
I would like to know in which way is the best to make ActiveX control for video. ActiveX control will need at least show picture and be able to go back in past, change resulation of picture and similar. How complex it is to do something like that? Is MFC best way to make it? Is there somewhere similar code?
Thank You all for your help.
I would like to know in which way is the best to make ActiveX control for video. ActiveX control will need at least show picture and be able to go back in past, change resulation of picture and similar. How complex it is to do something like that? Is MFC best way to make it? Is there somewhere similar code?
Thank You all for your help.
↧