|
What is the difference between CSocket and WinSock.
Be FaithFull To Your Work.
|
|
|
|
|
42, of course.
(Smells like homework).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The latter is an API, while the former is a class that encapsulates this API.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello All,
I have been working on a DLL (Regular DLL with MFC statically linked) that contains a CDialog that I would like to run as modeless. In order to reset the CWinApp's ref to the Dialog to NULL when the Dialog closes, I am trying to store a pointer to the CWinApp so that I can m_pApp->setMyDlgNull(). It seems as if this should work, but whenever I try to add the pointer into my CDialog class, the compiler acts like it does not know what my CDLLApp is. I am not sure what is going on as I have #included my CWinApp's header and I can get the popup with my setMyDlgNull() function when using CDLLApp:: (does not happen when i do not #include).
I am sure that I have made the most idiotic mistake so go easy on me
|
|
|
|
|
Can anyone tell me if MSDN .NET 2003 is available for download? I remember a 4 Gbyte DVD version was available a few months back, but I was hoping that I could get something that I can put on normal CDs because I do not have a DVD in my computer. I ran a few searches online but I cannot find anything. I am just wondering if it is available at all?
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
|
Thank you for the ingenious idea. Have you applied for the Nobel Prize recently in the area of critical thinking? If you haven’t please don’t let you ingenuity go to such a waste.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
He's right. It's only available for download to MSDN subscribers...
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"
|
|
|
|
|
Ryan Binns wrote:
He's right. It's only available for download to MSDN subscribers...
Thank you very much Ryan. That's an answer that I understand.
About the anonymous reply: He didn't really answer my question. I didn't ask for the nearest store. I asked whether I could download it. I already have it on a DVD and I can get the CDs for $3 here at the place where I work but it would take them several days to deliver the CDs to me. I need it today but it is clear that that's not going to happen .
Once again thank you.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
Toni78 wrote:
About the anonymous reply: He didn't really answer my question.
Agreed, but (no offence intended) you could possibly have phrased your answer a little more politely
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"
|
|
|
|
|
Ryan Binns wrote:
Agreed, but (no offence intended) you could possibly have phrased your answer a little more politely
None taken. Once again thank you.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
sorry about the formatting - i don't know how to make a table.
take these numbers...
Cost; Age; Cost * Age
x; 6;
8,025; 20; 160,500
346,950; 47; 16,306,650
279,252; 58; 16,196,616
387,640; 69.2; 26,824,688
84,500; 80; 6,760,000
Totals
1,106,367; 59.9; 66,248,454
the task is to find x which brings the total Age (59.9) down to 40. now, the total cost number (1,106,367) can not change. meaning, x must be subtracted out starting from the bottom. so, if x is 80,000, 84,500 is reduced to 4,500 and Cost * Age becomes 360,000. the idea is bring total Cost * Age down to 44,254,680 (1,106,467 * 40).
i just can not for the life of me figure out how to calculate x. can anyone help?
thanks.
|
|
|
|
|
How is the age total 59.9 when you have 6 + 20 + 27 + 58 + ...
How can you choose x to be anything but 0 if you want to total cost to remain the same?
I don't think your problem is well defined.
|
|
|
|
|
Homework alert. Homework alert. If this had been an actual programming question, you would see real live answers from actual programmers. This has been a service of the Emergency Programming Association.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
godzooky, the problem is a bit complicated. It is one of those problems that are studied in game theory and linear programming. I tried to solve it but my current mathematical skills leave much to be desired for. I have a minor in it but I can barely remember to solve a second degree equation and let alone a system of equations with a lot of restrictions. By increasing and decreasing the costs you decrease and increase the rate of the function Cost*Age. You have to find a point in where the rate you increase X and the rate where you decrease the other costs have to satisfy the condition that SUM OF ALL (Cost*Age) ~ 44,000,000.
Let me give you something to start with and you might try to get a feasible solution from there. Lets call Cost Ci where i = 0 to 5 and where Ci = x, C2 = 8,025 and so on. Ai is the Age and Ci*Ai = Cost*Age.
The initial equation is:
C0*A0 + C1*A1 + …+C5*A5 = 66,248,454. C0 is X and it’s initially 0 so this becomes:
A0 + C1*A1 + …+C5*A5 = 66,248,454
Ai doesn’t change, only Ci does and lets call Di the amount that we will increment and decrement Ci.
(C0+D1+D2+..D5)*A0 + (C1-D1)*A1+…+(C5-D5)*A5= 44,254,680.
Don’t forget that since C0 = X which is 0 initially then D1+D2+…+D5 becomes your answer. Now you have to write some code which will assign values to Di until the equation is satisfied. At first I would recommend that you decrease those costs where the age is the highest because there the rate of the increase is higher and then slowly proceed with the other costs where the age is lower.
Sorry, but this is the only help that I can provide at the moment.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
Friends,
I want to programatically launch MS-Word document say like c:\\MyFolder\\MyFile.doc . I am trying CreateProcess() but it is not working for me. I think i am doing something wrong while giving first and second parameters of this function. On client machine the word document can be present at any location of the drive and MS Word can be installed in any location.
Plese tell me how to launch MS Word document when we know its fully qualified name. I dont want to use Automation
Imtiaz
|
|
|
|
|
I use this:
{
SHELLEXECUTEINFO ShExecInfo;
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = 0;
ShExecInfo.lpFile = DocName;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
}
Just put your document's name in DocName and the system will find the program that handles the document. I have used it with a .rtf document and it loads MSWord on systems that have MSWord or it loads WordPad on the systems that don't have MSWord.
|
|
|
|
|
Hi All,
Is there way in which i could monitor the controls in Webpage(IE) using hooks in VC++. (say, the userid or password edit box in yahoo)
I have tried invain to get any handle to these 'inner' windows inside the internet explorer.
awaiting your suggestion/hints.
regards
Ramesh
|
|
|
|
|
The controls that appear in a webpage aren't anything like the standard controls you see elsewhere in Windows. IE has its own APIs for accessing them.
You must be careful in the forest
Broken glass and rusty nails
If you're to bring back something for us
I have bullets for sale...
|
|
|
|
|
|
m_ramesh31 wrote:
Is there way in which i could monitor the controls in Webpage(IE) using hooks in VC++.
No need to use Hook, When MS Provide you direct access to IE using BHO, here is link for that!
http://msdn.microsoft.com/library/en-us/dnwebgen/html/bho.asp[^]
m_ramesh31 wrote:
the userid or password edit box in yahoo)
Are you writing the SpyWare Application? :->
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi All,
Using VC6 I am connecting to a database via OLEDB/ODBC. My locale
regional settings are set to French while I investigate this problem.
When I read values from a table, I convert everything to strings like
the following:
m_pCommand->AddBindEntry(l+1, DBTYPE_WSTR, sizeof(TCHAR)*256,<br />
&m_pColumns[l].szValue, NULL, &m_pColumns[l].dwStatus);
So as you can see, all fields are bound to DBTYPE_WSTR
Now when I read a currency value or a numeric value with decimal
places, the value ALWAYS looks like this "23.23" when it should look
like "23,23" with my current regional settings. The decimal seperator
is a ',' and not a '.'
If I query the database with Access, Excel, Crystal Reports they always
give me the correct values with correct decimal seperators so I feel I
must be missing a trick.
I connect to the database like this:
CComPtr<IDBPromptInitialize> spDBInit;<br />
hResult = CoCreateInstance(CLSID_DataLinks, NULL, CLSCTX_INPROC_SERVER,<br />
IID_IDBPromptInitialize, (void**) &spDBInit);<br />
<br />
if (hResult != S_OK)<br />
return RES_DBCONNECTION_OPEN_DATALINKS;<br />
<br />
DBPROMPTOPTIONS dwPromptOptions = DBPROMPTOPTIONS_WIZARDSHEET;<br />
CComPtr<IDBProperties> spIDBProperties;<br />
<br />
hResult = spDBInit->PromptDataSource(NULL, m_hProgressDlg,<br />
dwPromptOptions, 0, NULL, NULL, IID_IDBProperties,<br />
(IUnknown**)&spIDBProperties);<br />
<br />
if (hResult != S_OK)<br />
{<br />
if (hResult == DB_E_CANCELED) {<br />
return RES_CANCELED;<br />
} else {<br />
ShowOLEDBErrors(hResult);<br />
return RES_DBCONNECTION_OPEN_DATALINKS;<br />
}<br />
<br />
}<br />
<br />
LCID locale = GetUserDefaultLCID();<br />
CDBPropSet dbInit(DBPROPSET_DBINIT);<br />
<br />
dbInit.AddProperty(DBPROP_INIT_HWND, (long int)m_hProgressDlg);<br />
dbInit.AddProperty(DBPROP_INIT_PROMPT, (short)DBPROMPT_COMPLETE);<br />
dbInit.AddProperty(DBPROP_COMMITPRESERVE, (bool)TRUE);<br />
dbInit.AddProperty(DBPROP_ABORTPRESERVE, (bool)TRUE);<br />
dbInit.AddProperty(DBPROP_INIT_LCID, (long int)locale);<br />
spIDBProperties->SetProperties(1, &dbInit);<br />
<br />
hResult = spIDBProperties->QueryInterface(&m_source.m_spInit);<br />
if (hResult != S_OK)<br />
{<br />
ShowOLEDBErrors(hResult);<br />
return RES_DBCONNECTION_OPEN_DATALINKS;<br />
}<br />
<br />
hResult = m_source.m_spInit->Initialize();
There is a microsoft article that I thought may be making things wrong
which is at
http://support.microsoft.com/defaul...;EN-US;Q320744& But
the resolutions suggested have made no effect.
Any suggestions that anyone could offer would be greatly appreciated.
Thank you,
Chris
|
|
|
|
|
I was able to create the file larger than 4 Gb. However, I want to be able to read the last line to see where it stopped. This code outputs the whole file but works when the file is less than 4Gb. What's wrong?
Thanks,
ifstream inClientFile ("diction.txt", ios::in);
inClientFile.seekg(-10, ios::end);
char w[30];
while (inClientFile>>w)
output(w);
void output(const char * const w)
{
cout<
|
|
|
|
|
i have another suggestion, independant from you (but i'm not sure)
isn't the streams (cout here) index on 32 bits ?
if so, even if you take the max value of an unsigned long , you'll be limited at position 4294967295 (4GB).
i don't think streams support __int64...
so if anyone have an idea to confirm/infirm my thinking...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
It does read the whole file. The only problem is that it reads the whole file regardless of the parameters. Does that constitute as supporting large file sizes?
|
|
|
|
|