|
Steve Mayfield wrote:
You probably need to install V1.52, then VS6.0 and finally VS .NET
Well, I haven't have a clean WinXP system to try this way. Next time I'll have a try when I get a clean system.
When I launch the VC++1.51 setup, it pops up a message box for only Win95/98 supported.
Maxwell Chen
|
|
|
|
|
Are 6 and .net on different hard drive partitions? Just dont want to mess things up.
Thanks a lot for the replies!!
David
|
|
|
|
|
They don't need to be. I have VC6, VS.NET 2002, and VS.NET 2003 installed together on several machines. By default, they install to separate directories.
Software Zen: delete this;
|
|
|
|
|
something wrong with my func(I marked probkem arrea) :
char buf[MAXCODE];
ClearString(buf);
//Send "BEGINRECV"
if(!send(Client,"BRCV",MAXCODE,0))
return ERR;
//Request query
if(!recv(Client,buf,MAXCODE,0))
return ERR;
if (strnicmp(buf,"SUCC",4) != 0)
return NOREQUEST;
ClearString(buf);
//Send "SIZE"
if (!send(Client,"SIZE",MAXCODE,0))
return ERR;
//Request query
if(!recv(Client,buf,MAXCODE,0))
return ERR;
if (strnicmp(buf,"SUCC",4) != 0)
return NOREQUEST;
ClearString(buf);
char *recvSize;
recvSize = new char[MAXMESS];
ClearString(recvSize);
//Recieve SIZE
if(!recv(Client,recvSize,4,0))
return ERR;
if(!send(Client,"SUCC",MAXCODE,0))
return NOREQUEST;
int size = StringToInt(recvSize);
delete [] recvSize;
char *data;
data = new char[size];
ClearString(data);
// Here recv recieves "BRCV" whatever server sends. If server doesnot send anything it anyway recieves "BRCV"
// It always recieves "BRCV"
if(!recv(Client,data,size,0))
return ERR;
if(!send(Client,"SUCC",MAXCODE,0))
return NOREQUEST;
fData.Empty();
fData = data;
fData.Insert(size, '\0');
delete [] data;
//Send "ENDRECV"
if(!send(Client,"ERCV",MAXCODE,0))
return ERR;
//Request query
if(!recv(Client,buf,MAXCODE,0))
return ERR;
if (strnicmp(buf,"SUCC",4) != 0)
return NOREQUEST;
ClearString(buf);
|
|
|
|
|
have you ever tried to send a string that was containing white spaces...? the string is not sent entierly. if you do this :
strcpy(strBuf, <font style="color:purple;">"hello world!"</font>);
send(sockfd, strBuf, strlen(strBuf), 0);
you will have "hello" received, then at the next recv() call on the peer, "world!" will be get.
it looks the same thing here. are you sure you don't send a white spaced string ?
TOXCCT >>> GEII power
|
|
|
|
|
Using MFC I needed to create 10 Excel sheets within 1 workBook ! I am really having trouble doing this .
|
|
|
|
|
Please explain your "trouble" in more detail. You'll receive more help this way.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Using MFC I needed to create 10 sheets ! I am really having trouble doing this .
|
|
|
|
|
Hai
How to implement autoshape in Microsoft dhtmled control. Pls give the suggesition
|
|
|
|
|
I have a .txt file with numbers on the first line eg. 123'146'145'106'143'134'143
How do i add 1 to this number in the text file.
Useing the hole string as one big number 123146145106143134143
Also keeping the ' in the string
So 123'146'145'106'143'134'143 would be 123'146'145'106'143'134'144 or 123146145106143134144 as a hole string .
(but needs to be saved as 123'146'145'106'143'134'144 in the text file)
Also i want it so any number in each '#' can only go upto 150 ,If it gets to 150 reset it back to 0
How can i go about doing this.
|
|
|
|
|
There are several ways of going about this, but without knowing more about your requirements, some of them might not be applicable.
If the length of the string is constant, something like this:
CStdioFile file(...);
CString strLine;
file.ReadString(strLine);
int nNum = atoi(strLine[24]);
nNum += 1;
... If there is always seven groups of numbers, something like this:
AfxExtractSubString(str1, strLine, 0, 0x2c);
AfxExtractSubString(str2, strLine, 1, 0x2c);
...
AfxExtractSubString(str7, strLine, 6, 0x2c);
int nNum = atoi(str7);
nNum += 1;
if (150 == nNum)
nNum = 0; Do these help at all?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Is it possible to dock a Dialog Box just like a toolbar to anyside of the framewindow !
If yes pls tellme
Shailesh
|
|
|
|
|
I have not heared about dialog box!
But you can do this using CDialogBar. You can design the dialogbar in dialog editor and made it dockable.
search for the sample in msdn about CDialogBar.
Hope It help
Kamyar Souri
Booria CAD/CAM Systems
www.booria.com
|
|
|
|
|
I want to implement autoshapes in my sample Dhtml editor and i don't know how to do it? So can anybody help me?
Thanx...
lokesh
|
|
|
|
|
I wrote a string class and try to test with a very simple driver program, but there are some erros, can somebody help me figure out my mistakes?
thank you!
--------------Configuration: main - Win32 Debug--------------------
Compiling...
main.cpp
Linking...
main.obj : error LNK2001: unresolved external symbol "public: __thiscall myString::~myString(void)" (??1myString@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "class ostream & __cdecl operator<<(class ostream &,class myString const &)" (??6@YAAAVostream@@AAV0@ABVmyString@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall myString::myString(char const *)" (??0myString@@QAE@PBD@Z)
Debug/main.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
main.exe - 4 error(s), 0 warning(s)
____________________________________________________________________________
myString.h file:
//myString
#ifndef MYSTRING_H
#define MYSTRING_H
#include<iostream.h>
class myString{
friend ostream &operator<<(ostream &, const myString &);
friend istream &operator>>(istream &, myString &);
public:
myString( const char * = "");
myString(const myString &);
~myString();
const myString &operator= (const myString &); //assign string
myString &operator+= (const myString &);
int operator! () const; //empty string
int operator== (const myString &) const;
int operator!= (const myString &) const;
int operator< (const myString &) const;
int operator> (const myString &) const;
int operator>= (const myString &) const;
int operator<= (const myString &) const;
char &operator[] (int);
myString &operator()(int, int);
int getLength() const;
// void toUpper (myString &);
// void toLower (myString &);
private:
char* sPtr;
int length;
};
#endif
________________________________________________________________________
myString.cpp file
//myString.cpp
#include<iostream.h>
#include<string.h>
#include<assert.h>
#include"myString.h"
myString::myString(const char *s)
{
lengh = strlen(s);
sPtr = new char[lengh +1];
assert(sPtr!=0);
strcpy(sPtr, s);
}
//convention constructor
myString::myString(const myString ©)
{
lengh = copy.length;
sptr = new char [length +1];
assert(sPtr!= 0 );
strcpy(sPtr, copy.sPtr);
}
//copy constructor
myString::~myString()
{
delete [] sPtr;
}
//destructor
const myString &myString::operator = (const myString &right)
{
if(&right! = this)
{
delete [] sPtr;
length = right.length;
sPtr = new char [length+1];
assert (sPtr!= 0);
strcpy(sPtr, right.sPtr);
}
else
cout<<"Attempted assignment of a String to itself\n";
return *this;
}
//operator =
myString &myString::operator+= (const myString &right)
{
char * tempPtr = sPtr;
length+= right.length;
sPtr = new char [length +1];
assert(sPtr!= 0);
strcpy(sPtr, tempPtr);
strcat(sPtr, right.Ptr);
delete[] tempPtr;
return *this;
}
//operator +=
int myString::operator! () const{return length == 0;}//empty
int myString::operator == (const String &right) const
{
return strcmp(sPtr, right,sPtr) == 0;
}
int myString::operator!= (const myString &right)const
{
return strcmp(sPtr, right.sPtr)!= 0;
}
int myString::operator< (const myString &right) const
{
return strcmp (sPtr, right.sPtr) < 0;
}
int myString::operator> (const myString &right) const
{
return strcmp (sPtr, right.sPtr) > 0;
}
int myString::operator>= (const myString &right) const
{
return strcmp (sPtr, right.sPtr) >= 0;
}
int myString::operator<= (const myString &right) const
{
return strcmp (sPtr, right.sPtr) <= 0;
}
char &myString:: operator[](int subscript)
{
assert(subscript >= 0 && subscript< length);
return sPtr[subscript];
}
myString &myString::operator() (int index, int subLengh)
{
assert(index >=0 && index<length &&sublength="">=0);
myString *subPtr = new myString;
assert(subPtr! = 0);
int size;
if((subLength == 0)||(index + subLength > length))
size = length - index+1;
else
size = subLength +1;
delete subPtr->sPtr;
subPtr->length = size;
subPtr-> = new char[size];
assert(subPtr->sPtr!=0);
for(int i = index, j = 0; i<index+size-1; i++,j++)
="" subptr-="">sPtr[j] = sPtr[i];
subPtr->sPtr[j] = '\0';
return *subPtr;
}
int myString::getLength()const{return length;}
ostream &operator<< (ostream &output, const myString &s)
{
output<<s.sptr;
return="" output;
}
istream="" &operator="">> (istream &input, myString &s)
{
static char temp[100];
input>>temp;
s=temp;
return input;
}
________________________________________________________________________
very simple main :
#include <iostream.h>
#include "myString.h"
#include <string.h>
int main()
{
myString s1("happy");
cout<
|
|
|
|
|
So is the modified code OK now?
Maxwell Chen
|
|
|
|
|
Thanks for the help, I haven't check it yet.
but I think it will work fine.
Thanks again
from foxele
|
|
|
|
|
Can u send those modified code as attachment in header file and source file, cause I couldn't download them, I don't know why
thanks agian!
|
|
|
|
|
I did send them in attachment form. Check the lower part of the mail! There are [Download] links.
In the email...
My texts,
(blue line) Your text...
(Still blue line) Your original attachment texts...
Do you Yahoo!?
(No blue line since here) My attachments!
Maxwell Chen
|
|
|
|
|
I have sent you another email about the reason having written the email address that way ...
Maxwell Chen
|
|
|
|
|
Maxwell, did you test the myString class with your c++ compiler?
I still got the same four errors about my destructor and operator<< and constructor. If it works fine in your computer, then it is the problem of my compiler.
Please let me know .
Thank You So Much
from foxele
|
|
|
|
|
foxele wrote:
Maxwell, did you test the myString class with your c++ compiler?
I still got the same four errors about my destructor and operator<< and constructor. If it works fine in your computer, then it is the problem of my compiler.
Please let me know .
Yes, with Visual C++ 6.0, I built it, and ran it. The code compiled without any error or warning. And the output was correct ("Happy"... something).
Are you sure that you've downloaded the correct code? Or you just made a mistake that you copied the original code included in the text part of the reply? Or you didn't replace the code in the project with new one?
Check the comments in the cpp file. I have moved some comments from the end of function bodies to the beginning of function bodies. If it is such kind, then it's a new one. For example:
<br />
myString::myString()<br />
{<br />
}
To isolate the problem from your making a mistake replacing files or your compiler's got problem, this time I will send you the whole project in ZIP form.
Please visit WinZip[^] to get a zip tool. Thanks.
Maxwell Chen
|
|
|
|
|
I have created an application.While running and applcation I would like to run another application (exe) using Shell.But I want that application to run in the background i.e. no dialogs or documents associated with it.I don't want the user to know that this application is running.SO how can I create such and application that runs in the backdrop.
|
|
|
|
|
Use CreateProcess and set the wShowWindow member of the STARTUPINFO member to SW_HIDE.
Best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
I have a download function that returns the contents in a CString (it mostly downloads text), for simplicities sake I would like to use it to download JPGs (binary content) how can I get the binary contents from teh download function without messing it up when it downloads text and be able to send it to WriteBinaryToFile as the correct size.
CString Download(CString m_strURL); //returns the content
void WriteBinaryToFile(CString m_strFileName, CString m_strFileContents);
(this is specifies the binary flag in the CFile options)
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|