Rich Edit control works ok but doesn't allow setting of TF_PLAINTEXT:
SendMessage(mhEditCtrl, EM_SETTEXTMODE, TM_PLAINTEXT, 0);
returns 0 which is supposed to indicate success according to the api docs. But it's not plain text because I can drag formatted text (with various fonts etc) into the...
random_shuffle produces the same random order each time. Is there any way the seed std::random_shuffle? (srand didn't help).
#include <vector>
#include <algorithm>
#include <iostream.h>
typedef struct {int i;} TESTSTRUCT;
using namespace std;
int main()
{
vector<TESTSTRUCT> vec...
I have a simple windows program which uses some wininet functions. However, I get "unresolved external" for all the wininet functions. When that happens in Visual Studio it means I need to add "wininet.lib" to the linker settings. However, I don't know how to do this on the...
In Visual Studio
Project Settings -> c/c++ -> Code-Generation -> Use run-time library
has three options: "SingleThreaded", "Multithreaded", "Multithreaded DLL", (and these again for debug).
Should I set this to "Multithreaded "if I'm using CRT functions...
When using the wininet function InternetFindNextFile(HFILE, WIN32_FIND_DATA*) to read an ftp directory, is the date for each remote file represented by any of the values in the WIN32_FIND_DATA struct?
There are three date values in WIN32_FIND_DATA: ftCreationTime, ftLastAccessTime...
Anyone ever seen this warning when using winsock:
Command line warning D4027 : source file 'wsock32.lib' ignored
It goes away if I take wsock32.lib out of the linker settings (but of course so does winsock!). It doesn't seem to affect anything but I would like to get rid of it.
Thanks in advance.
Having witnessed part of the horror of yesterday's events from my midtown Manhattan office window (before our building was evacuated), I would like to express my deepest respects and/or condolences to anyone who was directly or otherwise affected by yesterday's events.
- Sincerely
William C...
I was having problems iterating/reading through files from an ftp server. When reading the whole of each file everything was fine but attempting to read just the first few bytes of each file caused a strange behavior: every second and third call to FtpOpenFile() failed with error 12003. It turns...
Is there any win32 way to split a file into two files? I mean doing so "in place".
For example, if I have a 1GB file and I want the first 500MB's to be one file and the second 500MB's to be another file, can it be done?
I can easily do this by getting a file handle, copying the...
I have a component which fires a bunch of events. I have another component which is a wrapper for that component. The wrapper derives from DispEventSimpleImpl and therefore uses DispEventAdvise to hook up to the events in the first component.
I found that although I was receiving all the events...
I am subclassing a dialog and want to put the callback procedure into a class which manages that part of an application. I get the following cast error:
cannot convert from
'long (__stdcall ManagerObj::*)(struct HWND__ *, unsinged int, unsigned int, long)'
to
'unsigned long'
This occurs when...
I often see in programs (such as visual studio) a prompt indicating that a file which you have open has been modified by another user and whether or not you want to reload it. How would you go about doing this?
I usually use CreateFile for windows programs to read/write files, but I usually...
Calling Unadvise() in a connection point sink causes an access violation in ReleaseMinDependency build but not in Debug build.
Anyone ever seen this?
--Will Duty
wduty@radicalfringe.com
I am writing a program which will require allocating and deallocating a potentially large number of buffers. Is there any advantage to using malloc vs new vs GlobalAlloc vs LocalAlloc etc. ? I have used all of these methods to the same effect and never noticed any performance difference. Any...
I am able to fire events from an ATL object as long as the object is created as a full control. However, if the object is a simple ATL object, the component still compiles, registers, and works, except for the event-firing functionality. Watching the event firing code, the IDispatch pointer from...
I have three child windows in the main HWND of a program. I am subclassing one of them so as to be able to do some custom mouse-handling in that child. The callback I assign only seems to stick if I use GetChildFromPoint() when I switch the procedures. Attempting to use the window handle itself...
I have a program where I allow the user to determine the length of the selected text in an edit control. The user makes a menu selection which calls a function which gets the menu selection length (or the length of text in the whole control if there is no selection). The length then shows up in...
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.