|
Michael Dunn wrote:
You can use the STL equivalent, std::vector
:-DI can use CAtlArray instead.
modified 1-May-21 21:01pm.
|
|
|
|
|
Yes, but why would you ? Seriously, why are people so scared of learning STL, when it's so much better ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
CAtlArray has some advantages over std::vector. For one it is a LOT like the old (and crappy) CArray. It also produces a lot smaller code than std::vector.
Now that being said, I have to agree that people should take the plunge and learn STL so they can make intelligent decisions on when to use which container. If I was doing a project with STL already in it, std::vector is a no brainer. However, if I was doing a pure WTL/ATL program with no STL and didn't need all the nice STL features, I would have no problem using CAtlArray.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
STL requires CRT, doesn't it?
|
|
|
|
|
I doubt it.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
From "Avoiding the Visual C++ Runtime Library By Matthew Wilson"[^]:
The implementation of some of the STL classes that ship with Visual C++ means that the CRT Library is required for some, but not all, parts of the STL Library. For example, if you declare a single string, with a literal string constructor argument, the linker reports that it cannot see the following symbols:
"void __cdecl std::_Xlen(void)"
(?_Xlen@std@@YAXXZ)
___CxxFrameHandler
__except_list
__EH_prolog
Also, virtually no parts of the iostreams are usable without the CRT Library.
However, other parts of the library are eminently usable without the CRT Library, including auto_ptr, list, map, and vector, along with the algorithms and functionals.
|
|
|
|
|
I`m writing my own thesaurus, and I have some problem:
How to find a word (CString) in multimap and get index (int) of this word?
Can somebody tell me where I can find some examples of thesauruses in VC++
Hegemon
|
|
|
|
|
You can find the word by using the multimap container's find method. As for the index to the word, what do you mean by that? There are no indexes in maps, per-say; however, you can get an iterator that references the matched pair (Which I gather is a CString-to-int), but not an integer (unless you mean the int that is paired with the CString in which case you would just dereference the iterator returned by find and access the second data members).
cheers,
-B
|
|
|
|
|
modified 1-May-21 21:01pm.
|
|
|
|
|
chain to the base class. Reflect to local controls in the class.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I want to create a HTML control using ATL Wizard. I tried creating it using the ATL HTML Control. But when i tried to test it (both in ActiveX test container and in browser) i am gettting the error 'Object doesn't support this property or method'. (when it tries to call 'OnClick' , i.e when i click the button called 'Red', 'Green', 'Blue') I tried in Win98 and WinXp. I use VC6.
Can any one help with what i can i do to get this working?
Thanx in advance.
Mahesh
|
|
|
|
|
Mahesh,
try sellsbrothers.com/tools/[^]. There's a header file you can download that gives you a bit more information.
"If we knew what it was we were doing, it would not be called research, would it?"
- Albert Einstein
|
|
|
|
|
I built a COM component with ATL and have it tested with a simple VB program. It works fine so I concluded the component is OK. However when I called in a ASP page, it complaint the "Library not registered". I am very confusing because the VB can see the type library so it must be registered. Why the ASP page not seeing it?
I read MSDN article ID: Q221792
PRB: "Library Not Registered" Error When Calling Method in ATL Server and follow the instruction, it doesn't seem help. Can anyone help me out?
|
|
|
|
|
I have my WTL app's menu inside a CommandBar control. Now I want to process some notifications it sends but it doesn't seem to send them to the parent. How can i make it send these notifications to the parent or is there a better way for daeling with this???
|
|
|
|
|
Hi All,
I’m handling events of ADO in an ATL out-of-process server, and for some reasons when I use _ATL_FREE_THREADED declaration event ConnectComplete is not called when I establish an asynchronous connection, thou it is called when I use a synchronous connection. Changing the memory model to _ATL_APARTMENT_THREADED solves the problem, but what is the reason of such strange behaviour anyway, and what’s the
proper solution?
Regards,
Vitaly Tomilov
|
|
|
|
|
Hi:
I want to use IE/Explorer toolar band in my application, is it possible?
Could you give me some ideas?
thanks
benben
|
|
|
|
|
I want return a recordset for script, in c++ this type is _RecordsetPtr, I don't know how to convert it for script variable.
|
|
|
|
|
Return a variant of type IDispatch to the script.
|
|
|
|
|
How to make my control support set/get property by "=".
Thank you very much!
|
|
|
|
|
Are you thinking of something like __declspec(property) ?
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Sorry for posting code here, but someone asked me about a week ago for some code, but I can't find the request now (the CP comment search doesn't search for a whole phrase, so I can't narrow down the results enough to find the one I want).
Anyhoo, to add support for radio-checked menu items only takes a few lines, however if you don't want to modify atlframe.h, you need to make a CUpdateUI2 class and copy over 3 functions from CUpdateUI . Here's the entire class, my changes are marked with //*** BEGIN and //*** END
template <class T>
class CUpdateUI2 : public CUpdateUI<T>
{
public:
BEGIN_MSG_MAP(CUpdateUI2<T> )
MESSAGE_HANDLER(WM_INITMENUPOPUP, OnInitMenuPopup)
if ( WM_INITMENUPOPUP != uMsg )
{ CHAIN_MSG_MAP(CUpdateUI<T> ) }
END_MSG_MAP()
LRESULT OnInitMenuPopup(UINT , WPARAM wParam, LPARAM , BOOL& bHandled)
{
bHandled = FALSE;
HMENU hMenu = (HMENU)wParam;
if(hMenu == NULL)
return 1;
_AtlUpdateUIData* pUIData = m_pUIData;
if(pUIData == NULL)
return 1;
::SetMenuDefaultItem(hMenu, (UINT)-1, 0);
const _AtlUpdateUIMap* pMap = m_pUIMap;
while(pMap->m_nID != (WORD)-1)
{
if(pMap->m_wType & UPDUI_MENUPOPUP)
UIUpdateMenuBarElement(pMap->m_nID, pUIData, hMenu);
pMap++;
pUIData++;
}
return 0;
}
BOOL UIUpdateMenuBar(BOOL bForceUpdate = FALSE, BOOL bMainMenu = FALSE)
{
if(!(m_wDirtyType & UPDUI_MENUBAR) && !bForceUpdate)
return TRUE;
const _AtlUpdateUIMap* pMap = m_pUIMap;
_AtlUpdateUIData* pUIData = m_pUIData;
if(pUIData == NULL)
return FALSE;
while(pMap->m_nID != (WORD)-1)
{
for(int i = 0; i < m_UIElements.GetSize(); i++)
{
if(m_UIElements[i].m_wType == UPDUI_MENUBAR)
{
HMENU hMenu = ::GetMenu(m_UIElements[i].m_hWnd);
if(hMenu != NULL && (pUIData->m_wState & UPDUI_MENUBAR) && (pMap->m_wType & UPDUI_MENUBAR))
UIUpdateMenuBarElement(pMap->m_nID, pUIData, hMenu);
}
if(bMainMenu)
::DrawMenuBar(m_UIElements[i].m_hWnd);
}
pMap++;
pUIData->m_wState &= ~UPDUI_MENUBAR;
if(pUIData->m_wState & UPDUI_TEXT)
{
free(pUIData->m_lpData);
pUIData->m_lpData = NULL;
pUIData->m_wState &= ~UPDUI_TEXT;
}
pUIData++;
}
m_wDirtyType &= ~UPDUI_MENUBAR;
return TRUE;
}
static void UIUpdateMenuBarElement(int nID, _AtlUpdateUIData* pUIData, HMENU hMenu)
{
MENUITEMINFO mii;
memset(&mii, 0, sizeof(MENUITEMINFO));
mii.cbSize = sizeof(MENUITEMINFO);
mii.fMask = MIIM_STATE;
mii.wID = nID;
if(pUIData->m_wState & UPDUI_DISABLED)
mii.fState |= MFS_DISABLED | MFS_GRAYED;
else
mii.fState |= MFS_ENABLED;
if(pUIData->m_wState & UPDUI_CHECKED)
mii.fState |= MFS_CHECKED;
else
mii.fState |= MFS_UNCHECKED;
if(pUIData->m_wState & UPDUI_DEFAULT)
mii.fState |= MFS_DEFAULT;
if(pUIData->m_wState & UPDUI_RADIO)
{
mii.fMask |= MIIM_FTYPE;
mii.fState |= MFS_CHECKED;
mii.fType |= MFT_RADIOCHECK;
}
else
mii.fMask |= MIIM_FTYPE;
if(pUIData->m_wState & UPDUI_TEXT)
{
MENUITEMINFO miiNow;
memset(&miiNow, 0, sizeof(MENUITEMINFO));
miiNow.cbSize = sizeof(MENUITEMINFO);
miiNow.fMask = MIIM_TYPE;
miiNow.wID = nID;
if(::GetMenuItemInfo(hMenu, nID, FALSE, &miiNow))
{
mii.fMask |= MIIM_TYPE;
mii.fType |= (miiNow.fType & ~(MFT_BITMAP | MFT_SEPARATOR)) | MFT_STRING;
mii.dwTypeData = (LPTSTR)pUIData->m_lpData;
}
}
::SetMenuItemInfo(hMenu, nID, FALSE, &mii);
}
};
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
How can I connect a client application running behind a proxy to a web server?
The connection cannot be a direct TCP to the server as the proxy is in between. I can have a Http connection , the way a browser works. But how do I achieve it. Any suggestions??
|
|
|
|
|
simply enough - create a tcp connection to the proxy machine and then send your request as usual. Only difference is, that the request should be in a 'full' form. Instead of:
<br />
GET /page.htm HTTP/1.1<br />
...
you'd use:
GET www.codeproject.com/page.htm HTTP/1.1<br />
...
I'm not sure about the http: prefix, but you can check it in RFC.
Then the proxy you are connected to, simply parses the URL from the request and forward it to the right machine.
This is mostly all you have to do. If you want to be absolutely correct, there are some client-proxy specific headers like 'Proxy-Authentication ' etc. but these are also described in RFC.
Hope this helps
|
|
|
|
|
What I have read about Http CONNECT is that it is used to establish a secure connection to the server.Does that mean that I can connect only to port 443 of the Listner i.e. server?
Can I connect to the port 80 of the server i.e specify the ip address:80 in the CONNECT method
|
|
|
|
|
CONNECT is used for creating a tunnel through the proxy - useful mostly for secure connections. It simply tells the proxy that it have to make connection to the server & port you specified - the syntaxe addr:port should be valid then. I will try to clarify the intent of the command CONNECT :
Normally the proxy 'understands' the flow of the http connection, and time to time he even changes it - e.g. instead of requesting the page from the server it sends the page from the local cache etc.
But when using the CONNECT command, this is not true and the connection is then transparent - what you send to the server is what the server receive and vice versa.
This is the reason, why it is used when secured channel is needed. Because if the proxy will try to change the encrypted data (e.g. take the encrypted page from the cache) it will make an error during the decryption on the client (this is a must, else the secure channel will not be secure ).
So, yes, as far as I know, you can connect to the port 80 of the server through the CONNECT , but then the pages will not be cached (which can be as well advantage as disadvantage ).
Only take a care, that there are some proxies, that doesn't support the CONNECT command, or doesn't support it correctly. But I think currently most of them do.
Hope this helps
|
|
|
|