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!
...+ .dat' adn creates another filestream, and another reader off that stream. here is a code snippit from where im getting the error:
BinaryWriter* br = new BinaryWriter( fs );
br->BaseStream->Seek( 0 , SeekOrigin::Begin );
br->Write( memberInfo->Count );
for( int i = 0; i <...
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();
}...
...writing location 0xcdcdcdcd."... here are my locals:
- this 0x00a731d0 {isSetup=true itsSocket=-842150451 portNum=-842150451 ...} winChatApp * const
isSetup true bool
itsSocket -842150451 int
portNum -842150451 int
bytes -842150451 int
- ip 0xcdcdcdcd <Bad Ptr> char *
CXX0030: Error...
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(...
...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* fileIo = sw->ReadLine()...
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.