|
Try calling AfxSocketInit at the start of your thread.
|
|
|
|
|
CSocket uses the thread's message pump. A worker thread does not have a message pump.
Scott McPhillips [VC++ MVP]
|
|
|
|
|
hi
i wanted to know wheter i can use an Activex control without registering it??
for example use an Activex Control wich is in the same Folder??
i've built a program using an activexcontrol. but it needs to register the control first. but on a network i cant register it( i think modifing the registery is illegal)
thx
|
|
|
|
|
No, you have to register it. Run regsrv32.exe <your file>.dll on the remote machine.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Does anybody know how to get the number of files and folders on a windows machine.
Kelvin Chikomo
-- modified at 6:47 Sunday 12th February, 2006
|
|
|
|
|
Recursive FindFirstFile/FindNextFile? If you need it programatically, that is.
If you'd just like to know, you could go to the root of every partition using Explorer, select everything, and hit Properties.
Oor! If you have cygwin installed, you could count the lines of a "find" started from the root. :P
|
|
|
|
|
I need it programatically. I tried FindFirstFile/FindNextFile but recursion is a bit too slow and uses up too much resources. I thought there was a data structure for each partition that had all the partition information including number of files and folders.
Kelvin Chikomo
|
|
|
|
|
I have ClistCtrl (report view) with images. I want the images to be at the center of the column, not at left of the column.
How can I centralize the images?
|
|
|
|
|
You will need to use 'custom draw', a feature of the common controls including the list control. You can find information in the MSDN using "custom draw" as the search string. I would post a direct link for you, but the MSDN site seems to be acting up at the moment .
Custom draw lets you perform some or all of the drawing required for the control. It's easier than the 'owner draw' feature the traditional controls implemented, where you have to draw the whole thing. With 'custom draw' you can have the control do the standard drawing, and then add your piece where appropriate.
Software Zen: delete this;
|
|
|
|
|
use SetImageList()
路漫漫其修远兮,吾将上下而求索。
|
|
|
|
|
Thank you!
I understand how can I change the font of text for example, by custom draw.
But while I process the message of drawing an image, how can I draw the image (icon) at the center of the column?
|
|
|
|
|
If you know the dimensions of the icon, you can center it based on the RECT passed to the custom draw handler. Use the ::DrawIcon function to draw the icon.
Software Zen: delete this;
|
|
|
|
|
hi
i need to transfer a file from one system to another over LAN.
For that i use the code given at
http://www.thecodeproject.com/internet/SocketFileTransfer.asp.
At the receiving side while receiving it gives error WSAEWOULDBLOCK and number of bytes received -1. A blank file is created at the receiving side.
any clue please.
|
|
|
|
|
Although WSAAsyncSelect can be called with interest in multiple events, the application window will receive a single message for each network event.
As in the case of the select function, WSAAsyncSelect will frequently be used to determine when a data transfer operation ( send or recv) can be issued with the expectation of immediate success. Nevertheless, a robust application must be prepared for the possibility that it can receive a message and issue a Windows Sockets 2 call that returns WSAEWOULDBLOCK immediately. For example, the following sequence of events is possible:
1.Data arrives on socket s; Windows Sockets 2 posts WSAAsyncSelect message
2.Application processes some other message
3.While processing, application issues an ioctlsocket(s, FIONREAD...) and notices that there is data ready to be read
4.Application issues a recv(s,...) to read the data
5.Application loops to process next message, eventually reaching the WSAAsyncSelect message indicating that data is ready to read
6.Application issues recv(s,...), which fails with the error WSAEWOULDBLOCK.
Other sequences are also possible.
I Hope this Helps..........;)
kss
|
|
|
|
|
It has been such a very long time since I've coded the Win23API and now my memory escapes me. I want to iterate open windows (enumwindow) get their hWnd and then present them in a form with a checkbox next to each window. When the user puts a check in the box it will "Remove From Taskbar" when the remove the check it will "Show In Taskbar". I know how to do this inside the application but I cannot seem to find any documentation for how to do it to an application you don't own. It's been since 1999 that I did this stuff and I just don't remember now...
Clues???
I only read CP for the articles.
Code-frog System Architects, Inc.
|
|
|
|
|
There are a couple of window styles you can twiddle - WS_EX_APPWINDOW and WS_EX_TOOLWINDOW . There's also a COM interface for manipulating the taskbar: ITaskbarList .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
hello,
is there a non-registy way to change the default location of the special folders, like Favorites or Temporary Internet Files? Something that will complement the SHGetFolderPath function?
_KANE_
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
|
I know the difference between std::string and std::wstring etc, but I was wondering if there was a standard header file like tchar.h for defining a code neutral way of coding that would automatically select the proper string type to use depending on the UNICODE preprocessor define. I can easily roll my own, but is there a standard one?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I haven't found any! I have created an incomplete header that contained code like this:
typedef basic_string<TCHAR> tstring;
|
|
|
|
|
George L. Jackson wrote: I have created an incomplete header
Could you send it my way?
If so just send it to the email address you find in the emailed reply notification you get with this message.
Thanks
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I will need to look for it. I have not used it for some time since I only program on 32-bit platforms and only use Unicode. I think it might be at work.
|
|
|
|
|
Also, I just remembered a couple of problems I ran into using the header file.
The filename argument for file streams are always narrow, and support for multi-byte character strings is limited. However, I wrote the header file for vc++ version 6. I haven't used it with the new versions since I have been using MC++ or C++/CLI almost exclusively.
|
|
|
|
|
|
I decided to roll my own. It may not be perfect but I thought I would post here for posterity's sake.
#pragma once
namespace std
{
#if defined UNICODE || defined _UNICODE
typedef wstring tstring;
typedef wstringbuf tstringbuf;
typedef wstringstream tstringstream;
typedef wostringstream tostringstream;
typedef wistringstream tistringstream;
typedef wstreambuf tstreambuf;
typedef wistream tistream;
typedef wiostream tiostream;
typedef wostream tostream;
typedef wfilebuf tfilebuf;
typedef wfstream tfstream;
typedef wifstream tifstream;
typedef wofstream tofstream;
typedef wios tios;
# define tcerr wcerr
# define tcin wcin
# define tclog wclog
# define tcout wcout
#else // defined UNICODE || defined _UNICODE
typedef string tstring;
typedef stringbuf tstringbuf;
typedef stringstream tstringstream;
typedef ostringstream tostringstream;
typedef istringstream tistringstream;
typedef streambuf tstreambuf;
typedef istream tistream;
typedef iostream tiostream;
typedef ostream tostream;
typedef filebuf tfilebuf;
typedef fstream tfstream;
typedef ifstream tifstream;
typedef ofstream tofstream;
typedef ios tios;
# define tcerr cerr
# define tcin cin
# define tclog clog
# define tcout cout
#endif // defined UNICODE || defined _UNICODE
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
-- modified at 2:20 Sunday 12th February, 2006- 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
-- modified at 1:28 Sunday 12th February, 2006
|
|
|
|