|
Sorry. Somehow this ended up in the C++ forum. I didn't notice.
"My brother says 'Hello'... So hurray for speech therapy!" -Emo Phillips
|
|
|
|
|
Michael Dunn wrote:
This topic belongs in the Soapbox.
Here's a funny thing. I run several CP windows open in the morning as I catch up, so I saw this at the top, responded to it, and then thought 'what are all these programming questions doing in the soapbox ?'.
Christian
P.S. Although I love helping people through the CP message boards, the amount of abuse I have copped in recent times forces me to adopt a policy where I will only answer questions put to me through the boards. It is also to your benefit to ask on the site, I don't know half of everything, and a publically posted question will get you more than one person trying to help. I would especially prefer to live in a world where no-one ever sends me a zipped project with instructions on wh
|
|
|
|
|
Christian Graus wrote:
'what are all these programming questions doing in the soapbox ?'.
ROTFLOL
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
I thought the same thing, when Micheal told me to put it in the soapbox. I thought "I wonder why people are answering programming questions in the lounge."
"My brother says 'Hello'... So hurray for speech therapy!" -Emo Phillips
|
|
|
|
|
Are you an Extreme fan, or did you come up with 'Politacalamity' independently of their brilliant 'three sides to every story' album ?
Christian
P.S. Although I love helping people through the CP message boards, the amount of abuse I have copped in recent times forces me to adopt a policy where I will only answer questions put to me through the boards. It is also to your benefit to ask on the site, I don't know half of everything, and a publically posted question will get you more than one person trying to help. I would especially prefer to live in a world where no-one ever sends me a zipped project with instructions on wh
|
|
|
|
|
Check out my review[^] on Amazon.com
It's about the third review down...
"My brother says 'Hello'... So hurray for speech therapy!" -Emo Phillips
|
|
|
|
|
Cool review. I hated the fourth album actually, but Pornografitti and II sides... are classics IMO.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi,
I have an onwer drawn button. I have noticed that when I tab, I do not see that it has "focus." What do I have to handle ( message wise) and besides drawing the dotted focus rectangle in the Drawitem to make the button show that it has focus when I tab through the different windows?
Thanks.
|
|
|
|
|
A control needs to have the WS_TABSTOP style for it to be included in the tab order.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Aarrgh!!
How can I get the file names from a dir?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
there are many articles on CodeProject that demonstrate this (look in the Files and Folders section, and, here's mine). or, if you want to do it yourself, you can use FindFirstFile or _findfirst.
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
But if I want to get the file names from only "C:\Pictures\MyNewPic" only... how can I specify a dir so all these findfile functions only searches one dir?
I can't explain better I think!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Read the MSDN docs on FindFirstFile or _findfirst.
--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
|
|
|
|
|
I assume you want this? sometimes I find I need to attach to the directory and not use a path.
hFind = FindFirstFile("C:\\Pictures\\MyNewPic\\*.*", &FindData);
bOK = (hFind != INVALID_HANDLE_VALUE);
while(bOK)
{
bOK = FindNextFile(hFind, &m_FindData)
}
|
|
|
|
|
bOK = FindNextFile(hFind, &FindData)
I MUSt learn to type, and too proof read!
|
|
|
|
|
Ted Ferenc wrote:
FindFirstFile("C:\\Pictures\\MyNewPic\\*.*", &FindData);
Ooh!
So I can just do that, okay... I didn't understand it when I read in MSDN Library.
Thank you!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I want to make a proxy scaner, but I don't know how to open a socket.
I want to make connection to some computer and try to make a TCP/IP connection to a definite port. If I can connect to try whether It is a proxy server.
But I do not know how to make this in MFC.
Can someone help me?
Trin2
|
|
|
|
|
ummmmm i would suggest u do some reading about tcp/ip and the various protocols b4 taking on this level of project if u dont understand how to open a socket
try www.w3c.org and look up some rfcxxx docs
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
lauren wrote:
try www.w3c.org and look up some rfcxxx docs
Now that's the nicest way I've seen somebody tell somebody else to sod off in a while
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Hi everyone. I have a question about the use of CFile. I have the code below, and the filename is that of a file which I have tested and determined exists, and is not shared. The file is an HTML file, and I want to take the contents of the HTML file (the text), and put it into a CString. The string will then be parsed and the hyperlinks extracted.
<br />
CFile cFile;<br />
CString strFileContents;<br />
<br />
cFile.Open(m_strFileName, CFile::modeRead | CFile::shareExclusive);<br />
cFile.Read(&strFileContents, cFile.GetLength());<br />
cFile.Close();<br />
The problem with the code above is that when the Read is performed, the program crashes. I tried using an old style C string in place of a CString, the data is read but a bunch of garbage chars are at the end of the string, and the program crashes when I hit Close(). Anyone know what I am doing wrong? I really want the file contents in a CString, because the necessary memory is allocated dynamically, and the CString Find functions are great for parsing.
|
|
|
|
|
First of all, you can't put the whole file in a single CString object.
You may try to read the file line by line.
You do not use the Read function correctly, first parameter is the block you read, the second is the size of that block. Usualy used for reading a binnary file.
Good Luck!
Trin2
|
|
|
|
|
CSting doesn't allocated anything till you initialize it.
Since you didn't allocated, you got crash.
Change your code to the following:
cFile.Read(strFileContents.GetBuffer(SIZE), cFile.GetLength());
After finishing working with the string call
strFileContents.ReleaseBuffer();
|
|
|
|
|
Excuse me.
Today,I study the WTL Library's CSimpleArray class source code,I find the following code:
<code>template<class T>
class CSimpleArray
{
T* m_aT;
...
class Wrapper
{
public:
Wrapper(T& _t) : t(_t)
{
}
template <class _Ty>
void *operator new(size_t, _Ty* p)
{
return p;
}
T t;
};
void SetAtIndex(int nIndex, T& t)
{
new(&m_aT[nIndex]) Wrapper(t);
}
...
}</code> I can not understand the syntax about "new(&m_aT[nIndex]) Wrapper(t)" ,anyone can explain it? thanks first.
SIMPLE IS BEAUTY
|
|
|
|
|
ZBUILDER wrote:
I can not understand the syntax about
ZBUILDER wrote:
new(&m_aT[nIndex]) Wrapper(t);
returns the pointer and that new allocates using that pointer
* * * Code the dreams * * *
|
|
|
|
|
Then What about Wapper(t)?
And How does it modify the Adderss of &m_aT[nIndex]?
SIMPLE IS BEAUTY
|
|
|
|