|
It would exclude the duplicates :
void AddTail(CUintArray* pcArray, UINT uiNew)
{
if (pcArray) {
int iCount(pcArray->GetCount());
if (!iCount ||
pcArray[iCount -1] != uiNew) {
pcArray->Add(uiNew);
}
}
}
virtual void BeHappy() = 0;
|
|
|
|
|
I prefer the precondition, since it makes the merge function acting on homogeneus arguments.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CUIntArray does not provide a 'Merge ' method hence you have to write your own.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
One possibility would be to merge them together, and then use std::unique() with erase() . Without actually trying it, however, I can't say for sure.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Good idea, unfortunately the OP chose an MFC class.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Which is why I used the word possibility. It would require him to get the contents of the CUIntArray moved to an STL container first.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Yes, it is a nice idea. My 'unfortunately' was in fact a subtle suggestion (too subtle, I guess) to discard the MFC class.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Another class from the same header :
void ProcessMerging(CMap<UINT,UINT,UINT,UINT>* pcResult,
const CUIntArray& caFirst,
const CUIntArray& caSecond)
{
if (pcResult) {
pcResult->RemoveAll();
int iFirstSize(caFirst.GetCount()),
iSecondSize(caSecond.GetCont()),
i(0);
for (i = 0; i < iFirstSize; i++) {
pcResult->SetAt(caFirst[i], 0);
}
for (i = 0; i < iSecondSize; i++) {
pcResult->SetAt(caSecond[i], 0);
}
}
}
virtual void BeHappy() = 0;
|
|
|
|
|
Hi,
I am tring place a progress bar on dialog and make it Marquee Progress Control in win32. I tried with some code in InitDialog ():
HWND hwndProgress=GetDlgItem(m_hwnd,IDC_PROGRESS1);
::SetWindowLongPtr(hwndProgress,GWL_STYLE,PBS_MARQUEE);
::SendMessage(hwndProgress,(UINT) PBM_SETMARQUEE,(WPARAM) TRUE,(LPARAM)50);
But Progress bar is not visible. If I comment SetWindowLongPtr(), progess bar visible but not marquee.
Plz guide.
|
|
|
|
|
Try it :
HWND hwndProgress = GetDlgItem(m_hwnd, IDC_PROGRESS1);
LONG_PTR lStyle = ::GetWindowLongPtr(hwndProgress, GWL_STYLE);
lStyle |= PBS_MARQUEE;
::SetWindowLongPtr(hwndProgress, GWL_STYLE, lStyle);
::SendMessage(hwndProgress, PBM_SETMARQUEE, WPARAM(TRUE), LPARAM(50));
virtual void BeHappy() = 0;
|
|
|
|
|
Thanks for reply but above code is working with MFC application but not win32 application.
In win32 Only blank Progress bar is coming.
I am using VS 2005.
Any help?
|
|
|
|
|
Try to change the control line in your .rc file:
CONTROL "",IDC_PROGRESS1,"msctls_progress32",PBS_MARQUEE,7,7,156,14
...and then send only the PBM_SETMARQUEE message in your init scope
virtual void BeHappy() = 0;
|
|
|
|
|
If I change It display error:
error RC2104 : undefined keyword or key name: PBS_MARQUEE
I defined the PBS_MARQUEE in resource.h , error is not coming but progress bar is still empty and not in marquee mode.
modified on Friday, April 9, 2010 5:44 AM
|
|
|
|
|
Try to set it at the beginning of the .rc file, just for a test :
#define PBS_MARQUEE 8
virtual void BeHappy() = 0;
|
|
|
|
|
ya I did but not working.
Same blank progress bar is coming.
|
|
|
|
|
Is it presented on the test machine ? :
Minimum DLL Version comctl32.dll version 6.00 or later
Minimum operating systems Windows XP
virtual void BeHappy() = 0;
|
|
|
|
|
This file (COMCTL32.DLL) is exist in system32 folder.
File Version is: 5.82.2900.2180
OS -Windows XP
But on the same machine MFC marquee progress bar is working.
Now Please suggest????
|
|
|
|
|
Try to save this file as c:\common.manifest
and set it (c:\common.manifest ) at ProjectSettings->ManifestTool->InputAndOutput->AdditionalManifestFiles :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
...or make the same settings as at your MFC project
virtual void BeHappy() = 0;
|
|
|
|
|
Thanks a lot..its working
|
|
|
|
|
This was incredibly helpful. It also seems to be the only place I can find where this is actually documented. Thank you.
|
|
|
|
|
Hi,
I am opening an aspx page using the following code.From that aspx page,i will return some value using Response.Write("hi"); function.I want to get this string.How to get it from the aspx page to VC++.
CInternetSession objInetSession;
char szURL[100];
CStdioFile* objStdFile;
try
{
wsprintf(szURL,"%s","http://101.8.0.24/test/test.aspx");
objStdFile = objInetSession.OpenURL(szURL,1,INTERNET_FLAG_TRANSFER_ASCII ,NULL,0);
}
catch(CInternetException* exp)
{
exp->ReportError(MB_OK,0);
}
Thanks,
|
|
|
|
|
use CHTTPFile and CHTTPConnection.
|
|
|
|
|
Hello, I use this code. It's only a little
different and it should answer your Question.
CInternetSession objInetSession;
CHttpFile *pHttpFile;
CString tmpStr;
char inBuf[10000];
UINT nBytesRead;
try
{
pHttpFile =(CHttpFile *) objInetSession.OpenURL(
CString("http://localhost"),
1,
INTERNET_FLAG_TRANSFER_ASCII,
NULL,
0
);
}
catch(CInternetException* exp)
{
AfxMessageBox((LPCTSTR)"Some thing went astay",0,0);
}
nBytesRead = pHttpFile->Read(inBuf, sizeof(inBuf));
AfxMessageBox(CString(inBuf,nBytesRead));
}
return nRetCode;
|
|
|
|
|
|
Well, you'r entirely welcome.
I am most happy to edify.
|
|
|
|