ok, i found out what happend... it dosent like having two filestreams at on the same file at a time.. so, i just made an ArrayList() of all the filestreams that i ever opend, and when i need that file, i just take them outta my ArrayList()... thanks anyway!
hello! i just have a quick question: why would it come up with a
"cant onpen file because it is being used by another process" exeption? i have some code (much to0 big to post here) that makes one filestream (set to 'index.dat'), then one binaryreader from that stream. the reader reads...
hello agin... it turns out it dosent work... and i think it has to do with my member vars not working rihgt... im using MFC with VC++2003.net, and i added the var by right-clicking the controll, selecting value on a drop-down list, then typing in the var name... but, no-matter what i do, the...
oh! sorry, here is my decleration:
class winChatApp
{
public:
winChatApp(int,char*);
~winChatApp();
bool isSetup;
char* rev();
bool send(char*);
private:
int itsSocket;
int portNum;
int bytes;
char* ip;
char* lastSnd;
char* lastRcv;
int startupClient();
void shutdownClient();
}...
well... thanks both of you, but i get "Unhandled exception at 0x004a3520 in chat client.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd."... here are my locals:
- this 0x00a731d0 {isSetup=true itsSocket=-842150451 portNum=-842150451 ...} winChatApp * const
isSetup true bool...
thanks, but i still get an accses violation with this code:
void chatAboutDlg::OnBnClickedSend()
{
int iSize;
char* p;
iSize = ipAddress.GetLength(); //get size of string
p = (char*)malloc(iSize); //initialize char* to size of string
strcpy(p,ipAddress);
free(p);
winChat = new...
i am shure there is an eventhandeler for close. if your using .net, i would try OnExit, or OnClose or somthing along those lines. im sorry i cant look into it further becuse i dont have any compiler handy right now...
oh, sorry, this is the code:
FileStream* fs = new FileStream("c:\\database.txt",FileMode::Open);
IO::StreamReader* sw = new StreamReader(fs);
String* fileIo = sw->ReadLine();
bool end = false;
while(end == false)
{
String* line = sw->ReadLine();
cout<<line;
if(...
ok, i have VC++ .net 2002 and i am trying to parse a text file. so far i cant use the way i used when i wrote this in C# with the streamreader. this is my code:
FileStream* fs = new FileStream("c:\\database.txt",FileMode::Open);
IO::StreamReader* sw = new StreamReader(fs);
String*...
to get the ADCII avlue, just assing the cahr to an inmt:
char* str = "HELLO WORLD!";
int ele5 = str[4;
ele5 will be the ASCII value of the 5th element. or, im shure you could cast it like:
(int)str[4];
hope this helps,
~metalhead
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.