|
Don't use CArchive classes to communicate with standard TCP/IP applications. They work properly only when the other end uses CArchive as well. You should use straight WinSock functions to communicate with a SMTP server.
|
|
|
|
|
Using CArchive::WriteString() and CArchive::ReadString() is fine. The other CArchive member functions (except Read() and Write() ) won't work, as you said.
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"
|
|
|
|
|
|
Try to add a "\r\n" (carriage return and line feed, is this order) after your SMTP commands...
Ex:
arOut->WriteString( "HELO SIR\r\n" );
arOut->Flush();
?
|
|
|
|
|
How does one go about drawing line numbers to an MFC application? Would I simply use a pen in my derived CView OnDraw function and draw the current lines or is there a different way? Thanks.
|
|
|
|
|
mcguile257 wrote:
Would I simply use a pen in my derived CView OnDraw function and draw the current lines
Yes.
mcguile257 wrote:
is there a different way?
No.
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"
|
|
|
|
|
I'm trying to come up with an algorithm which will generate a readable hash index for use in a project.
The string I can play with is "ABCDE".
The aim is to generate the smallest number of characters to represent each unique display of those characters. Like this
"A"
"B"
"C"
"D"
"E"
"AA"
...
"AE"
"BA"
..
"BE"
..
"EE"
"AAA"
...
"EEE"
etc.
I just can't seem to get it.. Any clues or the name of this particular programming challenge appreciated.
|
|
|
|
|
Kinda cheesy but here's one way:
CStringArray arr;
CString str;
for (char l1 = 'A'; l1 <= 'E'; l1++)
{
str = l1;
arr.Add(str);
}
for (l1 = 'A'; l1 <= 'E'; l1++)
{
for (char l2 = 'A'; l2 <= 'E'; l2++)
{
str = l1 + l2;
arr.Add(str);
}
}
for (l1 = 'A'; l1 <= 'E'; l1++)
{
for (char l2 = 'A'; l2 <= 'E'; l2++)
{
for (char l3 = 'A'; l3 <= 'E'; l3++)
{
str = l1 + l2 + l3;
arr.Add(str);
}
}
}
for (l1 = 'A'; l1 <= 'E'; l1++)
{
for (char l2 = 'A'; l2 <= 'E'; l2++)
{
for (char l3 = 'A'; l3 <= 'E'; l3++)
{
for (char l4 = 'A'; l4 <= 'E'; l4++)
{
str = l1 + l2 + l3 + l4;
arr.Add(str);
}
}
}
}
for (l1 = 'A'; l1 <= 'E'; l1++)
{
for (char l2 = 'A'; l2 <= 'E'; l2++)
{
for (char l3 = 'A'; l3 <= 'E'; l3++)
{
for (char l4 = 'A'; l4 <= 'E'; l4++)
{
for (char l5 = 'A'; l5 <= 'E'; l5++)
{
str = l1 + l2 + l3 + l4 + l5;
arr.Add(str);
}
}
}
}
}
I believe that yields 3,905 (51 + 52 + 53 + 54 + 55) combinations.
|
|
|
|
|
may you describe it a bit more?
but... if you create a "normal" hashkey which
is suitable for the hashspace, and then transform it to ASCII?
LOWELL = 76 79 87 69 76 76
-> S = 7679 + 8769 + 7676 = 24124
your hashspace is 19937 (should be prime)
24124 % 19937 = 4187
and now put it to ASCII 41 and 87
|
|
|
|
|
I have a 2D array (1024x1024) of intensity values of an image in my VC++ code(which is not stored on disk as a bmp or jpeg), and I have a dialogbox which contains an image within a frame of 400x400 pixels already. I want to compress my 1024x1024 array of pixels and set a transperent mask of this on top of the existing image in my dialog box. I am trying to find the best way to do it. Any suggestions would be appreciated.
|
|
|
|
|
Does anyone have a small C++ example on how to use the Image Mastering API (IMAPI) in Windows XP?
In what file does the type library appear in? There is an executable called imapi.exe in the System32 directory but it does not contain the type library.
Regards
Martin
|
|
|
|
|
I have been messing around with the start menu caption.. it's easy in WinXP as once you have EnumChildWindow'ed your way down to it, it's just a case of ::SetWindowText(). However, it's not so easy in W2K as the window text does not correspond to the text in the button... I see that is has the BS_BITMAP style so it's all a bitmap??
any suggestions?!
cheers
Ad.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
adamUK wrote:
I see that is has the BS_BITMAP style so it's all a bitmap??
Yes that's correct. Windows explorer creates the bitmap at runtime from the text and the flag icon. You can do the same, if you want to
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"
|
|
|
|
|
adamUK wrote:
any suggestions?!
See http://www.winguides.com/registry/display.php/791/
|
|
|
|
|
|
Hi,
I am trying to create a Modeless Dialog Box with a RichEdit Control using Visual Studio.Net. I am not using MFC as my project is a Win32 project using just the Windows API, but the Rich Edit Control Does not get created when I pass the Dialog Template to CreateDialog(), when I change the resource to a normal Edit control everything works fine. I tried another option of Creating the control using CreateWindow("RICHEDIT"....), this does not seem to work too, I tried getting the Last Error and found that the "RICHEDIT" class is not registered, I tried "RichEdit20A" and that failed too, can someone let me know what I am missing here? Note that this is not an MFC application but plain Win32 API application.
-TIA
Sundar
|
|
|
|
|
Have you initialised it using BOOL AFXAPI AfxInitRichEdit() in the initinstance of your app? I can't remember if it is purely and MFC requirment or not...
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
You need to load the rich edit ctrl library before creating any rich edit controls. Load "riched20.dll" for rich edit version 2+, or "riched32.dll" for version 1.
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Hello all,
My App needs to load a a list of configurations into a list view at load time. The list will then be user modifiable (add, delete, edit).
What would you all consider to be the best way to do this. An INI file storing each configuration and stored in a folder under the working folder, and loaded at runtime? Or, doing the same thing in the registry.
And, how would you keep track of the items so that the correct number are re-loaded back at runtime. For example:
At startup the list contains 4 items. Item0, Item1, Item2, and Item3. The user deletes Item2. Now there is no real index to keep track of, I can see there are 3 files, but loading them in any logical progression is no longer an option.
Thanks for any suggestions you may have.
Frank
"Keyboard Error - Press F1 to Continue"
|
|
|
|
|
What is the maximum size of the list of configurations? If it is relatively small, one solution is registry. Otherwise, one solution is to save the configurations on disk.
Kuphryn
|
|
|
|
|
Hi All,
I want to write Windows Service in VC++. How should i do it? can someone give me sample code for this?
Thanking u in advance.
Bye,
Prasad
|
|
|
|
|
|
Hello all,
I'm writing an application in which requires the list of processes currently running. Is there any to do it and also I would like to know whether we can can get handle to a specific process or not. I anyone knows how to do it, please help me.
Thanks for your help.
|
|
|
|
|
Look at EnumProcesses() in the psapi library.
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"
|
|
|
|
|
Hi!
Are memory mapped files typically used for loading/saving speed, or is it just to handle incredibly large files?
I'm currently in a situation where I need to load and parse large
files (~20 MB) and I'm wondering about the different strategies for doing that as fast as possible.
Thanks
Shawn
|
|
|
|