|
hi.
Im trying to use ReadDirectoryChangesW() win32 call with an IO completion
port on Win2k server SP2.
I use a big buffer (256K) to lpBuffer param.
if i use a Local drive("C:\tmp\") it works fine, but on a nerwork("\\myhosts\tmp\") drive, it fails and the getlasterror() return 87 (The parameter is incorrect).
Otherwise, if the buffer is small (4K), it works fine (network and local).
Thank You a lot!
|
|
|
|
|
I was under the impression it wouldn't work across the network, but I couldn't find any documentation that said it didn't. Hmmm, guess I didn't help much, did I?
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
No, Becouse if the buffer is small (4K), it works fine (network and local), and a big buffer in a local drive ("C:\monitor\") works fine, the problem is a big buffer on a network drive.
Thz.
Juan Carlos S.M.
|
|
|
|
|
Hi, everyone!
I want to send a HTTP request to a Web Server, the body of
the request is NULL and I want to add some customer defined
header fields into the HTTP request header.
I have find some methods, but they are not in detail.
Are there some sample codes?
Cheers,
George
|
|
|
|
|
> telnet www.myserver.com 80
Trying 207.219.70.31...
Connected to www.myserver.com (207.219.70.31).
Escape character is '^]'.
GET /index.html HTTP/1.1
host: test
mycustomheader: wassup!
mycustomcoookie: chocolate-chip
myrootpassword: c0deproj3ct
Hit enter twice and away you go...
Todd Smith
|
|
|
|
|
I have a bmp that I want to put onto a toolbar buton. How do I do this? Additionally, if it were a *.ico file, how would I do the same?
Appreciate your help,
ns
|
|
|
|
|
Lets say I want to do simulations on a group of animals of class CAnimal. First I define a group of dogs of class CDogs inheriting from CAnimals. Then I want to do the same with cats of class CCats, also inheriting from CAnimals, etc.
Lets say we have the following setup:
- A CAnimal object has member data and a set of pure virtual functions
- A CDog or CCat has only static member data in addition to member functions, including the virtual functions from CAnimal.
I would now like to have the ability to change between dogs and cats, i.e. redefine all my CAnimals from being dogs to cats. If I don't make my CDog and CCat destructors virtual, I can delete the dog/cat part and keep the CAnimal base class, but how can I change type?
I guess one way to do it is to take my array of dog objects and make a new array of cat objects and copy the animal part from dog to cat using assignement operator, and then delete may dog array. Or are there more elegant ways..?
Regards, Haakon S.
|
|
|
|
|
I don't thing you can dynamically change the type of an object at runtime, you will need to do this by hand, like you suggested.
Max.
|
|
|
|
|
This can be done (if I understood your question) implementing an idiom called envelope/letter. Define CAnimal as an envelope class, i.e. a class that forwards all requests to another object:
class CAnimalImpl;
class CAnimal
{
void method1(){impl->method1();}
...
int methodn(...){return impl->methodn(...);}
void setImpl(CAnimalImpl *impl){this->impl=impl;}
}; Now, move the definition of your dogs and cats classes to CAnimalImpl , whose signature mimics that of CAnimal :
class CAnimapImp
{
virtual void method1()=0;
...
virtual int methodn(...)=0;
};
class CDog: public CAnimalImp
{
...
};
... Now, you have the ability to turn a dog into a cat simply by calling setImpl . Some details remain to make this robust, like for instance deciding whose responsibility it is to destroy CAnimalImpl s, and define proper copy constructors.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Very interesting!
This could be what I'm looking for. But it doesn't look dead simple and straightforward, if I may say. There wil be some searches with "letter/envelope" as keyword during the weekend.
But thanks alot!
Haakon.
|
|
|
|
|
Look also for "handle/body" and "pimpl", which are alternate names of this idiom.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
check also for "pimpl" private implementation; the Effective C++ book has a section on this.
Max.
|
|
|
|
|
How about adding copy constructors for in each class for the opposite type like you suggest.
Another method, which I just did, is combine them and add a bool (or enum) stating which animal it is. (Okay, it's ugly but in my case, I needed only one "cat" for every 10 "dogs" and the difference was that the "cat" required two less data members than "dog", but was otherwise identical, so it isn't exactly similar.)
|
|
|
|
|
My original project was using VC98\include\ as the directory. Recently, because I need to use one of defined valuable (PM_QS_PAINT)which is defined in Platform SDK, so I installed SDK with the option "Integrate with VC++" and move the SDK include directory to the top of the directory in options dialog in VC++. When I complied, I got compile errors from StdAfx.h like " error in ..\vc98\include\transact.h: miss ";" before some valuable.". If I removed the SDK directory below the VC++ include directory, those error disappeared, but got error for undefined valuable "PM_QS_PAINT".
Anyone knows how to fix those problem? Thanks.
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
I want to know that which message and related parameters gets generated when we bring the mouse at the corners and sides of window and resize it.
|
|
|
|
|
WM_SIZE
read the documentation, sometimes, it helps ...
Max
|
|
|
|
|
There are a number of messages that get sent, and it also depends on whether you have FullWindowDragging set depending on which messages actually get sent. The previous poster answered your question with WM_SIZE, which is true. But there are more messages that get sent when you are resizing a window.
If you give a little detail of what you are trying to do, we can probably give you a better answer that will help you accomplish what you are doing.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Add to the previous replies : you can use Spy++ , it will show all the messages.
|
|
|
|
|
can i calculate width and hegiht of a string with help of log font.
i can not use =pDC->GetOutputTextExtent(*txt); or underlaying API.
some hint or way.
thanks in anticipation.
regards
|
|
|
|
|
|
Yes Performance. i am to calculate font size to display it with in
a rect. i am to do it for at different angles . and for for more than
200 entities at a time.
i have done it with GetOutputTextExtent but it becomes too slow.
my function is like this.
long counter=1;
long Y1 =0;
long Y2 =0;
long X1=0;
long X2=0;
if(Vertical==TRUE)
{
tfont->SetEscapement(900);
Y1=rect->top;
Y2 = rect->bottom;
X1 = rect->left;
X2 = rect->right;
}
else
{
Y1 = rect->left;
Y2 = rect->right;
X1 = rect->top;
X2 = rect->bottom;
}
while(true)
{
font->SetHeight(counter);
CFont * oldfont = pDC->SelectObject(font);
// Problem each time i am selecting it in device context to check for new
// size. that makes it slow
CSize sz =pDC->GetOutputTextExtent(*txt);
if(sz.cx>=(Y2-Y1)||sz.cy>=(X2-X1)) //text size is equal to rect
{
pDC->SelectObject(oldfont);
return counter; // so return counter;
}
pDC->SelectObject(oldfont);
counter++;
}
return counter;
|
|
|
|
|
What about CDC::DrawText with DT_CALCRECT?
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Hi,
I have some relative paths (like "../../mydir/myfile.htm") to convert to absolute paths "http://www.myserver.com/mydir/myfile.htm".
Is there something like _tfullpath for file systems?
Thanks
R.
|
|
|
|
|
It s to good to answer one's own question: InternetCombineUrl suits my needs perfectly
R.
|
|
|
|
|
Hi,
I need to add to my application some stuff for html generation and editing, I'm thinking about using MSHTML ( and make an small editor, with some basic stuff), or using Front Page Automation ...
Is Front Page automation more or less ok ? ( I mean Word Automation is not that bad... but outlook automation seems to be hell...).
Thanks in advance, greetings
Braulio
|
|
|
|